Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-findpython for
openSUSE:Factory checked in at 2022-11-08 12:52:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-findpython (Old)
and /work/SRC/openSUSE:Factory/.python-findpython.new.1597 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-findpython"
Tue Nov 8 12:52:33 2022 rev:3 rq:1034474 version:0.2.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-findpython/python-findpython.changes
2022-08-16 17:07:51.787899527 +0200
+++
/work/SRC/openSUSE:Factory/.python-findpython.new.1597/python-findpython.changes
2022-11-08 12:52:37.254876046 +0100
@@ -1,0 +2,7 @@
+Tue Nov 8 00:26:09 UTC 2022 - Yogalakshmi Arunachalam <[email protected]>
+
+- Update to 0.2.2
+ * Prevent find_all exception when a clean pyenv is present - by @ferminho
in #11
+ * Don't parse as LegacyVersion - by @frostming (e3466)
+
+-------------------------------------------------------------------
Old:
----
findpython-0.2.1.tar.gz
New:
----
findpython-0.2.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-findpython.spec ++++++
--- /var/tmp/diff_new_pack.iSFb3d/_old 2022-11-08 12:52:37.774878526 +0100
+++ /var/tmp/diff_new_pack.iSFb3d/_new 2022-11-08 12:52:37.774878526 +0100
@@ -17,7 +17,7 @@
Name: python-findpython
-Version: 0.2.1
+Version: 0.2.2
Release: 0
Summary: Utility to find python versions on your system
License: MIT
++++++ findpython-0.2.1.tar.gz -> findpython-0.2.2.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/findpython-0.2.1/PKG-INFO
new/findpython-0.2.2/PKG-INFO
--- old/findpython-0.2.1/PKG-INFO 2022-08-09 11:02:26.257062000 +0200
+++ new/findpython-0.2.2/PKG-INFO 2022-10-30 03:02:20.815515300 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: findpython
-Version: 0.2.1
+Version: 0.2.2
Summary: A utility to find python versions on your system
License: MIT
Author-email: Frost Ming <[email protected]>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/findpython-0.2.1/pyproject.toml
new/findpython-0.2.2/pyproject.toml
--- old/findpython-0.2.1/pyproject.toml 2022-08-09 11:02:05.573006200 +0200
+++ new/findpython-0.2.2/pyproject.toml 2022-10-30 03:02:02.478616500 +0100
@@ -17,7 +17,7 @@
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
-version = "0.2.1"
+version = "0.2.2"
[project.license]
text = "MIT"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/findpython-0.2.1/src/findpython/providers/pyenv.py
new/findpython-0.2.2/src/findpython/providers/pyenv.py
--- old/findpython-0.2.1/src/findpython/providers/pyenv.py 2022-08-09
11:02:05.573006200 +0200
+++ new/findpython-0.2.2/src/findpython/providers/pyenv.py 2022-10-30
03:02:02.482617900 +0100
@@ -24,9 +24,11 @@
return cls(Path(pyenv_root))
def find_pythons(self) -> Iterable[PythonVersion]:
- for version in self.root.joinpath("versions").iterdir():
- if version.is_dir():
- bindir = version / "bin"
- if not bindir.exists():
- bindir = version
- yield from self.find_pythons_from_path(bindir, True)
+ versions_path = self.root.joinpath("versions")
+ if versions_path.exists():
+ for version in versions_path.iterdir():
+ if version.is_dir():
+ bindir = version / "bin"
+ if not bindir.exists():
+ bindir = version
+ yield from self.find_pythons_from_path(bindir, True)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/findpython-0.2.1/src/findpython/python.py
new/findpython-0.2.2/src/findpython/python.py
--- old/findpython-0.2.1/src/findpython/python.py 2022-08-09
11:02:05.573006200 +0200
+++ new/findpython-0.2.2/src/findpython/python.py 2022-10-30
03:02:02.482617900 +0100
@@ -6,8 +6,7 @@
from functools import lru_cache
from pathlib import Path
-from packaging.version import Version
-from packaging.version import parse as parse_version
+from packaging.version import Version, InvalidVersion
from findpython.utils import get_binary_hash
@@ -29,9 +28,12 @@
"""Return True if the python is not broken."""
try:
v = self._get_version()
- except (OSError, subprocess.CalledProcessError,
subprocess.TimeoutExpired):
- return False
- if not isinstance(v, Version):
+ except (
+ OSError,
+ subprocess.CalledProcessError,
+ subprocess.TimeoutExpired,
+ InvalidVersion,
+ ):
return False
if self._version is None:
self._version = v
@@ -160,7 +162,7 @@
"""Get the version of the python."""
script = "import platform; print(platform.python_version())"
version = self._run_script(script, timeout=GET_VERSION_TIMEOUT).strip()
- return parse_version(version)
+ return Version(version)
def _get_architecture(self) -> str:
script = "import platform; print(platform.architecture()[0])"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/findpython-0.2.1/tests/test_finder.py
new/findpython-0.2.2/tests/test_finder.py
--- old/findpython-0.2.1/tests/test_finder.py 2022-08-09 11:02:05.573006200
+0200
+++ new/findpython-0.2.2/tests/test_finder.py 2022-10-30 03:02:02.482617900
+0100
@@ -125,3 +125,12 @@
pythons = Finder().find_all(3, 8)
assert len(pythons) == 2
assert python in pythons
+
+
+def test_find_python_skips_empty_pyenv(mocked_python, tmp_path, monkeypatch):
+ ALL_PROVIDERS.append(PyenvProvider)
+ pyenv_path = Path(tmp_path / ".pyenv")
+ pyenv_path.mkdir()
+ monkeypatch.setenv("PYENV_ROOT", str(pyenv_path))
+ all_pythons = Finder().find_all()
+ assert len(all_pythons) == 3