python-discovery 1.9.0__py3-none-any.whl → 1.9.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 +3 -2
- python_discovery/_py_info.py +3 -2
- python_discovery/_py_spec.py +6 -3
- {python_discovery-1.9.0.dist-info → python_discovery-1.9.1.dist-info}/METADATA +1 -1
- {python_discovery-1.9.0.dist-info → python_discovery-1.9.1.dist-info}/RECORD +7 -7
- {python_discovery-1.9.0.dist-info → python_discovery-1.9.1.dist-info}/WHEEL +0 -0
- {python_discovery-1.9.0.dist-info → python_discovery-1.9.1.dist-info}/licenses/LICENSE +0 -0
python_discovery/_discovery.py
CHANGED
|
@@ -5,6 +5,7 @@ import os
|
|
|
5
5
|
import sys
|
|
6
6
|
from contextlib import suppress
|
|
7
7
|
from dataclasses import dataclass
|
|
8
|
+
from itertools import tee
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
from typing import TYPE_CHECKING, Final
|
|
10
11
|
|
|
@@ -47,8 +48,8 @@ def get_interpreter(
|
|
|
47
48
|
:return: the first matching interpreter, or ``None`` if no match is found.
|
|
48
49
|
"""
|
|
49
50
|
specs = [key] if isinstance(key, str) else key
|
|
50
|
-
for spec_str in specs:
|
|
51
|
-
if result := _find_interpreter(spec_str,
|
|
51
|
+
for spec_str, preferred_paths in zip(specs, tee(try_first_with or (), len(specs))):
|
|
52
|
+
if result := _find_interpreter(spec_str, preferred_paths, cache, env, predicate):
|
|
52
53
|
return result
|
|
53
54
|
return None
|
|
54
55
|
|
python_discovery/_py_info.py
CHANGED
|
@@ -153,8 +153,9 @@ class PythonInfo: # ruff:ignore[too-many-public-methods]
|
|
|
153
153
|
for k, v in self.sysconfig_vars.items()
|
|
154
154
|
},
|
|
155
155
|
)
|
|
156
|
-
|
|
157
|
-
|
|
156
|
+
# An empty headers path would make the fallback resolve to the existing prefix.
|
|
157
|
+
if not os.path.exists(path) and (headers := os.path.dirname(self.install_path("headers"))):
|
|
158
|
+
fallback = os.path.join(self.prefix, headers)
|
|
158
159
|
if os.path.exists(fallback):
|
|
159
160
|
path = fallback
|
|
160
161
|
return path
|
python_discovery/_py_spec.py
CHANGED
|
@@ -197,7 +197,9 @@ class PythonSpec:
|
|
|
197
197
|
|
|
198
198
|
:param windows: if ``True``, require a ``.exe`` suffix.
|
|
199
199
|
:param all_implementations: when ``True`` and the spec does not constrain the implementation, match every
|
|
200
|
-
filename in :data:`KNOWN_IMPLEMENTATIONS` instead of only ``python``.
|
|
200
|
+
filename in :data:`KNOWN_IMPLEMENTATIONS` instead of only ``python``. A free-threaded or debug build the
|
|
201
|
+
spec leaves open also matches its marked name, such as ``python3.13t`` or ``python3.13-dbg``. Used by
|
|
202
|
+
enumeration APIs.
|
|
201
203
|
"""
|
|
202
204
|
version = r"{}(\.{}(\.{})?)?".format(
|
|
203
205
|
*(r"\d+" if v is None else v for v in (self.major, self.minor, self.micro)),
|
|
@@ -208,8 +210,9 @@ class PythonSpec:
|
|
|
208
210
|
impl = "|".join(re.escape(i) for i in KNOWN_IMPLEMENTATIONS)
|
|
209
211
|
else:
|
|
210
212
|
impl = "python"
|
|
211
|
-
|
|
212
|
-
|
|
213
|
+
# An unconstrained single lookup must not depend on directory order to choose a variant.
|
|
214
|
+
mod = "t?" if self.free_threaded or (all_implementations and self.free_threaded is None) else ""
|
|
215
|
+
dbg = "(?:d|-dbg|-debug)?" if self.debug or (all_implementations and self.debug is None) else ""
|
|
213
216
|
suffix = r"\.exe" if windows else ""
|
|
214
217
|
version_conditional = "?" if windows or self.major is None else ""
|
|
215
218
|
return re.compile(
|
|
@@ -2,16 +2,16 @@ python_discovery/__init__.py,sha256=BV4pKMWDAK_3pU8o2hYvtL30WKs_wTzIBRuFV7nUaug,
|
|
|
2
2
|
python_discovery/_cache.py,sha256=svmG2GzUQzd2xTjAbm2eX1CKxxGAglfv4kxaPuxwPIA,5147
|
|
3
3
|
python_discovery/_cached_py_info.py,sha256=15P5_TODxkZCkNfD2Uk5dtPxGf0Nea_aWm2N7uY9zbY,12059
|
|
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=4a-fRJsy6a1x__0LiiavTmQula5kN2-MnBj3fR-FKJk,23294
|
|
6
|
+
python_discovery/_py_info.py,sha256=uP3fWpLy_N4HSIzTFQxEyxSkUBusZy-qX3Pp3VJGVg4,27442
|
|
7
7
|
python_discovery/_py_info_collect.py,sha256=k9P4JzNkvW9iw37teeu7L6Y27ytWTnvWiK47B3gm5xg,17390
|
|
8
|
-
python_discovery/_py_spec.py,sha256=
|
|
8
|
+
python_discovery/_py_spec.py,sha256=s76yM2zbrKdvwhaDlPyUo6ERKkn2MldRNydPZucNvOM,12154
|
|
9
9
|
python_discovery/_specifier.py,sha256=9sMnJs7FTfIIduTCKKTA7Lk7onARqwkG_zzFIqgj0xs,10364
|
|
10
10
|
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=Vhxe-3hETFIXQrekLqOHmzG5eq5moeR8b0dCS80zbBg,8026
|
|
13
13
|
python_discovery/_windows/_propose.py,sha256=EE-N-BiNgrFU9mQ34SkoF5gRaNjtspghssQxT9uRQi0,1756
|
|
14
|
-
python_discovery-1.9.
|
|
15
|
-
python_discovery-1.9.
|
|
16
|
-
python_discovery-1.9.
|
|
17
|
-
python_discovery-1.9.
|
|
14
|
+
python_discovery-1.9.1.dist-info/METADATA,sha256=6xq9g-xC6bvsDbWc0CrFmdrq4uv519kMstNNZ_bdAO4,3937
|
|
15
|
+
python_discovery-1.9.1.dist-info/WHEEL,sha256=W3fkpkm7-wf9vBI5Z-7s0eWkeM-spu78I8Neb98DeEg,87
|
|
16
|
+
python_discovery-1.9.1.dist-info/licenses/LICENSE,sha256=kOJeH68qSq6o2V7o5_VziwUqGswMnFgGgQH5Mahr1Yg,1023
|
|
17
|
+
python_discovery-1.9.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|