python-discovery 1.8.0__tar.gz → 1.9.0__tar.gz
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-1.8.0 → python_discovery-1.9.0}/PKG-INFO +1 -1
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/changelog.rst +14 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/how-to/standalone-usage.rst +3 -2
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/__init__.py +2 -1
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_py_info.py +17 -2
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/py_info/test_py_info.py +5 -1
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/FUNDING.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/SECURITY.md +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/THREAT_MODEL.md +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/dependabot.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/release.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/workflows/check.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/workflows/codeql.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/workflows/news.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/workflows/prepare-release.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/workflows/release.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.github/workflows/upgrade-release-tools.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.gitignore +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.pre-commit-config.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.readthedocs.yaml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/.readthedocs.yml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/CODE_OF_CONDUCT.md +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/LICENSE +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/README.md +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/_static/custom.css +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/_static/github.svg +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/_static/logo.svg +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/changelog/template.jinja2 +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/conf.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/contributing.rst +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/explanation.rst +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/index.rst +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/reference/api.rst +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/reference/environment-variables.rst +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/docs/tutorial/getting-started.rst +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/pylock.toml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/pyproject.toml +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_cache.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_cached_py_info.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_compat.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_discovery.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_py_info_collect.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_py_spec.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_specifier.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_windows/__init__.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_windows/_pep514.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/_windows/_propose.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/src/python_discovery/py.typed +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tasks/old_target_check.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tasks/old_target_check.sh +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/conftest.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/py_info/test_py_info_exe_based_of.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_cache.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_cache_recovery.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_cached_py_info.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_discovery.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_discovery_extra.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_iter_interpreters.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_py_info_collect.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_py_info_extra.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_py_spec.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_py_spec_extra.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_query_timeout.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/test_specifier.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/windows/conftest.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/windows/test_windows.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/windows/test_windows_pep514.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tests/windows/winreg_mock_values.py +0 -0
- {python_discovery-1.8.0 → python_discovery-1.9.0}/tox.toml +0 -0
|
@@ -6,6 +6,20 @@
|
|
|
6
6
|
|
|
7
7
|
.. towncrier release notes start
|
|
8
8
|
|
|
9
|
+
.. _release-1-9-0:
|
|
10
|
+
|
|
11
|
+
*********************
|
|
12
|
+
v1.9.0 (2026-10-30)
|
|
13
|
+
*********************
|
|
14
|
+
|
|
15
|
+
.. _release-1-9-0-added:
|
|
16
|
+
|
|
17
|
+
Added
|
|
18
|
+
-----
|
|
19
|
+
|
|
20
|
+
- Expose the 11 marker keys through ``MarkerEnvironment`` for callers that type-check ``PythonInfo.marker_environment``
|
|
21
|
+
(:pr:`179`) by :user:`gaborbernat`.
|
|
22
|
+
|
|
9
23
|
.. _release-1-8-0:
|
|
10
24
|
|
|
11
25
|
*********************
|
|
@@ -153,7 +153,7 @@ Once you have a :class:`~python_discovery.PythonInfo`, you can inspect everythin
|
|
|
153
153
|
+platform: str
|
|
154
154
|
+sysconfig_vars: dict
|
|
155
155
|
+sysconfig_paths: dict
|
|
156
|
-
+marker_environment:
|
|
156
|
+
+marker_environment: MarkerEnvironment
|
|
157
157
|
+machine: str
|
|
158
158
|
+free_threaded: bool
|
|
159
159
|
+debug_build: bool
|
|
@@ -182,7 +182,8 @@ Once you have a :class:`~python_discovery.PythonInfo`, you can inspect everythin
|
|
|
182
182
|
info.marker_environment
|
|
183
183
|
|
|
184
184
|
Use ``marker_environment`` to evaluate :pep:`508` dependency markers for the discovered interpreter. The mapping
|
|
185
|
-
contains all standard marker keys, including its implementation version and operating system.
|
|
185
|
+
contains all standard marker keys, including its implementation version and operating system. The exported
|
|
186
|
+
``MarkerEnvironment`` type names those keys for type checkers.
|
|
186
187
|
|
|
187
188
|
Prefer :attr:`~python_discovery.PythonInfo.system_exe` over the raw
|
|
188
189
|
:attr:`~python_discovery.PythonInfo.system_executable` field it reads. The field is typed ``str | None`` because it
|
|
@@ -6,7 +6,7 @@ from importlib.metadata import version
|
|
|
6
6
|
|
|
7
7
|
from ._cache import ContentStore, DiskCache, PyInfoCache
|
|
8
8
|
from ._discovery import get_interpreter, iter_interpreters
|
|
9
|
-
from ._py_info import KNOWN_ARCHITECTURES, PythonInfo, normalize_isa
|
|
9
|
+
from ._py_info import KNOWN_ARCHITECTURES, MarkerEnvironment, PythonInfo, normalize_isa
|
|
10
10
|
from ._py_spec import KNOWN_IMPLEMENTATIONS, PythonSpec
|
|
11
11
|
from ._specifier import SimpleSpecifier, SimpleSpecifierSet, SimpleVersion
|
|
12
12
|
|
|
@@ -17,6 +17,7 @@ __all__ = [
|
|
|
17
17
|
"KNOWN_IMPLEMENTATIONS",
|
|
18
18
|
"ContentStore",
|
|
19
19
|
"DiskCache",
|
|
20
|
+
"MarkerEnvironment",
|
|
20
21
|
"PyInfoCache",
|
|
21
22
|
"PythonInfo",
|
|
22
23
|
"PythonSpec",
|
|
@@ -11,7 +11,7 @@ import sys
|
|
|
11
11
|
from collections import OrderedDict
|
|
12
12
|
from itertools import product
|
|
13
13
|
from string import digits
|
|
14
|
-
from typing import TYPE_CHECKING, ClassVar, Final, NamedTuple
|
|
14
|
+
from typing import TYPE_CHECKING, ClassVar, Final, NamedTuple, TypedDict
|
|
15
15
|
|
|
16
16
|
from ._py_info_collect import PythonInfoCollector
|
|
17
17
|
|
|
@@ -57,7 +57,7 @@ class PythonInfo: # ruff:ignore[too-many-public-methods]
|
|
|
57
57
|
os: str
|
|
58
58
|
free_threaded: bool
|
|
59
59
|
debug_build: bool
|
|
60
|
-
marker_environment:
|
|
60
|
+
marker_environment: MarkerEnvironment
|
|
61
61
|
prefix: str | None
|
|
62
62
|
base_prefix: str | None
|
|
63
63
|
real_prefix: str | None
|
|
@@ -629,6 +629,20 @@ class PythonInfo: # ruff:ignore[too-many-public-methods]
|
|
|
629
629
|
yield upper
|
|
630
630
|
|
|
631
631
|
|
|
632
|
+
class MarkerEnvironment(TypedDict):
|
|
633
|
+
implementation_name: str
|
|
634
|
+
implementation_version: str
|
|
635
|
+
os_name: str
|
|
636
|
+
platform_machine: str
|
|
637
|
+
platform_release: str
|
|
638
|
+
platform_system: str
|
|
639
|
+
platform_version: str
|
|
640
|
+
python_full_version: str
|
|
641
|
+
platform_python_implementation: str
|
|
642
|
+
python_version: str
|
|
643
|
+
sys_platform: str
|
|
644
|
+
|
|
645
|
+
|
|
632
646
|
KNOWN_ARCHITECTURES: frozenset[str] = frozenset({
|
|
633
647
|
"arm64",
|
|
634
648
|
"loongarch64",
|
|
@@ -672,6 +686,7 @@ def normalize_isa(isa: str) -> str:
|
|
|
672
686
|
|
|
673
687
|
__all__ = [
|
|
674
688
|
"KNOWN_ARCHITECTURES",
|
|
689
|
+
"MarkerEnvironment",
|
|
675
690
|
"PythonInfo",
|
|
676
691
|
"VersionInfo",
|
|
677
692
|
"normalize_isa",
|
|
@@ -15,7 +15,7 @@ import pytest
|
|
|
15
15
|
from packaging.markers import default_environment
|
|
16
16
|
from setuptools.dist import Distribution
|
|
17
17
|
|
|
18
|
-
from python_discovery import DiskCache, PythonInfo, PythonSpec
|
|
18
|
+
from python_discovery import DiskCache, MarkerEnvironment, PythonInfo, PythonSpec
|
|
19
19
|
from python_discovery import _cached_py_info as cached_py_info
|
|
20
20
|
from python_discovery._py_info import VersionInfo
|
|
21
21
|
|
|
@@ -500,6 +500,10 @@ def test_marker_environment_matches_target_interpreter() -> None:
|
|
|
500
500
|
assert info.marker_environment == default_environment()
|
|
501
501
|
|
|
502
502
|
|
|
503
|
+
def test_marker_environment_type_has_standard_keys() -> None:
|
|
504
|
+
assert MarkerEnvironment.__required_keys__ == default_environment().keys()
|
|
505
|
+
|
|
506
|
+
|
|
503
507
|
def test_marker_environment_uses_target_platform(tmp_path: Path) -> None:
|
|
504
508
|
(tmp_path / "sitecustomize.py").write_text(
|
|
505
509
|
'import platform\nplatform.machine = lambda: "target-machine"\nplatform.release = lambda: "target-release"\n',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_discovery-1.8.0 → python_discovery-1.9.0}/.github/workflows/upgrade-release-tools.yaml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_discovery-1.8.0 → python_discovery-1.9.0}/tests/py_info/test_py_info_exe_based_of.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|