#3 Update to 3.3.1, drop Python 2 support
Merged 2 years ago by cottsay. Opened 2 years ago by lbalhar.
rpms/ lbalhar/python-filelock rawhide  into  rawhide

file modified
+2
@@ -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

file modified
+40 -86
@@ -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

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (py-filelock-3.0.12.tar.gz) = 0f30b54b9de2540f023855effcc582b18fedcee6681f21e1733f1b60dbd39eb148e3830bc798a44c5e8c22e7ea8ca26b6d4547fae79dacc78c62b819a3d84683

+ SHA512 (filelock-3.3.1.tar.gz) = d62903a7a2c344e6a89863254392a389b893ec0c97fc4d5b0073c7a6597df6a85e00ce30022bb55886e9d30ba163457bc3a641f083ccb2bdd62431f3cf5c2cf1

  • updated specfile, new macros, docs without makefile, correct URLs, switched to sdist from PyPI because it depends on setuptools_scm otherwise etc.

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/

The build failure of copr-backend does not seem to be related to this change.

  • Consider removing %{?python_provide:...} when updating packages to pyproject macros.
  • The explicit Conflict also seems removable, considering the package does not exist for 7 Fedora releases.

The %generate_buildrequires section happens after the %prep section. It is confusing to read it in the specfile before %prep.

Since the tests are executed during the build, I strongly suggest including the runtime requirements with -r.

This source is not in the sources file.

I got:

  /usr/lib/python3.10/site-packages/_pytest/config/__init__.py:1233: PytestConfigWarning: Unknown config option: timeout

Consider BRing pytest-timeout or using the extra and sending coverage out, talking to upstream to split the coverage extra from the testing one.

rebased onto 3ba97dd

2 years ago

Fixed. Thanks for the review.

@cottsay Would you consider adding the python-sig group here as co-maintainers?

It's a little frustrating to see the so much of the spec file rewritten like this. It would be nice to change as little as is possible to achieve the goal of the PR for the sake of the maintainer and to expedite the review. Seems everyone always wants to push their approaches and style to packaging on everyone else.

Would you consider adding the python-sig group here as co-maintainers?

Sure.

Pull-Request has been merged by cottsay

2 years ago

It's a little frustrating to see the so much of the spec file rewritten like this.

Note that the majority of the rewrite is driven by upstream decisions here:

  • they dropped Python 2 support entirely, so the with_python2/with_python3 logic no longer works
  • they use pyproject.toml with setuptools_scm
  • they moved the github repo to a new organization
  • they changed the format of the tagged release
  • they moved from test.py to pytest