python-discovery 1.5.3__py3-none-any.whl → 1.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- python_discovery/_discovery.py +6 -1
- python_discovery/_py_info.py +11 -0
- {python_discovery-1.5.3.dist-info → python_discovery-1.6.1.dist-info}/METADATA +1 -1
- {python_discovery-1.5.3.dist-info → python_discovery-1.6.1.dist-info}/RECORD +6 -6
- {python_discovery-1.5.3.dist-info → python_discovery-1.6.1.dist-info}/WHEEL +1 -1
- {python_discovery-1.5.3.dist-info → python_discovery-1.6.1.dist-info}/licenses/LICENSE +0 -0
python_discovery/_discovery.py
CHANGED
|
@@ -423,7 +423,12 @@ def get_paths(env: Mapping[str, str]) -> Generator[Path, None, None]:
|
|
|
423
423
|
except (AttributeError, ValueError): # pragma: no cover # Windows only (no confstr)
|
|
424
424
|
path = os.defpath
|
|
425
425
|
if path:
|
|
426
|
-
|
|
426
|
+
# An empty component (a leading/trailing/doubled separator) means "the current directory", the
|
|
427
|
+
# same footgun a shell has when PATH is misconfigured - Path("") resolves to it. Since every
|
|
428
|
+
# yielded path here is later searched for interpreters to execute and interrogate, silently
|
|
429
|
+
# including the caller's CWD would let whatever directory virtualenv happens to run from smuggle
|
|
430
|
+
# in a candidate binary.
|
|
431
|
+
for entry in map(Path, filter(None, path.split(os.pathsep))):
|
|
427
432
|
with suppress(OSError):
|
|
428
433
|
if entry.is_dir() and next(entry.iterdir(), None):
|
|
429
434
|
yield entry
|
python_discovery/_py_info.py
CHANGED
|
@@ -167,6 +167,17 @@ class PythonInfo: # ruff:ignore[too-many-public-methods]
|
|
|
167
167
|
"""The exec prefix of the system Python this interpreter is based on."""
|
|
168
168
|
return self.real_prefix or self.base_exec_prefix or self.exec_prefix
|
|
169
169
|
|
|
170
|
+
@property
|
|
171
|
+
def system_exe(self) -> str:
|
|
172
|
+
"""
|
|
173
|
+
The executable of the system Python this interpreter is based on.
|
|
174
|
+
|
|
175
|
+
:attr:`system_executable` stays ``None`` until :meth:`resolve_to_system` walks the prefix chain, so reading it
|
|
176
|
+
forces every caller to narrow a value discovery has already settled. The fallback here matches what resolution
|
|
177
|
+
itself writes when a prefix links back to its own interpreter.
|
|
178
|
+
"""
|
|
179
|
+
return self.system_executable or self.executable
|
|
180
|
+
|
|
170
181
|
def __repr__(self) -> str:
|
|
171
182
|
return "{}({!r})".format(
|
|
172
183
|
self.__class__.__name__,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: python-discovery
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.6.1
|
|
4
4
|
Summary: Python interpreter discovery
|
|
5
5
|
Project-URL: Changelog, https://github.com/tox-dev/python-discovery/releases
|
|
6
6
|
Project-URL: Documentation, https://python-discovery.readthedocs.io
|
|
@@ -2,8 +2,8 @@ python_discovery/__init__.py,sha256=Hi4j3pMvC8Fo8KoNL-wOHsPSCUHwY4c0qvv5sjnFzME,
|
|
|
2
2
|
python_discovery/_cache.py,sha256=svmG2GzUQzd2xTjAbm2eX1CKxxGAglfv4kxaPuxwPIA,5147
|
|
3
3
|
python_discovery/_cached_py_info.py,sha256=MKV2sjrrypq-7gcOdw9GpAooMJl9kYCTAlYeUwO3ndQ,10473
|
|
4
4
|
python_discovery/_compat.py,sha256=iqxGuhK9rPaiui80G1H1KrweoMJ16gyLYEmUrSXrp5c,709
|
|
5
|
-
python_discovery/_discovery.py,sha256=
|
|
6
|
-
python_discovery/_py_info.py,sha256=
|
|
5
|
+
python_discovery/_discovery.py,sha256=BDHC1XEx0XNStEIbXjujpHHm0nkBpe26bl26YVHSWhM,22488
|
|
6
|
+
python_discovery/_py_info.py,sha256=dov0UFDbcbKlNW765puRgLQuAvbc_ze0Mpsdb7Tixgs,25797
|
|
7
7
|
python_discovery/_py_info_collect.py,sha256=YhF5U-kKcwMXZMfRNDlZK6kCPJJI9tHIvd5SjQqMJqY,16126
|
|
8
8
|
python_discovery/_py_spec.py,sha256=O1RMC9JQ7m5SRzF6cEELxnIWZpadXYWO4bWDD7TemUs,10965
|
|
9
9
|
python_discovery/_specifier.py,sha256=o7MHb0z_mFSLz9gXqMwJoNkHYjgi2biq3Ibvd0_slvc,10457
|
|
@@ -11,7 +11,7 @@ python_discovery/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
11
11
|
python_discovery/_windows/__init__.py,sha256=qthcyGh36b3WkeSbZ4ECRRYLbCOCaQu5X_DRZ98tXfk,315
|
|
12
12
|
python_discovery/_windows/_pep514.py,sha256=1TqLTdofSCPu3VFE7D4u2fXweyaqhKJR7b48VmJ9AQQ,7787
|
|
13
13
|
python_discovery/_windows/_propose.py,sha256=iMJf6l0TU4SvuV8UsCHHINAe9L5dUT949xyeyMVdong,1565
|
|
14
|
-
python_discovery-1.
|
|
15
|
-
python_discovery-1.
|
|
16
|
-
python_discovery-1.
|
|
17
|
-
python_discovery-1.
|
|
14
|
+
python_discovery-1.6.1.dist-info/METADATA,sha256=_U6UJYiWySf9blNUmIx7MHoPFraiWr1dC2Rvz1zJ_qg,5132
|
|
15
|
+
python_discovery-1.6.1.dist-info/WHEEL,sha256=THafob7ofN-NsuMN7Mg4qZyHaQI7KkD-QlcQatYhXPo,87
|
|
16
|
+
python_discovery-1.6.1.dist-info/licenses/LICENSE,sha256=kOJeH68qSq6o2V7o5_VziwUqGswMnFgGgQH5Mahr1Yg,1023
|
|
17
|
+
python_discovery-1.6.1.dist-info/RECORD,,
|
|
File without changes
|