#2 update to python-path-11.5.0
Closed 3 years ago by churchyard. Opened 4 years ago by ktdreyer.
rpms/ ktdreyer/python-path python-path-11.5.0  into  master

file modified
+1 -3
@@ -1,4 +1,2 @@ 

- /path.py-3.0.1.zip

- /path.py-4.3.zip

- /path.py-5.1.zip

  /path.py-5.2.zip

+ /path.py-11.5.0.tar.gz

file modified
+40 -25
@@ -2,58 +2,68 @@ 

  %global with_python3 1

  %endif

  

- %global bname path

+ %global pypi_name path.py

  

- Name:           python-%{bname}

- Version:        5.2

- Release:        16%{?dist}

+ Name:           python-path

+ Version:        11.5.0

+ Release:        1%{?dist}

  Summary:        A python module wrapper for os.path

  

  License:        MIT

  URL:            https://pypi.python.org/pypi/path.py

- Source0:        https://pypi.python.org/packages/source/p/path.py/%{bname}.py-%{version}.zip

+ Source0:        %pypi_source

  

  BuildArch:      noarch

  BuildRequires:  python2-devel

  BuildRequires:  pytest

+ BuildRequires:  python2-packaging

+ BuildRequires:  python2-setuptools_scm

  

  %if 0%{?with_python3}

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools

+ BuildRequires:  python3-setuptools_scm

+ BuildRequires:  python3-packaging

  BuildRequires:  python3-pytest

  %endif

  

- %description

- path.py implements a path objects as first-class entities,

- allowing common operations on files to be invoked on those path objects directly.

+ # We do not have https://pypi.org/project/importlib-metadata/ to populate

+ # __version__, so we do it statically below. Filter out the auto-requires for

+ # importlib-metadata here.

+ %global __requires_exclude importlib-metadata

  

- See documentation here http://amoffat.github.io/sh/.

+ %description

+ path.py implements path objects as first-class entities, allowing common

+ operations on files to be invoked on those path objects directly.

  

- %package    -n python2-%{bname}

+ %package    -n python2-path

  Summary:    Python 2 module wrapper for os.path

- %{?python_provide:%python_provide python2-%{bname}}

- %description -n python2-%{bname}

- path.py implements a path objects as first-class entities,

- allowing common operations on files to be invoked on those path objects directly.

- 

- See documentation here http://amoffat.github.io/sh/.

+ %{?python_provide:%python_provide python2-path}

+ %description -n python2-path

+ path.py implements path objects as first-class entities, allowing common

+ operations on files to be invoked on those path objects directly.

  

  %if 0%{?with_python3}

- %package    -n python3-%{bname}

+ %package    -n python3-path

  Summary:    Python 3 module wrapper for os.path

  

- %description -n python3-%{bname}

- path.py implements a path objects as first-class entities,

- allowing common operations on files to be invoked on those path objects directly.

- 

- See documentation here http://amoffat.github.io/sh/.

+ %description -n python3-path

+ path.py implements path objects as first-class entities, allowing common

+ operations on files to be invoked on those path objects directly.

  %endif

  

  

  %prep

- %setup -q -n %{bname}.py-%{version}

+ %autosetup -n %{pypi_name}-%{version}

+ 

+ sed -i 's/ --flake8//' pytest.ini

+ 

+ # We do not have https://pypi.org/project/importlib-metadata/ to populate

+ # __version__, so we do it statically here:

+ sed -i "s/__version__ = 'unknown'/__version__ = '%{version}'/" path.py

  

  %build

+ SETUPTOOLS_SCM_PRETEND_VERSION=%{version}

  %if 0%{?with_python3}

  %py3_build

  %endif
@@ -61,9 +71,10 @@ 

  %py2_build

  

  %check

+ 

  pushd build/lib

-     LC_ALL=C.UTF-8 py.test-2 -v

- #%{__python} test_path.py

+     # There is a Unicode test failure on Python 2.

+     LC_ALL=C.UTF-8 py.test-2 -v -k "not test_listdir_other_encoding"

  popd

  

  %if 0%{?with_python3}
