python-discovery 1.9.4__tar.gz → 1.9.6__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.9.6/.github/workflows/actions.lock +53 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/workflows/check.yaml +19 -6
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/workflows/codeql.yaml +1 -1
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/workflows/news.yaml +4 -4
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/workflows/prepare-release.yaml +9 -2
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/workflows/release.yaml +5 -5
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/workflows/scorecard.yaml +1 -1
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/workflows/upgrade-release-tools.yaml +1 -3
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.pre-commit-config.yaml +29 -4
- python_discovery-1.9.6/.python-sbom-revision +1 -0
- python_discovery-1.9.6/CONTRIBUTING.md +5 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/PKG-INFO +1 -1
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/changelog.rst +56 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/conf.py +14 -13
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/explanation.rst +9 -4
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/how-to/standalone-usage.rst +5 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/tutorial/getting-started.rst +1 -1
- python_discovery-1.9.6/hatch_build.py +14 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/pylock.toml +446 -333
- {python_discovery-1.9.4 → python_discovery-1.9.6}/pyproject.toml +26 -12
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/__init__.py +1 -4
- python_discovery-1.9.6/src/python_discovery/_about.py +8 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_cache.py +107 -97
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_cached_py_info.py +141 -136
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_discovery.py +301 -308
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_py_info.py +479 -394
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_py_info_collect.py +148 -148
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_py_spec.py +118 -106
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_specifier.py +144 -144
- python_discovery-1.9.6/src/python_discovery/_windows/__init__.py +11 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_windows/_cancel_io.py +7 -2
- python_discovery-1.9.6/src/python_discovery/_windows/_pep514.py +229 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_windows/_propose.py +14 -18
- {python_discovery-1.9.4 → python_discovery-1.9.6}/tasks/old_target_check.py +1 -2
- {python_discovery-1.9.4 → python_discovery-1.9.6}/tests/conftest.py +1 -1
- python_discovery-1.9.6/tests/python_discovery/_windows/conftest.py +164 -0
- python_discovery-1.9.4/tests/windows/test_windows_pep514.py → python_discovery-1.9.6/tests/python_discovery/_windows/test_pep514.py +103 -39
- {python_discovery-1.9.4/tests/windows → python_discovery-1.9.6/tests/python_discovery/_windows}/winreg_mock_values.py +6 -4
- {python_discovery-1.9.4/tests → python_discovery-1.9.6/tests/python_discovery}/test_cache.py +29 -22
- {python_discovery-1.9.4/tests → python_discovery-1.9.6/tests/python_discovery}/test_cached_py_info.py +198 -73
- {python_discovery-1.9.4/tests → python_discovery-1.9.6/tests/python_discovery}/test_discovery.py +498 -180
- python_discovery-1.9.6/tests/python_discovery/test_py_info.py +1247 -0
- {python_discovery-1.9.4/tests → python_discovery-1.9.6/tests/python_discovery}/test_specifier.py +9 -21
- {python_discovery-1.9.4 → python_discovery-1.9.6}/tests/test_cache_recovery.py +23 -8
- {python_discovery-1.9.4 → python_discovery-1.9.6}/tests/test_iter_interpreters.py +64 -28
- {python_discovery-1.9.4 → python_discovery-1.9.6}/tests/test_py_info_collect.py +102 -60
- {python_discovery-1.9.4 → python_discovery-1.9.6}/tests/test_py_spec.py +50 -28
- {python_discovery-1.9.4 → python_discovery-1.9.6}/tests/test_py_spec_extra.py +27 -28
- {python_discovery-1.9.4 → python_discovery-1.9.6}/tox.toml +2 -2
- python_discovery-1.9.4/src/python_discovery/_windows/__init__.py +0 -13
- python_discovery-1.9.4/src/python_discovery/_windows/_pep514.py +0 -230
- python_discovery-1.9.4/tests/py_info/test_py_info.py +0 -580
- python_discovery-1.9.4/tests/py_info/test_py_info_exe_based_of.py +0 -82
- python_discovery-1.9.4/tests/test_discovery_extra.py +0 -241
- python_discovery-1.9.4/tests/test_py_info_extra.py +0 -590
- python_discovery-1.9.4/tests/test_query_timeout.py +0 -110
- python_discovery-1.9.4/tests/windows/conftest.py +0 -175
- python_discovery-1.9.4/tests/windows/test_windows.py +0 -47
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/FUNDING.yaml +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/SECURITY.md +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/THREAT_MODEL.md +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/dependabot.yaml +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.github/release.yaml +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.gitignore +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.readthedocs.yaml +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/.readthedocs.yml +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/CODE_OF_CONDUCT.md +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/LICENSE +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/README.md +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/_static/custom.css +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/_static/github.svg +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/_static/logo.svg +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/changelog/template.jinja2 +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/contributing.rst +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/index.rst +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/reference/api.rst +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/docs/reference/environment-variables.rst +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/_compat.py +4 -4
- {python_discovery-1.9.4 → python_discovery-1.9.6}/src/python_discovery/py.typed +0 -0
- {python_discovery-1.9.4 → python_discovery-1.9.6}/tasks/old_target_check.sh +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# This file is machine-generated by `gh actions-lock`.
|
|
2
|
+
# Do not edit by hand; run `gh actions-lock` to update.
|
|
3
|
+
# Docs: https://gh.io/actions-lockfile
|
|
4
|
+
version: 'v0.0.3'
|
|
5
|
+
workflows:
|
|
6
|
+
'.github/workflows/check.yaml':
|
|
7
|
+
- 'actions/checkout@v7.0.1'
|
|
8
|
+
- 'astral-sh/setup-uv@v10.3.3'
|
|
9
|
+
- 'tox-dev/github-workflows@6.8.4'
|
|
10
|
+
'.github/workflows/codeql.yaml': []
|
|
11
|
+
'.github/workflows/news.yaml':
|
|
12
|
+
- 'actions/checkout@v7.0.1'
|
|
13
|
+
- 'astral-sh/setup-uv@v10.3.3'
|
|
14
|
+
- 'tox-dev/github-workflows@6.8.4'
|
|
15
|
+
'.github/workflows/prepare-release.yaml': []
|
|
16
|
+
'.github/workflows/release.yaml':
|
|
17
|
+
- 'actions/download-artifact@v8.0.2'
|
|
18
|
+
- 'pypa/gh-action-pypi-publish@v1.14.3'
|
|
19
|
+
'.github/workflows/scorecard.yaml': []
|
|
20
|
+
'.github/workflows/upgrade-release-tools.yaml': []
|
|
21
|
+
dependencies:
|
|
22
|
+
'actions/checkout@v7.0.1':
|
|
23
|
+
ref: 'v7.0.1'
|
|
24
|
+
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
|
|
25
|
+
owner_id: 44036562
|
|
26
|
+
repo_id: 197814629
|
|
27
|
+
'actions/download-artifact@v8.0.2':
|
|
28
|
+
ref: 'v8.0.2'
|
|
29
|
+
commit: 'sha1-9000827ccba6bdab643e8b6fd33ac0654aef8333'
|
|
30
|
+
owner_id: 44036562
|
|
31
|
+
repo_id: 192626254
|
|
32
|
+
'actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405':
|
|
33
|
+
ref: 'v6.2.0'
|
|
34
|
+
commit: 'sha1-a309ff8b426b58ec0e2a45f0f869d46889d02405'
|
|
35
|
+
owner_id: 44036562
|
|
36
|
+
repo_id: 192625525
|
|
37
|
+
'astral-sh/setup-uv@v10.3.3':
|
|
38
|
+
ref: 'v10.3.3'
|
|
39
|
+
commit: 'sha1-68559e99cc807c1eb7e9238fd43a15bba460eec2'
|
|
40
|
+
owner_id: 115962839
|
|
41
|
+
repo_id: 846733598
|
|
42
|
+
'pypa/gh-action-pypi-publish@v1.14.3':
|
|
43
|
+
ref: 'v1.14.3'
|
|
44
|
+
commit: 'sha1-7245906fb61fa33a13554f9d5fb856fe61758086'
|
|
45
|
+
owner_id: 647025
|
|
46
|
+
repo_id: 178055147
|
|
47
|
+
uses:
|
|
48
|
+
- 'actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405'
|
|
49
|
+
'tox-dev/github-workflows@6.8.4':
|
|
50
|
+
ref: '6.8.4'
|
|
51
|
+
commit: 'sha1-9334311ad92f91f7f5c937b3ab218da4d317116e'
|
|
52
|
+
owner_id: 20345659
|
|
53
|
+
repo_id: 1426182029
|
|
@@ -7,7 +7,7 @@ on:
|
|
|
7
7
|
pull_request:
|
|
8
8
|
types: [opened, synchronize, reopened]
|
|
9
9
|
schedule:
|
|
10
|
-
- cron: "
|
|
10
|
+
- cron: "47 8 * * *"
|
|
11
11
|
concurrency:
|
|
12
12
|
group: check-${{ github.ref }}
|
|
13
13
|
cancel-in-progress: true
|
|
@@ -16,7 +16,7 @@ permissions:
|
|
|
16
16
|
jobs:
|
|
17
17
|
test:
|
|
18
18
|
name: 🧪 Test
|
|
19
|
-
uses: tox-dev/github-workflows/.github/workflows/check.yaml@
|
|
19
|
+
uses: tox-dev/github-workflows/.github/workflows/check.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
|
|
20
20
|
permissions:
|
|
21
21
|
contents: read
|
|
22
22
|
with:
|
|
@@ -40,12 +40,12 @@ jobs:
|
|
|
40
40
|
runs-on: ubuntu-26.04
|
|
41
41
|
steps:
|
|
42
42
|
- name: 📥 Check out code
|
|
43
|
-
uses: actions/checkout@
|
|
43
|
+
uses: actions/checkout@v7.0.1
|
|
44
44
|
with:
|
|
45
45
|
fetch-depth: 0
|
|
46
46
|
persist-credentials: false
|
|
47
47
|
- name: 🐍 Install uv
|
|
48
|
-
uses: astral-sh/setup-uv@
|
|
48
|
+
uses: astral-sh/setup-uv@v10.3.3
|
|
49
49
|
with:
|
|
50
50
|
version: latest-known
|
|
51
51
|
python-version: "3.15"
|
|
@@ -63,14 +63,27 @@ jobs:
|
|
|
63
63
|
run: tasks/old_target_check.sh 3.5 rejected
|
|
64
64
|
- name: 🧪 Reject Python 2.7
|
|
65
65
|
run: tasks/old_target_check.sh 2.7 rejected
|
|
66
|
+
release:
|
|
67
|
+
name: 🏷️ Release dry run
|
|
68
|
+
uses: $/.github/workflows/prepare-release.yaml
|
|
69
|
+
permissions:
|
|
70
|
+
contents: read
|
|
71
|
+
pull-requests: read
|
|
72
|
+
with:
|
|
73
|
+
dry-run: true
|
|
74
|
+
hooks:
|
|
75
|
+
name: 🧹 Hooks under the cooldown
|
|
76
|
+
uses: tox-dev/github-workflows/.github/workflows/cooled-hooks.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
|
|
77
|
+
permissions:
|
|
78
|
+
contents: read
|
|
66
79
|
gate:
|
|
67
80
|
name: 🚦 ${{ github.event_name == 'pull_request' && 'Required checks pass' || 'Non-PR checks pass' }}
|
|
68
81
|
if: ${{ !cancelled() }} # codespell:ignore cancelled
|
|
69
|
-
needs: [test, old-target]
|
|
82
|
+
needs: [test, old-target, release, hooks]
|
|
70
83
|
runs-on: ubuntu-26.04
|
|
71
84
|
permissions: {}
|
|
72
85
|
steps:
|
|
73
86
|
- name: 🚦 Require all needed jobs to pass
|
|
74
|
-
uses: tox-dev/github-workflows/required-checks@
|
|
87
|
+
uses: tox-dev/github-workflows/required-checks@6.8.4
|
|
75
88
|
with:
|
|
76
89
|
needs: ${{ toJSON(needs) }}
|
|
@@ -13,7 +13,7 @@ permissions: {}
|
|
|
13
13
|
jobs:
|
|
14
14
|
analyze:
|
|
15
15
|
name: 🛡️ Analyze
|
|
16
|
-
uses: tox-dev/github-workflows/.github/workflows/codeql.yaml@
|
|
16
|
+
uses: tox-dev/github-workflows/.github/workflows/codeql.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
|
|
17
17
|
permissions:
|
|
18
18
|
contents: read
|
|
19
19
|
security-events: write
|
|
@@ -11,20 +11,20 @@ jobs:
|
|
|
11
11
|
runs-on: ubuntu-26.04
|
|
12
12
|
steps:
|
|
13
13
|
- name: 📥 Check out code
|
|
14
|
-
uses: actions/checkout@
|
|
14
|
+
uses: actions/checkout@v7.0.1
|
|
15
15
|
with:
|
|
16
16
|
fetch-depth: 0
|
|
17
17
|
persist-credentials: false
|
|
18
18
|
- name: 🐍 Install uv
|
|
19
|
-
uses: astral-sh/setup-uv@
|
|
19
|
+
uses: astral-sh/setup-uv@v10.3.3
|
|
20
20
|
with:
|
|
21
21
|
version: latest-known
|
|
22
22
|
python-version: "3.15"
|
|
23
23
|
enable-cache: false
|
|
24
24
|
- name: 📦 Install locked release tools
|
|
25
|
-
uses: tox-dev/github-workflows/install-locked-tools@
|
|
25
|
+
uses: tox-dev/github-workflows/install-locked-tools@6.8.4
|
|
26
26
|
with:
|
|
27
27
|
groups: release-news
|
|
28
28
|
venv: ${{ runner.temp }}/release-tools
|
|
29
29
|
- name: 🔍 Validate news fragments
|
|
30
|
-
uses: tox-dev/github-workflows/validate-news@
|
|
30
|
+
uses: tox-dev/github-workflows/validate-news@6.8.4
|
|
@@ -8,16 +8,23 @@ on:
|
|
|
8
8
|
type: choice
|
|
9
9
|
options: [auto, major, minor, patch]
|
|
10
10
|
default: auto
|
|
11
|
+
workflow_call:
|
|
12
|
+
inputs:
|
|
13
|
+
dry-run:
|
|
14
|
+
description: Assemble the release without pushing, for the pull request gate
|
|
15
|
+
type: boolean
|
|
16
|
+
required: true
|
|
11
17
|
permissions: {}
|
|
12
18
|
jobs:
|
|
13
19
|
prepare:
|
|
14
20
|
name: 🏷️ Prepare Towncrier release
|
|
15
|
-
uses: tox-dev/github-workflows/.github/workflows/prepare-towncrier-release.yaml@
|
|
21
|
+
uses: tox-dev/github-workflows/.github/workflows/prepare-towncrier-release.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
|
|
16
22
|
permissions:
|
|
17
23
|
contents: read
|
|
18
24
|
pull-requests: read
|
|
19
25
|
with:
|
|
20
|
-
bump: ${{ inputs.bump }}
|
|
26
|
+
bump: ${{ inputs.bump || 'auto' }}
|
|
27
|
+
dry-run: ${{ inputs.dry-run == true }}
|
|
21
28
|
annotated: true
|
|
22
29
|
secrets:
|
|
23
30
|
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
|
@@ -10,12 +10,12 @@ concurrency:
|
|
|
10
10
|
jobs:
|
|
11
11
|
build:
|
|
12
12
|
name: 🏗️ Build
|
|
13
|
-
uses: tox-dev/github-workflows/.github/workflows/validate-python-release.yaml@
|
|
13
|
+
uses: tox-dev/github-workflows/.github/workflows/validate-python-release.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
|
|
14
14
|
permissions:
|
|
15
15
|
contents: read
|
|
16
16
|
notes:
|
|
17
17
|
name: 📝 Render GitHub Release notes
|
|
18
|
-
uses: tox-dev/github-workflows/.github/workflows/release-notes.yaml@
|
|
18
|
+
uses: tox-dev/github-workflows/.github/workflows/release-notes.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
|
|
19
19
|
permissions:
|
|
20
20
|
contents: read
|
|
21
21
|
with:
|
|
@@ -33,18 +33,18 @@ jobs:
|
|
|
33
33
|
id-token: write
|
|
34
34
|
steps:
|
|
35
35
|
- name: 📩 Download distributions
|
|
36
|
-
uses: actions/download-artifact@
|
|
36
|
+
uses: actions/download-artifact@v8.0.2
|
|
37
37
|
with:
|
|
38
38
|
artifact-ids: ${{ needs.build.outputs.distributions-artifact-id }}
|
|
39
39
|
path: dist/
|
|
40
40
|
- name: 🚀 Publish to PyPI
|
|
41
|
-
uses: pypa/gh-action-pypi-publish@
|
|
41
|
+
uses: pypa/gh-action-pypi-publish@v1.14.3
|
|
42
42
|
with:
|
|
43
43
|
packages-dir: dist
|
|
44
44
|
github-release:
|
|
45
45
|
name: 🚀 Publish GitHub Release
|
|
46
46
|
needs: [build, notes, release]
|
|
47
|
-
uses: tox-dev/github-workflows/.github/workflows/github-release.yaml@
|
|
47
|
+
uses: tox-dev/github-workflows/.github/workflows/github-release.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
|
|
48
48
|
permissions:
|
|
49
49
|
contents: write
|
|
50
50
|
with:
|
|
@@ -23,4 +23,4 @@ jobs:
|
|
|
23
23
|
pull-requests: read # read reviews for the Code-Review check
|
|
24
24
|
security-events: write # upload the SARIF results to code scanning
|
|
25
25
|
statuses: read # read commit statuses for the CI-Tests check
|
|
26
|
-
uses: tox-dev/github-workflows/.github/workflows/scorecard.yaml@
|
|
26
|
+
uses: tox-dev/github-workflows/.github/workflows/scorecard.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
|
{python_discovery-1.9.4 → python_discovery-1.9.6}/.github/workflows/upgrade-release-tools.yaml
RENAMED
|
@@ -10,13 +10,11 @@ concurrency:
|
|
|
10
10
|
jobs:
|
|
11
11
|
upgrade:
|
|
12
12
|
name: 🔀 Upgrade release tools
|
|
13
|
-
uses: tox-dev/github-workflows/.github/workflows/upgrade-release-tools.yaml@
|
|
13
|
+
uses: tox-dev/github-workflows/.github/workflows/upgrade-release-tools.yaml@9334311ad92f91f7f5c937b3ab218da4d317116e # 6.8.4
|
|
14
14
|
permissions:
|
|
15
15
|
contents: read
|
|
16
16
|
secrets:
|
|
17
17
|
RELEASE_APP_PRIVATE_KEY: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
|
|
18
18
|
with:
|
|
19
|
-
commit-message: "build(deps): refresh release lock"
|
|
20
|
-
pull-request-title: "build(deps): refresh release tool lock"
|
|
21
19
|
pull-request-body: |-
|
|
22
20
|
Relock `pylock.toml` after the seven-day cutoff.
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# prek runs lower priorities first and equal ones concurrently, so hooks sharing a priority never write the same
|
|
2
|
+
# file; pre-commit ignores the key and runs hooks in file order.
|
|
1
3
|
ci:
|
|
2
4
|
autoupdate_schedule: quarterly
|
|
3
5
|
default_language_version:
|
|
@@ -7,34 +9,51 @@ repos:
|
|
|
7
9
|
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
|
|
8
10
|
hooks:
|
|
9
11
|
- id: end-of-file-fixer
|
|
12
|
+
priority: 1
|
|
10
13
|
- id: trailing-whitespace
|
|
14
|
+
priority: 2
|
|
11
15
|
- repo: https://github.com/python-jsonschema/check-jsonschema
|
|
12
16
|
rev: a76b92851fc9eede9f9bc4073eb55202f34eb0df # frozen: 0.39.0
|
|
13
17
|
hooks:
|
|
14
18
|
- id: check-github-workflows
|
|
19
|
+
priority: 8
|
|
15
20
|
args: ["--verbose"]
|
|
16
21
|
- repo: https://github.com/codespell-project/codespell
|
|
17
22
|
rev: 57b21406f092110c18776e39b0bda50d37c945c8 # frozen: v2.4.3
|
|
18
23
|
hooks:
|
|
19
24
|
- id: codespell
|
|
25
|
+
priority: 8
|
|
20
26
|
- repo: https://github.com/tox-dev/pyproject-fmt
|
|
21
|
-
rev: "
|
|
27
|
+
rev: "3c6e76e10abcae02303212289efed3413350769c" # frozen: v2.30.6
|
|
22
28
|
hooks:
|
|
23
29
|
- id: pyproject-fmt
|
|
30
|
+
priority: 3
|
|
24
31
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
25
|
-
rev: "
|
|
32
|
+
rev: "c0f278f1254ccc8fb09676bcdb8d847e7db493e5" # frozen: v0.17.4
|
|
26
33
|
hooks:
|
|
27
|
-
- id: ruff-format
|
|
28
34
|
- id: ruff
|
|
35
|
+
priority: 5
|
|
29
36
|
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
|
|
37
|
+
- repo: https://github.com/gaborbernat/simplint-pre-commit
|
|
38
|
+
rev: "a12d8eaac290be24041a3e2778c636c56453722e" # frozen: v0.12.2
|
|
39
|
+
hooks:
|
|
40
|
+
- id: simplint
|
|
41
|
+
priority: 6
|
|
42
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
43
|
+
rev: "c0f278f1254ccc8fb09676bcdb8d847e7db493e5" # frozen: v0.17.4
|
|
44
|
+
hooks:
|
|
45
|
+
- id: ruff-format
|
|
46
|
+
priority: 7
|
|
30
47
|
- repo: https://github.com/google/yamlfmt
|
|
31
48
|
rev: "21ca5323a9c87ee37a434e0ca908efc0a89daa07" # frozen: v0.21.0
|
|
32
49
|
hooks:
|
|
33
50
|
- id: yamlfmt
|
|
51
|
+
priority: 3
|
|
34
52
|
- repo: https://github.com/executablebooks/mdformat
|
|
35
53
|
rev: 82912cdaea4fb830f751504486a7879c70526547 # frozen: 1.0.0
|
|
36
54
|
hooks:
|
|
37
55
|
- id: mdformat
|
|
56
|
+
priority: 3
|
|
38
57
|
args: ["--wrap", "120"]
|
|
39
58
|
additional_dependencies:
|
|
40
59
|
- mdformat-gfm==1.0.0
|
|
@@ -43,15 +62,18 @@ repos:
|
|
|
43
62
|
rev: 479be5958357ba5ab65ce47172117348516860e9 # frozen: v3.14.1-1
|
|
44
63
|
hooks:
|
|
45
64
|
- id: shfmt
|
|
65
|
+
priority: 3
|
|
46
66
|
args: ["-i", "2"]
|
|
47
67
|
- repo: https://github.com/shellcheck-py/shellcheck-py
|
|
48
68
|
rev: 745eface02aef23e168a8afb6b5737818efbea95 # frozen: v0.11.0.1
|
|
49
69
|
hooks:
|
|
50
70
|
- id: shellcheck
|
|
71
|
+
priority: 8
|
|
51
72
|
- repo: https://github.com/LilSpazJoekp/docstrfmt
|
|
52
73
|
rev: c1813841673cdcd6cf602dde1edb78a5d5e45235 # frozen: v2.2.1
|
|
53
74
|
hooks:
|
|
54
75
|
- id: docstrfmt
|
|
76
|
+
priority: 3
|
|
55
77
|
files: |
|
|
56
78
|
(?x)
|
|
57
79
|
^docs/changelog[.]rst$ # Only the generated release history.
|
|
@@ -59,10 +81,13 @@ repos:
|
|
|
59
81
|
additional_dependencies:
|
|
60
82
|
- "sphinx==9.2.0"
|
|
61
83
|
- repo: https://github.com/zizmorcore/zizmor-pre-commit
|
|
62
|
-
rev:
|
|
84
|
+
rev: 06a39750ec31860bb44f2acf67182c40016cd1e7 # frozen: v1.32.0
|
|
63
85
|
hooks:
|
|
64
86
|
- id: zizmor
|
|
87
|
+
priority: 8
|
|
65
88
|
- repo: meta
|
|
66
89
|
hooks:
|
|
67
90
|
- id: check-hooks-apply
|
|
91
|
+
priority: 8
|
|
68
92
|
- id: check-useless-excludes
|
|
93
|
+
priority: 8
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
node: 8023513d5c5fbeba5fa073ed1683327f09bfeb77
|
|
@@ -6,6 +6,62 @@
|
|
|
6
6
|
|
|
7
7
|
.. towncrier release notes start
|
|
8
8
|
|
|
9
|
+
.. _release-1-9-6:
|
|
10
|
+
|
|
11
|
+
*********************
|
|
12
|
+
v1.9.6 (2026-11-18)
|
|
13
|
+
*********************
|
|
14
|
+
|
|
15
|
+
.. _release-1-9-6-changes:
|
|
16
|
+
|
|
17
|
+
Changes
|
|
18
|
+
-------
|
|
19
|
+
|
|
20
|
+
- Restore ``MarkerEnvironment`` as a package-root export after its removal during simplint adoption (:pr:`258`) by
|
|
21
|
+
:user:`gaborbernat`.
|
|
22
|
+
|
|
23
|
+
.. _release-1-9-6-fixed:
|
|
24
|
+
|
|
25
|
+
Fixed
|
|
26
|
+
-----
|
|
27
|
+
|
|
28
|
+
- :func:`~python_discovery.get_interpreter` no longer raises while resolving a ``pyenv`` shim when the working directory
|
|
29
|
+
was removed, or on illumos sits below an unreadable directory; it reads ``$PWD`` instead, as ``pyenv`` does
|
|
30
|
+
(:pr:`263`) by :user:`hnwg` and :user:`gaborbernat`.
|
|
31
|
+
- Discovery now finds an interpreter given as a relative path such as ``./venv/bin/python`` when ``try_first_with``
|
|
32
|
+
lists the same file under another name or case, its base interpreter, or another virtual environment on that base,
|
|
33
|
+
instead of finding nothing (:pr:`261`) by :user:`darrenhuai` and :user:`gaborbernat`.
|
|
34
|
+
- On Windows, find interpreter names that already end in ``.exe``, such as ``pythonw.exe``, on ``PATH`` (:pr:`253`) by
|
|
35
|
+
:user:`darrenhuai` and :user:`gaborbernat`.
|
|
36
|
+
- Treat the ``py``, ``python`` and ``graalvm`` spec prefixes case-insensitively, so ``Python3.12`` finds the same
|
|
37
|
+
interpreters as ``python3.12`` instead of none (:pr:`271`) by :user:`HarshJamgaonkar05` and :user:`gaborbernat`.
|
|
38
|
+
|
|
39
|
+
.. _release-1-9-6-packaging:
|
|
40
|
+
|
|
41
|
+
Packaging
|
|
42
|
+
---------
|
|
43
|
+
|
|
44
|
+
- Every wheel now carries a `PEP 770 <https://peps.python.org/pep-0770/>`_ CycloneDX SBOM in its ``.dist-info/sboms``
|
|
45
|
+
directory, written at build time by `python-sbom <https://github.com/tox-dev/python-sbom>`_ (:pr:`256`) by
|
|
46
|
+
:user:`gaborbernat`.
|
|
47
|
+
|
|
48
|
+
.. _release-1-9-5:
|
|
49
|
+
|
|
50
|
+
*********************
|
|
51
|
+
v1.9.5 (2026-11-06)
|
|
52
|
+
*********************
|
|
53
|
+
|
|
54
|
+
.. _release-1-9-5-fixed:
|
|
55
|
+
|
|
56
|
+
Fixed
|
|
57
|
+
-----
|
|
58
|
+
|
|
59
|
+
- :func:`~python_discovery.iter_interpreters` with no key no longer probes ``PATH`` directories or subdirectories named
|
|
60
|
+
like Python executables as interpreters (:pr:`247`) by :user:`qodelicious` and :user:`gaborbernat`.
|
|
61
|
+
- ``PythonSpec.satisfies`` now checks a version specifier at the precision it was written with, so ``3.11`` no longer
|
|
62
|
+
satisfies ``>=3.13``. The Windows registry pre-filter skips mismatched releases and interrogates candidates whose
|
|
63
|
+
prerelease status is unknown (:pr:`246`) by :user:`qodelicious` and :user:`gaborbernat`.
|
|
64
|
+
|
|
9
65
|
.. _release-1-9-4:
|
|
10
66
|
|
|
11
67
|
*********************
|
|
@@ -5,15 +5,16 @@ from __future__ import annotations
|
|
|
5
5
|
import os
|
|
6
6
|
from datetime import datetime, timezone
|
|
7
7
|
from pathlib import Path
|
|
8
|
+
from typing import Final
|
|
8
9
|
|
|
9
10
|
from python_discovery import __version__
|
|
10
11
|
|
|
11
|
-
company = "tox-dev"
|
|
12
|
+
company: Final[str] = "tox-dev"
|
|
12
13
|
name = "python-discovery"
|
|
13
|
-
repository = f"https://github.com/{company}/{name}"
|
|
14
|
+
repository: Final[str] = f"https://github.com/{company}/{name}"
|
|
14
15
|
version = ".".join(__version__.split(".")[:2])
|
|
15
16
|
release = __version__
|
|
16
|
-
copyright = f"2026-{datetime.now(tz=timezone.utc).year}, {company}" # ruff:ignore[builtin-variable-shadowing]
|
|
17
|
+
copyright: Final[str] = f"2026-{datetime.now(tz=timezone.utc).year}, {company}" # ruff:ignore[builtin-variable-shadowing] Sphinx reads the name `copyright`
|
|
17
18
|
|
|
18
19
|
extensions = [
|
|
19
20
|
"sphinx_llm.txt",
|
|
@@ -26,10 +27,10 @@ extensions = [
|
|
|
26
27
|
"sphinxcontrib.towncrier.ext",
|
|
27
28
|
]
|
|
28
29
|
|
|
29
|
-
towncrier_draft_autoversion_mode = "draft"
|
|
30
|
-
towncrier_draft_include_empty = True
|
|
30
|
+
towncrier_draft_autoversion_mode: Final[str] = "draft"
|
|
31
|
+
towncrier_draft_include_empty: Final[bool] = True
|
|
31
32
|
towncrier_draft_working_directory = Path(__file__).parent.parent
|
|
32
|
-
autosectionlabel_maxdepth = 2
|
|
33
|
+
autosectionlabel_maxdepth: Final[int] = 2
|
|
33
34
|
|
|
34
35
|
extlinks = {
|
|
35
36
|
"issue": (f"{repository}/issues/%s", "#%s"),
|
|
@@ -43,19 +44,19 @@ intersphinx_mapping = {
|
|
|
43
44
|
}
|
|
44
45
|
|
|
45
46
|
templates_path = []
|
|
46
|
-
source_suffix = ".rst"
|
|
47
|
+
source_suffix: Final[str] = ".rst"
|
|
47
48
|
exclude_patterns = ["_build", "changelog/*"]
|
|
48
49
|
|
|
49
|
-
main_doc = "index"
|
|
50
|
-
pygments_style = "default"
|
|
51
|
-
always_document_param_types = True
|
|
50
|
+
main_doc: Final[str] = "index"
|
|
51
|
+
pygments_style: Final[str] = "default"
|
|
52
|
+
always_document_param_types: Final[bool] = True
|
|
52
53
|
project = name
|
|
53
54
|
|
|
54
|
-
html_theme = "furo"
|
|
55
|
+
html_theme: Final[str] = "furo"
|
|
55
56
|
html_title = project
|
|
56
57
|
html_last_updated_fmt = datetime.now(tz=timezone.utc).isoformat()
|
|
57
|
-
pygments_dark_style = "monokai"
|
|
58
|
-
html_show_sourcelink = False
|
|
58
|
+
pygments_dark_style: Final[str] = "monokai"
|
|
59
|
+
html_show_sourcelink: Final[bool] = False
|
|
59
60
|
html_static_path = ["_static"]
|
|
60
61
|
html_theme_options = {
|
|
61
62
|
"light_logo": "logo.svg",
|
|
@@ -12,10 +12,10 @@ order. It stops as soon as it finds an interpreter that matches your spec.
|
|
|
12
12
|
flowchart TD
|
|
13
13
|
Start["get_interpreter()"] --> AbsPath{"Is spec an<br>absolute path?"}
|
|
14
14
|
AbsPath -->|Yes| TryAbs["Use path directly"]
|
|
15
|
-
AbsPath -->|No|
|
|
16
|
-
TryFirst --> RelPath{"Does spec name a<br>relative directory?"}
|
|
15
|
+
AbsPath -->|No| RelPath{"Does spec name a<br>relative directory?"}
|
|
17
16
|
RelPath -->|Yes| TryRel["Resolve relative to cwd"]
|
|
18
|
-
RelPath -->|No|
|
|
17
|
+
RelPath -->|No| TryFirst["try_first_with paths"]
|
|
18
|
+
TryFirst --> Bare{"Bare executable name?"}
|
|
19
19
|
Bare -->|Yes| PATH
|
|
20
20
|
Bare -->|No| Current["Current interpreter"]
|
|
21
21
|
Current --> Win{"Windows?"}
|
|
@@ -75,6 +75,9 @@ detects these shims and resolves them to the actual binary.
|
|
|
75
75
|
python-discovery skips version files over 4096 characters. It checks parent directories and, for pyenv, the global
|
|
76
76
|
version when needed.
|
|
77
77
|
|
|
78
|
+
Version-file search starts in the current directory. If the process can no longer name that directory,
|
|
79
|
+
python-discovery starts from ``PWD`` in the supplied environment. If that is unavailable, it checks the global version.
|
|
80
|
+
|
|
78
81
|
A version must name one directory below the version manager's installation root. Discovery skips ``.`` and ``..`` and
|
|
79
82
|
version names containing a path separator, then tries the next configured version.
|
|
80
83
|
|
|
@@ -208,7 +211,8 @@ That means symlinked aliases like ``/bin/python3`` and ``/usr/bin/python3``, or
|
|
|
208
211
|
symlinks to its base interpreter, collapse to a single yield. The semantic is "one entry per distinct install,"
|
|
209
212
|
which is what callers building choosers or version-range pickers usually want.
|
|
210
213
|
|
|
211
|
-
**Iteration order.**
|
|
214
|
+
**Iteration order.** A relative path spec is checked before ``try_first_with`` because only that path can match. For
|
|
215
|
+
other specs, yields come back in *priority order*: ``try_first_with`` first, then the running interpreter,
|
|
212
216
|
then :pep:`514` entries on Windows, then PATH left-to-right, then UV-managed installs. This matches what
|
|
213
217
|
:func:`~python_discovery.get_interpreter` would have returned at each step. If your ordering differs (newest
|
|
214
218
|
version first, smallest install root, etc.), wrap the call in :func:`sorted` -- the API deliberately does not
|
|
@@ -372,6 +376,7 @@ Order matters: the parts appear in the sequence shown above. Combine the ABI fla
|
|
|
372
376
|
``-machine`` as in ``python3.13d-64-arm64``. Mixing ``d`` with ``-dbg`` in one spec, or swapping the arch
|
|
373
377
|
and machine segments, leaves the string unrecognized, so it falls back to a literal executable-name match on ``PATH``.
|
|
374
378
|
Only a spec with a directory component, such as ``./python3`` or ``venv/bin/python``, searches the working directory.
|
|
379
|
+
On Windows, a literal executable name on ``PATH`` may include ``.exe``, such as ``pythonw.exe``.
|
|
375
380
|
|
|
376
381
|
**Full examples:**
|
|
377
382
|
|
|
@@ -7,6 +7,7 @@ Try specific executables first
|
|
|
7
7
|
If you know the path to an interpreter executable, pass it via ``try_first_with`` to check it
|
|
8
8
|
before the normal search. This is useful when you have a custom Python install outside the
|
|
9
9
|
standard locations.
|
|
10
|
+
If the spec names a relative path such as ``./venv/bin/python``, that path is checked before ``try_first_with``.
|
|
10
11
|
|
|
11
12
|
.. code-block:: python
|
|
12
13
|
|
|
@@ -40,6 +41,8 @@ Restrict the search environment
|
|
|
40
41
|
|
|
41
42
|
By default, python-discovery reads environment variables like ``PATH`` and ``PYENV_ROOT`` from your
|
|
42
43
|
shell. You can override these to control exactly where the library looks.
|
|
44
|
+
If the process cannot name its current directory, set ``PWD`` to the intended directory so shim resolution can find
|
|
45
|
+
its ``.python-version`` file.
|
|
43
46
|
|
|
44
47
|
.. mermaid::
|
|
45
48
|
|
|
@@ -47,6 +50,7 @@ shell. You can override these to control exactly where the library looks.
|
|
|
47
50
|
Env["Custom env dict"] --> Call["get_interpreter(spec, env=env)"]
|
|
48
51
|
Call --> PATH["PATH"]
|
|
49
52
|
Call --> Pyenv["PYENV_ROOT"]
|
|
53
|
+
Call --> PWD["PWD fallback"]
|
|
50
54
|
Call --> UV["UV_PYTHON_INSTALL_DIR"]
|
|
51
55
|
Call --> Mise["MISE_DATA_DIR"]
|
|
52
56
|
|
|
@@ -63,6 +67,7 @@ shell. You can override these to control exactly where the library looks.
|
|
|
63
67
|
|
|
64
68
|
Only absolute directories in ``PATH`` are searched. To select an interpreter in the working directory, use
|
|
65
69
|
``./python`` as the spec on POSIX or ``./python.exe`` on Windows.
|
|
70
|
+
On Windows, ``get_interpreter("pythonw.exe")`` also finds that named executable on ``PATH``.
|
|
66
71
|
|
|
67
72
|
Customize interpreter query timeout
|
|
68
73
|
-------------------------------------
|
|
@@ -104,7 +104,7 @@ implementation python-discovery knows about, or pass a spec to filter.
|
|
|
104
104
|
.. mermaid::
|
|
105
105
|
|
|
106
106
|
flowchart TD
|
|
107
|
-
Call["iter_interpreters(
|
|
107
|
+
Call["iter_interpreters(cache=cache)"] --> Yield["yields PythonInfo"]
|
|
108
108
|
Yield --> A["1. try_first_with paths"]
|
|
109
109
|
Yield --> B["2. running interpreter"]
|
|
110
110
|
Yield --> C["3. PATH (left to right)"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"""Ship a PEP 770 SBOM in wheels built on Python 3.11 or later."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import sys
|
|
6
|
+
|
|
7
|
+
if sys.version_info >= (3, 11):
|
|
8
|
+
from python_sbom.hatch import SbomBuildHook
|
|
9
|
+
else: # python-sbom needs Python 3.11, so builds on older interpreters carry no SBOM
|
|
10
|
+
from hatchling.builders.hooks.plugin.interface import BuildHookInterface as SbomBuildHook
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def get_build_hook() -> type[SbomBuildHook]:
|
|
14
|
+
return SbomBuildHook
|