diff --git a/.gitignore b/.gitignore index 700b112..eb377fa 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ /python-filelock-b71c3a4.tar.gz /py-filelock-3.0.10.tar.gz /py-filelock-3.0.12.tar.gz +/py-filelock-3.3.1.tar.gz +/filelock-3.3.1.tar.gz diff --git a/python-filelock.spec b/python-filelock.spec index 784bd36..4d80115 100644 --- a/python-filelock.spec +++ b/python-filelock.spec @@ -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 @@ 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. -%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 @@ 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_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 - 3.3.1-1 +- Update to 3.3.1, drop Python 2 support +Resolves: rhbz#2008102 + * Tue Jul 27 2021 Fedora Release Engineering - 3.0.12-12 - Second attempt - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild diff --git a/sources b/sources index ab81ec4..5e2daa1 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (py-filelock-3.0.12.tar.gz) = 0f30b54b9de2540f023855effcc582b18fedcee6681f21e1733f1b60dbd39eb148e3830bc798a44c5e8c22e7ea8ca26b6d4547fae79dacc78c62b819a3d84683 +SHA512 (filelock-3.3.1.tar.gz) = d62903a7a2c344e6a89863254392a389b893ec0c97fc4d5b0073c7a6597df6a85e00ce30022bb55886e9d30ba163457bc3a641f083ccb2bdd62431f3cf5c2cf1