@@ -97,6 +108,10 @@ 

  %endif

  

  %changelog

+ * Tue Feb 26 2019 Ken Dreyer <kdreyer@redhat.com> - 11.5.0-1

+ - Update to latest upstream release (rhbz#1206250)

+ - Use %%autosetup, %%pypi_name, %%pypi_source

+ 

  * Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 5.2-16

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

  

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

- 96fe002b1797b221c269ff2ed1fdbc28  path.py-5.2.zip

+ SHA512 (path.py-11.5.0.tar.gz) = a2b5a268c5d4850cae1b045543ce9b88fb65c7048d9b3c79eaf097bc9d8295d8e2ea58ee1289678c3dd9626044984e7822698e043fec5a161976dccb6e0d1a7b

Changelog:
- Update to latest upstream release (rhbz#1206250)
- Use %%autosetup
- Make tests non-fatal

Resolves: rhbz#1206250

rebased onto 3c1c9b4

4 years ago

Please use %pypi_source instead.

Can we sed/patch the __version__ and deselect the failing python2 test instead of ignoring results of 68 tests?

%prep
sed -i "s/__version__ = 'unknown'/__version__ = '%{version}'/" path.py


%check
LC_ALL=C.UTF-8 py.test-2 -v -k "not test_listdir_other_encoding"

These are great suggestions, thanks @churchyard . I've amended this PR to do the changes as you describe.

rebased onto b098760

4 years ago

this deserves a comment

TIL about this variable! Thanks.

Looks good apart form 2 nitpicks.

$ dnf repoquery --repo=rawhide --repo=rawhide-source  --whatrequires python2-path | pkgname
gitifyhg
python-pytest-shutil
python-pytest-virtualenv
python2-Pyped
python2-pytest-shutil
python2-pytest-virtualenv

$ dnf repoquery --repo=rawhide --repo=rawhide-source  --whatrequires python3-path | pkgname
python-pytest-shutil
python-pytest-virtualenv
python3-Pyped
python3-pytest-shutil
python3-pytest-virtualenv
sagemath

IS everybody on board? How breaking is this upgrade?

Thanks for the suggestions. I've amended this with your suggested changes.

There several API changes here. Upstream keeps a changelog that explains the differences.

One of the biggest I found is that path.path is gone, and it's replaced by path.Path instead. Note upstream dropped the path.path API in the 8.0 release, two and a half years ago.

This is actually what prompted me to write this pull request, because the latest CherryPy stack uses the newer API.

I'm CC'ing the maintainers of the above packages here:

rebased onto b7ce2b8

4 years ago

gitifyhg-0.8.4 uses the old API:

from path import path as p

So it needs this patch from upstream: https://github.com/dusty-phillips/gitifyhg/commit/fc038e0fe874c44651d33a78f5a21a0cd683e63a (and bug upstream to tag and push a new release to PyPI)

Good news, python-pytest-shutil and python-pytest-virtualenv both handle either API seamlessly:

try:
    from path import Path
except ImportError:
    from path import path as Path

python-Pyped is a tool for interactive use. It simply imports a bunch of things into the environment. Upstream has not seen updates for years, but it's ok, because 1.4 is fine with the older path.path API going away:

try:
     from path import path
 except ImportError:
     pass

For sagemath, I think that might be a bogus dependency? I cannot find it anywhere in the source of Rawhide's 8.6.

To summarize, the only dependent package we must update as a result of this change is gitifyhg, and my PR https://src.fedoraproject.org/rpms/gitifyhg/pull-request/2 does that.

@laxathom / @churchyard are you ok merging this now?

Note that I got:

builtins.Failed: [pytest] section in setup.cfg files is no longer supported, change to [tool:pytest] instead.

With the previous version and pytest 4.3.1.
Testing this version with pytest 4.3.1 might be a good idea as well.

Note that a simple

sed -i 's/\[pytest\]/\[tool:pytest\]/' setup.cfg

Fixed the previous version.

Pull-Request has been closed by churchyard

3 years ago