python-discovery 1.2.0__py3-none-any.whl → 1.2.2__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/__init__.py +3 -1
- python_discovery/_py_info.py +37 -1
- {python_discovery-1.2.0.dist-info → python_discovery-1.2.2.dist-info}/METADATA +1 -1
- {python_discovery-1.2.0.dist-info → python_discovery-1.2.2.dist-info}/RECORD +6 -6
- {python_discovery-1.2.0.dist-info → python_discovery-1.2.2.dist-info}/WHEEL +0 -0
- {python_discovery-1.2.0.dist-info → python_discovery-1.2.2.dist-info}/licenses/LICENSE +0 -0
python_discovery/__init__.py
CHANGED
|
@@ -6,13 +6,14 @@ from importlib.metadata import version
|
|
|
6
6
|
|
|
7
7
|
from ._cache import ContentStore, DiskCache, PyInfoCache
|
|
8
8
|
from ._discovery import get_interpreter
|
|
9
|
-
from ._py_info import PythonInfo
|
|
9
|
+
from ._py_info import KNOWN_ARCHITECTURES, PythonInfo, normalize_isa
|
|
10
10
|
from ._py_spec import PythonSpec
|
|
11
11
|
from ._specifier import SimpleSpecifier, SimpleSpecifierSet, SimpleVersion
|
|
12
12
|
|
|
13
13
|
__version__ = version("python-discovery")
|
|
14
14
|
|
|
15
15
|
__all__ = [
|
|
16
|
+
"KNOWN_ARCHITECTURES",
|
|
16
17
|
"ContentStore",
|
|
17
18
|
"DiskCache",
|
|
18
19
|
"PyInfoCache",
|
|
@@ -23,4 +24,5 @@ __all__ = [
|
|
|
23
24
|
"SimpleVersion",
|
|
24
25
|
"__version__",
|
|
25
26
|
"get_interpreter",
|
|
27
|
+
"normalize_isa",
|
|
26
28
|
]
|
python_discovery/_py_info.py
CHANGED
|
@@ -768,9 +768,45 @@ class PythonInfo: # noqa: PLR0904
|
|
|
768
768
|
yield upper
|
|
769
769
|
|
|
770
770
|
|
|
771
|
+
KNOWN_ARCHITECTURES: frozenset[str] = frozenset({
|
|
772
|
+
"arm64",
|
|
773
|
+
"loongarch64",
|
|
774
|
+
"ppc",
|
|
775
|
+
"ppc64",
|
|
776
|
+
"ppc64le",
|
|
777
|
+
"riscv64",
|
|
778
|
+
"s390x",
|
|
779
|
+
"sparc64",
|
|
780
|
+
"x86",
|
|
781
|
+
"x86_64",
|
|
782
|
+
})
|
|
783
|
+
"""Known CPU architecture (ISA) values after normalization.
|
|
784
|
+
|
|
785
|
+
.. deprecated::
|
|
786
|
+
Use :func:`normalize_isa` instead, which handles both known and unknown architectures.
|
|
787
|
+
"""
|
|
788
|
+
|
|
789
|
+
|
|
771
790
|
def normalize_isa(isa: str) -> str:
|
|
791
|
+
"""
|
|
792
|
+
Normalize an ISA (instruction set architecture) string to a canonical form.
|
|
793
|
+
|
|
794
|
+
Known aliases are mapped (e.g. ``amd64`` → ``x86_64``, ``aarch64`` → ``arm64``).
|
|
795
|
+
Unrecognized values are lowercased and returned as-is.
|
|
796
|
+
"""
|
|
772
797
|
low = isa.lower()
|
|
773
|
-
return {
|
|
798
|
+
return {
|
|
799
|
+
"amd64": "x86_64",
|
|
800
|
+
"aarch64": "arm64",
|
|
801
|
+
"i386": "x86",
|
|
802
|
+
"i486": "x86",
|
|
803
|
+
"i586": "x86",
|
|
804
|
+
"i686": "x86",
|
|
805
|
+
"powerpc": "ppc",
|
|
806
|
+
"powerpc64": "ppc64",
|
|
807
|
+
"powerpc64le": "ppc64le",
|
|
808
|
+
"sparcv9": "sparc64",
|
|
809
|
+
}.get(low, low)
|
|
774
810
|
|
|
775
811
|
|
|
776
812
|
def _main() -> None: # pragma: no cover
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-discovery
|
|
3
|
-
Version: 1.2.
|
|
3
|
+
Version: 1.2.2
|
|
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
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
python_discovery/__init__.py,sha256=
|
|
1
|
+
python_discovery/__init__.py,sha256=LF3QW-OgvDZizLQqilanDyvqHQxz7j0CjUpNUHxNW4E,712
|
|
2
2
|
python_discovery/_cache.py,sha256=bG4fD-h2pdPmb4v9BldbXmJ5Tlt1boiH1Qrz8kp9Dds,5063
|
|
3
3
|
python_discovery/_cached_py_info.py,sha256=1AFEoc_-OaCi1PXmaFz9Iy_bEuqOhJdFSDFHljzD-EE,8540
|
|
4
4
|
python_discovery/_compat.py,sha256=iqxGuhK9rPaiui80G1H1KrweoMJ16gyLYEmUrSXrp5c,709
|
|
5
5
|
python_discovery/_discovery.py,sha256=yccO7GNtNuxHtmDHsyqtaASmNHFgKIeEX6Me3jX-GFs,12822
|
|
6
|
-
python_discovery/_py_info.py,sha256=
|
|
6
|
+
python_discovery/_py_info.py,sha256=MLDQJbqamOdVev9_OH1b-DcQqTJR0h3RA3dHyB-bAgM,34446
|
|
7
7
|
python_discovery/_py_spec.py,sha256=rhm9uahWSQL3JLyyMmM2HQVhrTMVnHnZEAhArkjeNtM,9601
|
|
8
8
|
python_discovery/_specifier.py,sha256=PTh6suNTC0hMnFSxFYF_vggdciFLnwxoh1YflSbgCXA,10368
|
|
9
9
|
python_discovery/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
10
|
python_discovery/_windows/__init__.py,sha256=qthcyGh36b3WkeSbZ4ECRRYLbCOCaQu5X_DRZ98tXfk,315
|
|
11
11
|
python_discovery/_windows/_pep514.py,sha256=JYSQ5tOYbSMOKtVVfOEkyYskBhEoTsImNr3DJcv7XNE,7658
|
|
12
12
|
python_discovery/_windows/_propose.py,sha256=iMJf6l0TU4SvuV8UsCHHINAe9L5dUT949xyeyMVdong,1565
|
|
13
|
-
python_discovery-1.2.
|
|
14
|
-
python_discovery-1.2.
|
|
15
|
-
python_discovery-1.2.
|
|
16
|
-
python_discovery-1.2.
|
|
13
|
+
python_discovery-1.2.2.dist-info/METADATA,sha256=XkUqb3-xJFc1oAPW6TSnBau9gmT4w_JHnwl_6nGRZZU,5404
|
|
14
|
+
python_discovery-1.2.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
|
|
15
|
+
python_discovery-1.2.2.dist-info/licenses/LICENSE,sha256=kOJeH68qSq6o2V7o5_VziwUqGswMnFgGgQH5Mahr1Yg,1023
|
|
16
|
+
python_discovery-1.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|