| |
@@ -1,19 +1,30 @@
|
| |
- %{?!_without_python2:%global with_python2 0%{?_with_python2:1} || !(0%{?fedora} >= 30 || 0%{?rhel} >= 8)}
|
| |
- %{?!_without_python3:%global with_python3 0%{?_with_python3:1} || !0%{?rhel} || 0%{?rhel} >= 7}
|
| |
-
|
| |
%global srcname filelock
|
| |
+ %bcond_without docs
|
| |
|
| |
Name: python-%{srcname}
|
| |
- Version: 3.0.12
|
| |
- Release: 12%{?dist}
|
| |
+ Version: 3.3.1
|
| |
+ Release: 1%{?dist}
|
| |
Summary: A platform independent file lock
|
| |
|
| |
License: Unlicense
|
| |
- URL: https://github.com/benediktschmitt/py-%{srcname}
|
| |
- Source0: https://github.com/benediktschmitt/py-%{srcname}/archive/v%{version}/py-%{srcname}-%{version}.tar.gz
|
| |
+ URL: https://github.com/tox-dev/py-%{srcname}
|
| |
+ Source0: %{pypi_source %{srcname}}
|
| |
|
| |
BuildArch: noarch
|
| |
|
| |
+ BuildRequires: python3-devel
|
| |
+ BuildRequires: pyproject-rpm-macros
|
| |
+ # We cannot install extra dependencies because there are some
|
| |
+ # we do not have in Fedora like covdefaults in testing or furo in docs.
|
| |
+ # Test dependencies
|
| |
+ BuildRequires: python3-pytest
|
| |
+ BuildRequires: python3-pytest-timeout
|
| |
+ %if %{with docs}
|
| |
+ # Doc dependencies
|
| |
+ BuildRequires: python3-sphinx
|
| |
+ BuildRequires: python3-sphinx-autodoc-typehints
|
| |
+ %endif
|
| |
+
|
| |
%description
|
| |
This package contains a single module, which implements a platform independent
|
| |
file locking mechanism for Python.
|
| |
@@ -21,47 +32,16 @@
|
| |
The lock includes a lock counter and is thread safe. This means, when locking
|
| |
the same lock object twice, it will not block.
|
| |
|
| |
- %bcond_without docs
|
| |
%if %{with docs}
|
| |
%package doc
|
| |
Summary: Documentation for %{srcname}, %{summary}
|
| |
- BuildRequires: make
|
| |
- BuildRequires: python%{python3_pkgversion}-sphinx
|
| |
- BuildRequires: python%{python3_pkgversion}-sphinx-theme-alabaster
|
| |
|
| |
%description doc
|
| |
%{summary}
|
| |
%endif
|
| |
|
| |
-
|
| |
- %if 0%{?with_python2}
|
| |
- %package -n python2-%{srcname}
|
| |
- Summary: %{summary}
|
| |
- BuildRequires: python2-devel
|
| |
- BuildRequires: python2-setuptools
|
| |
- Conflicts: python%{python3_pkgversion}-%{srcname} < %{version}-%{release}
|
| |
- %{?python_provide:%python_provide python2-%{srcname}}
|
| |
-
|
| |
- %if 0%{?fedora}
|
| |
- Suggests: %{name}-doc
|
| |
- %endif # with_doc
|
| |
-
|
| |
- %description -n python2-%{srcname}
|
| |
- This package contains a single module, which implements a platform independent
|
| |
- file locking mechanism for Python.
|
| |
-
|
| |
- The lock includes a lock counter and is thread safe. This means, when locking
|
| |
- the same lock object twice, it will not block.
|
| |
- %endif # with_python2
|
| |
-
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
%package -n python%{python3_pkgversion}-%{srcname}
|
| |
Summary: %{summary}
|
| |
- BuildRequires: python%{python3_pkgversion}-devel
|
| |
- BuildRequires: python%{python3_pkgversion}-setuptools
|
| |
- Conflicts: python2-%{srcname} < %{version}-%{release}
|
| |
- %{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}}
|
| |
|
| |
%if 0%{?fedora}
|
| |
Suggests: %{name}-doc
|
| |
@@ -73,82 +53,56 @@
|
| |
|
| |
The lock includes a lock counter and is thread safe. This means, when locking
|
| |
the same lock object twice, it will not block.
|
| |
- %endif # with_python3
|
| |
-
|
| |
|
| |
%prep
|
| |
- %autosetup -p1 -n py-%{srcname}-%{version}
|
| |
+ %autosetup -n %{srcname}-%{version}
|
| |
+ # furo theme is not available in Fedora
|
| |
+ sed -i "/html_theme =.*/d" docs/conf.py
|
| |
|
| |
+ %generate_buildrequires
|
| |
+ %pyproject_buildrequires -r
|
| |
|
| |
%build
|
| |
- %if 0%{?with_python2}
|
| |
- %py2_build
|
| |
- %endif # with_python2
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- %py3_build
|
| |
- %endif # with_python3
|
| |
+ %pyproject_wheel
|
| |
|
| |
%if %{with docs}
|
| |
- %make_build -C docs html man SPHINXBUILD=sphinx-build-%{python3_version}
|
| |
- rm docs/build/html/.buildinfo
|
| |
+ pushd docs
|
| |
+ PYTHONPATH=../src sphinx-build ./ html --color -b html
|
| |
+ PYTHONPATH=../src sphinx-build ./ man --color -b man
|
| |
+ rm html/.buildinfo
|
| |
+ popd
|
| |
%endif
|
| |
|
| |
-
|
| |
%install
|
| |
- %if 0%{?with_python2}
|
| |
- %py2_install
|
| |
- %endif # with_python2
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- %py3_install
|
| |
- %endif # with_python3
|
| |
+ %pyproject_install
|
| |
+ %pyproject_save_files %{srcname}
|
| |
|
| |
%if %{with docs}
|
| |
- install -p -m0644 -D docs/build/man/py-%{srcname}.1 %{buildroot}%{_mandir}/man1/py-%{srcname}.1
|
| |
+ install -p -m0644 -D docs/man/%{srcname}.1 %{buildroot}%{_mandir}/man1/%{srcname}.1
|
| |
%endif
|
| |
|
| |
-
|
| |
%check
|
| |
- %if 0%{?with_python2}
|
| |
- %{__python2} test.py
|
| |
- %endif # with_python2
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- %{__python3} test.py
|
| |
- %endif # with_python3
|
| |
-
|
| |
+ %pytest
|
| |
|
| |
%if %{with docs}
|
| |
%files doc
|
| |
%license LICENSE
|
| |
- %doc docs/build/html
|
| |
+ %doc docs/html
|
| |
%endif
|
| |
|
| |
- %if 0%{?with_python2}
|
| |
- %files -n python2-%{srcname}
|
| |
+ %files -n python%{python3_pkgversion}-%{srcname} -f %{pyproject_files}
|
| |
%license LICENSE
|
| |
%doc README.md
|
| |
- %{python2_sitelib}/%{srcname}.py
|
| |
- %{python2_sitelib}/%{srcname}.py[co]
|
| |
- %{python2_sitelib}/%{srcname}-%{version}-py%{python2_version}.egg-info
|
| |
- %{_mandir}/man1/py-%{srcname}.1.gz
|
| |
- %endif # with_python2
|
| |
-
|
| |
- %if 0%{?with_python3}
|
| |
- %files -n python%{python3_pkgversion}-%{srcname}
|
| |
- %license LICENSE
|
| |
- %doc README.md
|
| |
- %{python3_sitelib}/%{srcname}.py
|
| |
- %{python3_sitelib}/%{srcname}-%{version}-py%{python3_version}.egg-info
|
| |
- %{python3_sitelib}/__pycache__/%{srcname}*.py[co]
|
| |
%if %{with docs}
|
| |
- %{_mandir}/man1/py-%{srcname}.1.gz
|
| |
+ %{_mandir}/man1/%{srcname}.1.gz
|
| |
%endif
|
| |
- %endif # with_python3
|
| |
|
| |
|
| |
%changelog
|
| |
+ * Mon Oct 25 2021 Lumír Balhar <lbalhar@redhat.com> - 3.3.1-1
|
| |
+ - Update to 3.3.1, drop Python 2 support
|
| |
+ Resolves: rhbz#2008102
|
| |
+
|
| |
* Tue Jul 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 3.0.12-12
|
| |
- Second attempt - Rebuilt for
|
| |
https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
| |
Update needed for the latest virtualenv package. I did a check of generated HTML docs and it looks good.
Built together with virtualenv and dependant packages of them both in https://copr.fedorainfracloud.org/coprs/lbalhar/python-virtualenv/builds/