python-discovery 1.6.5__tar.gz → 1.6.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.
Files changed (68) hide show
  1. python_discovery-1.6.6/.github/dependabot.yaml +30 -0
  2. {python_discovery-1.6.5 → python_discovery-1.6.6}/.github/workflows/release.yaml +1 -1
  3. {python_discovery-1.6.5 → python_discovery-1.6.6}/.pre-commit-config.yaml +1 -1
  4. {python_discovery-1.6.5 → python_discovery-1.6.6}/PKG-INFO +1 -1
  5. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/changelog.rst +19 -0
  6. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/explanation.rst +4 -1
  7. {python_discovery-1.6.5 → python_discovery-1.6.6}/pylock.toml +45 -48
  8. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_discovery.py +2 -1
  9. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_py_info.py +2 -1
  10. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_py_spec.py +5 -0
  11. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_specifier.py +4 -6
  12. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_discovery.py +20 -1
  13. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_iter_interpreters.py +27 -0
  14. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_py_info_extra.py +10 -1
  15. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_py_spec.py +21 -1
  16. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_specifier.py +8 -0
  17. python_discovery-1.6.5/.github/dependabot.yaml +0 -33
  18. {python_discovery-1.6.5 → python_discovery-1.6.6}/.github/FUNDING.yaml +0 -0
  19. {python_discovery-1.6.5 → python_discovery-1.6.6}/.github/SECURITY.md +0 -0
  20. {python_discovery-1.6.5 → python_discovery-1.6.6}/.github/release.yaml +0 -0
  21. {python_discovery-1.6.5 → python_discovery-1.6.6}/.github/workflows/check.yaml +0 -0
  22. {python_discovery-1.6.5 → python_discovery-1.6.6}/.github/workflows/codeql.yaml +0 -0
  23. {python_discovery-1.6.5 → python_discovery-1.6.6}/.github/workflows/news.yaml +0 -0
  24. {python_discovery-1.6.5 → python_discovery-1.6.6}/.github/workflows/prepare-release.yaml +0 -0
  25. {python_discovery-1.6.5 → python_discovery-1.6.6}/.github/workflows/upgrade-release-tools.yaml +0 -0
  26. {python_discovery-1.6.5 → python_discovery-1.6.6}/.gitignore +0 -0
  27. {python_discovery-1.6.5 → python_discovery-1.6.6}/.readthedocs.yaml +0 -0
  28. {python_discovery-1.6.5 → python_discovery-1.6.6}/.readthedocs.yml +0 -0
  29. {python_discovery-1.6.5 → python_discovery-1.6.6}/CODE_OF_CONDUCT.md +0 -0
  30. {python_discovery-1.6.5 → python_discovery-1.6.6}/LICENSE +0 -0
  31. {python_discovery-1.6.5 → python_discovery-1.6.6}/README.md +0 -0
  32. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/_static/custom.css +0 -0
  33. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/_static/logo.svg +0 -0
  34. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/changelog/template.jinja2 +0 -0
  35. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/conf.py +0 -0
  36. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/contributing.rst +0 -0
  37. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/how-to/standalone-usage.rst +0 -0
  38. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/index.rst +0 -0
  39. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/reference/api.rst +0 -0
  40. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/reference/environment-variables.rst +0 -0
  41. {python_discovery-1.6.5 → python_discovery-1.6.6}/docs/tutorial/getting-started.rst +0 -0
  42. {python_discovery-1.6.5 → python_discovery-1.6.6}/pyproject.toml +0 -0
  43. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/__init__.py +0 -0
  44. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_cache.py +0 -0
  45. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_cached_py_info.py +0 -0
  46. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_compat.py +0 -0
  47. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_py_info_collect.py +0 -0
  48. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_windows/__init__.py +0 -0
  49. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_windows/_pep514.py +0 -0
  50. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/_windows/_propose.py +0 -0
  51. {python_discovery-1.6.5 → python_discovery-1.6.6}/src/python_discovery/py.typed +0 -0
  52. {python_discovery-1.6.5 → python_discovery-1.6.6}/tasks/old_target_check.py +0 -0
  53. {python_discovery-1.6.5 → python_discovery-1.6.6}/tasks/old_target_check.sh +0 -0
  54. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/conftest.py +0 -0
  55. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/py_info/test_py_info.py +0 -0
  56. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/py_info/test_py_info_exe_based_of.py +0 -0
  57. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_cache.py +0 -0
  58. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_cache_recovery.py +0 -0
  59. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_cached_py_info.py +0 -0
  60. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_discovery_extra.py +0 -0
  61. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_py_info_collect.py +0 -0
  62. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_py_spec_extra.py +0 -0
  63. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/test_query_timeout.py +0 -0
  64. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/windows/conftest.py +0 -0
  65. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/windows/test_windows.py +0 -0
  66. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/windows/test_windows_pep514.py +0 -0
  67. {python_discovery-1.6.5 → python_discovery-1.6.6}/tests/windows/winreg_mock_values.py +0 -0
  68. {python_discovery-1.6.5 → python_discovery-1.6.6}/tox.toml +0 -0
@@ -0,0 +1,30 @@
1
+ version: 2
2
+ multi-ecosystem-groups:
3
+ dependencies:
4
+ schedule:
5
+ interval: weekly
6
+ day: tuesday
7
+ labels:
8
+ - dependencies
9
+ - skip news
10
+ updates:
11
+ - package-ecosystem: github-actions
12
+ directory: /
13
+ patterns:
14
+ - '*'
15
+ multi-ecosystem-group: dependencies
16
+ labels:
17
+ - dependencies
18
+ - skip news
19
+ cooldown:
20
+ default-days: 7
21
+ - package-ecosystem: pre-commit
22
+ directory: /
23
+ patterns:
24
+ - '*'
25
+ multi-ecosystem-group: dependencies
26
+ labels:
27
+ - dependencies
28
+ - skip news
29
+ cooldown:
30
+ default-days: 7
@@ -72,7 +72,7 @@ jobs:
72
72
  artifact-ids: ${{ needs.build.outputs.distributions-artifact-id }}
73
73
  path: dist/
74
74
  - name: 🚀 Publish to PyPI
75
- uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
75
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
76
76
  with:
77
77
  packages-dir: dist
78
78
  github-release:
@@ -57,7 +57,7 @@ repos:
57
57
  ^docs/changelog[.]rst$ # Only the generated release history.
58
58
  args: ["-l", "120", "--preserve-adornments"]
59
59
  additional_dependencies:
60
- - "sphinx==9.1.0"
60
+ - "sphinx==9.1.1"
61
61
  - repo: https://github.com/zizmorcore/zizmor-pre-commit
62
62
  rev: c92afdf2c6ca336aaa8f39e2bd8d48f62dbd8e1f # frozen: v1.31.1
63
63
  hooks:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: python-discovery
3
- Version: 1.6.5
3
+ Version: 1.6.6
4
4
  Import-Name: python_discovery
5
5
  Summary: Python interpreter discovery
6
6
  Project-URL: Changelog, https://github.com/tox-dev/python-discovery/blob/main/docs/changelog.rst
@@ -6,6 +6,25 @@
6
6
 
7
7
  .. towncrier release notes start
8
8
 
9
+ .. _release-1-6-6:
10
+
11
+ *********************
12
+ v1.6.6 (2026-10-27)
13
+ *********************
14
+
15
+ .. _release-1-6-6-fixed:
16
+
17
+ Fixed
18
+ -----
19
+
20
+ - Treat version specifiers with an item that cannot be parsed, such as ``>=3.x``, ``>=3.12 <4`` or ``>=3.12,foo``, as
21
+ literal executable paths instead of raising a bare ``AssertionError`` or ignoring the item during discovery
22
+ (:pr:`157`) by :user:`darrenhuai` and :user:`gaborbernat`.
23
+ - Accept relative interpreter paths that step up a directory, such as ``../venv/bin/python``, which were found and
24
+ queried but never matched the spec (:pr:`158`) by :user:`darrenhuai` and :user:`gaborbernat`.
25
+ - Match ``~=X.Y`` compatible-release specifiers against later minor versions, as PEP 440 defines, instead of only the
26
+ same minor; ``~=3.10`` now accepts 3.11 and newer 3.x (:pr:`159`) by :user:`darrenhuai` and :user:`gaborbernat`.
27
+
9
28
  .. _release-1-6-5:
10
29
 
11
30
  *********************
@@ -367,4 +367,7 @@ and machine segments, leaves the string unrecognized, so it falls back to a lite
367
367
 
368
368
  `Version specifiers <https://packaging.python.org/en/latest/specifications/version-specifiers/>`_
369
369
  (``>=``, ``<=``, ``~=``, ``!=``, ``==``, ``===``) are supported. Multiple specifiers can be comma-separated,
370
- for example ``>=3.11,<3.13``.
370
+ for example ``>=3.11,<3.13``. Each version is a release of up to three numbers with an optional ``a``, ``b`` or
371
+ ``rc`` pre-release suffix, such as ``3.12`` or ``3.13.0rc1``; ``==`` and ``!=`` also take a trailing ``.*``
372
+ wildcard, as in ``==3.12.*``. A specifier with any item outside that form, such as ``>=3.x``, ``>=3.10.post1``,
373
+ ``>=3.12 <4`` (missing comma) or ``>=3.12,foo``, falls back to a literal executable-name match.
@@ -177,28 +177,28 @@ sha256 = "d6f88de62e1d4e38ecb1077eb9724cd0eff29d2a08ca16a401e9b9e93f117cf9"
177
177
 
178
178
  [[packages]]
179
179
  name = "certifi"
180
- version = "2026.10.18"
180
+ version = "2026.10.19"
181
181
  marker = "\"docs\" in dependency_groups or \"pkg-meta\" in dependency_groups"
182
182
  requires-python = ">=3.7"
183
183
  index = "https://pypi.org/simple/"
184
184
 
185
185
  [packages.sdist]
186
- name = "certifi-2026.10.18.tar.gz"
187
- upload-time = 2026-10-18 16:21:07.655710+00:00
188
- url = "https://files.pythonhosted.org/packages/7e/eb/a2aa1ac3ea30dd3f30ca57f40232138b6b0040719316ecb85daf61167771/certifi-2026.10.18.tar.gz"
189
- size = 135227
186
+ name = "certifi-2026.10.19.tar.gz"
187
+ upload-time = 2026-10-20 02:24:16.604828+00:00
188
+ url = "https://files.pythonhosted.org/packages/a6/bd/1436c50cc46699de0230fbaacc1d1de7bfec413176099949e9d5112e88f2/certifi-2026.10.19.tar.gz"
189
+ size = 137598
190
190
 
191
191
  [packages.sdist.hashes]
192
- sha256 = "b9995d97b64d0431a5af837d8ca8cd6238104d1f319f04bd93ea43124d6c861e"
192
+ sha256 = "035c1e85572b141bf1c3a3eff0e33a8eb74917522f2559075ff8d2fea780a1ae"
193
193
 
194
194
  [[packages.wheels]]
195
- name = "certifi-2026.10.18-py3-none-any.whl"
196
- upload-time = 2026-10-18 16:21:06.276884+00:00
197
- url = "https://files.pythonhosted.org/packages/08/ba/95dd616042484f7c83a06974388b37b837732740ee70bc5dc715b5fcd55a/certifi-2026.10.18-py3-none-any.whl"
198
- size = 134093
195
+ name = "certifi-2026.10.19-py3-none-any.whl"
196
+ upload-time = 2026-10-20 02:24:15.072385+00:00
197
+ url = "https://files.pythonhosted.org/packages/c4/51/29046e48f693c54e5b7412216d447a1d8362c9653148d98c02cdf65fa733/certifi-2026.10.19-py3-none-any.whl"
198
+ size = 136464
199
199
 
200
200
  [packages.wheels.hashes]
201
- sha256 = "73191c47aaa79da394e8fee2dbc2ec827432cab56311122c9e47abf79e390f62"
201
+ sha256 = "42d35340cc5b9ba78e818ddbff0c5b1c2b779de448a340fd1b989f5fa8670e1b"
202
202
 
203
203
  [[packages]]
204
204
  name = "cffi"
@@ -1696,28 +1696,28 @@ sha256 = "0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137"
1696
1696
 
1697
1697
  [[packages]]
1698
1698
  name = "setuptools"
1699
- version = "84.0.0"
1699
+ version = "84.2.0"
1700
1700
  marker = "\"build\" in dependency_groups or \"test\" in dependency_groups"
1701
1701
  requires-python = ">=3.10"
1702
1702
  index = "https://pypi.org/simple/"
1703
1703
 
1704
1704
  [packages.sdist]
1705
- name = "setuptools-84.0.0.tar.gz"
1706
- upload-time = 2026-08-08 18:27:58.365696+00:00
1707
- url = "https://files.pythonhosted.org/packages/6d/44/f5da03a8ef95d369145c5bb53050e7877c9f3d312e128605fd9504829143/setuptools-84.0.0.tar.gz"
1708
- size = 1168449
1705
+ name = "setuptools-84.2.0.tar.gz"
1706
+ upload-time = 2026-10-19 20:38:03.407523+00:00
1707
+ url = "https://files.pythonhosted.org/packages/63/40/e2c41d00a4bfea5548c31420a74c6cf149cc0e7c36b45c4c82202ce867aa/setuptools-84.2.0.tar.gz"
1708
+ size = 1227656
1709
1709
 
1710
1710
  [packages.sdist.hashes]
1711
- sha256 = "f4695c21257f0d9b537ec2692c941d02ee143b7cc1276941349a546573b2ef73"
1711
+ sha256 = "6f445ca2ce864605f81e223f262b4c94ffcb9a4a63473bae0ed7be5aab0291da"
1712
1712
 
1713
1713
  [[packages.wheels]]
1714
- name = "setuptools-84.0.0-py3-none-any.whl"
1715
- upload-time = 2026-08-08 18:27:56.719708+00:00
1716
- url = "https://files.pythonhosted.org/packages/95/9c/c510029fc6ef33a6275cd2c5d3cecd6613dfd6aa401d57c54f1c18852ccf/setuptools-84.0.0-py3-none-any.whl"
1717
- size = 818216
1714
+ name = "setuptools-84.2.0-py3-none-any.whl"
1715
+ upload-time = 2026-10-19 20:38:01.629093+00:00
1716
+ url = "https://files.pythonhosted.org/packages/dd/a2/2e1af99d56c8145aa69496026c7e5fd7b6ec759b500c3ad697e2062832dc/setuptools-84.2.0-py3-none-any.whl"
1717
+ size = 875816
1718
1718
 
1719
1719
  [packages.wheels.hashes]
1720
- sha256 = "51a52592b3b99e102b609654876bd65f19f999935166d1352678931132b0c670"
1720
+ sha256 = "8cc107ac7a403105dc8d6477664171f36135fab26adf8b5e0edaebc313f39b21"
1721
1721
 
1722
1722
  [[packages]]
1723
1723
  name = "setuptools-scm"
@@ -1801,7 +1801,7 @@ sha256 = "fa30e3ba4809cb81ce1f3209f2fbe3e779fc445f0439bc147a0d7c4601743f21"
1801
1801
 
1802
1802
  [[packages]]
1803
1803
  name = "sphinx"
1804
- version = "9.1.0"
1804
+ version = "9.1.1"
1805
1805
  marker = "\"docs\" in dependency_groups"
1806
1806
  requires-python = ">=3.12"
1807
1807
  dependencies = [
@@ -1825,22 +1825,22 @@ dependencies = [
1825
1825
  index = "https://pypi.org/simple/"
1826
1826
 
1827
1827
  [packages.sdist]
1828
- name = "sphinx-9.1.0.tar.gz"
1829
- upload-time = 2025-12-31 15:09:27.646696+00:00
1830
- url = "https://files.pythonhosted.org/packages/cd/bd/f08eb0f4eed5c83f1ba2a3bd18f7745a2b1525fad70660a1c00224ec468a/sphinx-9.1.0.tar.gz"
1831
- size = 8718324
1828
+ name = "sphinx-9.1.1.tar.gz"
1829
+ upload-time = 2026-10-20 00:41:13.960930+00:00
1830
+ url = "https://files.pythonhosted.org/packages/fc/73/567727fc8c8d85bc3adc88a246e12937cfda8d565cf1d80e85bceaa61fe5/sphinx-9.1.1.tar.gz"
1831
+ size = 8725638
1832
1832
 
1833
1833
  [packages.sdist.hashes]
1834
- sha256 = "7741722357dd75f8190766926071fed3bdc211c74dd2d7d4df5404da95930ddb"
1834
+ sha256 = "48b627f02908f22c601b3ba9c7b17265b4f315dd05c8bc64cd4da41183f44fbc"
1835
1835
 
1836
1836
  [[packages.wheels]]
1837
- name = "sphinx-9.1.0-py3-none-any.whl"
1838
- upload-time = 2025-12-31 15:09:25.561651+00:00
1839
- url = "https://files.pythonhosted.org/packages/73/f7/b1884cb3188ab181fc81fa00c266699dab600f927a964df02ec3d5d1916a/sphinx-9.1.0-py3-none-any.whl"
1840
- size = 3921742
1837
+ name = "sphinx-9.1.1-py3-none-any.whl"
1838
+ upload-time = 2026-10-20 00:41:11.288695+00:00
1839
+ url = "https://files.pythonhosted.org/packages/47/18/3c66ea76da7de47e716b181c35bdbfafbd5e9af0bb247b14578e9de348e9/sphinx-9.1.1-py3-none-any.whl"
1840
+ size = 3923559
1841
1841
 
1842
1842
  [packages.wheels.hashes]
1843
- sha256 = "c84fdd4e782504495fe4f2c0b3413d6c2bf388589bb352d439b2a3bb99991978"
1843
+ sha256 = "f8b60013ce25017be41a509e5c2d265bc1918410061315c36b809c7f335646c0"
1844
1844
 
1845
1845
  [[packages]]
1846
1846
  name = "sphinx-autodoc-typehints"
@@ -2385,28 +2385,28 @@ sha256 = "0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3"
2385
2385
 
2386
2386
  [[packages]]
2387
2387
  name = "uv"
2388
- version = "0.13.1"
2388
+ version = "0.13.3"
2389
2389
  marker = "\"pkg-meta\" in dependency_groups"
2390
2390
  requires-python = ">=3.8"
2391
2391
  index = "https://pypi.org/simple/"
2392
2392
 
2393
2393
  [packages.sdist]
2394
- name = "uv-0.13.1.tar.gz"
2395
- upload-time = 2026-10-14 05:13:35.353145+00:00
2396
- url = "https://files.pythonhosted.org/packages/ef/10/81f499de381ac81e09961e1c19255c5cf49563ac418464def4190b6c7400/uv-0.13.1.tar.gz"
2397
- size = 7434239
2394
+ name = "uv-0.13.3.tar.gz"
2395
+ upload-time = 2026-10-20 01:13:40.241842+00:00
2396
+ url = "https://files.pythonhosted.org/packages/b2/0d/0cf59876b94f537055fdcc6a32126fd9abb841620b6589ae3fcbf6e21f69/uv-0.13.3.tar.gz"
2397
+ size = 7477898
2398
2398
 
2399
2399
  [packages.sdist.hashes]
2400
- sha256 = "6df50a86b09be66a413f8f1b16258d585d4dd1cbff591077ae1e6f65c26de2eb"
2400
+ sha256 = "fe8587cb414b324753eb2c1b2a54d2f93b2aed7e9cf02e9c1efa3776547a3aae"
2401
2401
 
2402
2402
  [[packages.wheels]]
2403
- name = "uv-0.13.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
2404
- upload-time = 2026-10-14 05:13:13.069021+00:00
2405
- url = "https://files.pythonhosted.org/packages/14/0b/6602a613533602e7a083e908c4375f9b0e78a94ba2e21c29b21c41a0a611/uv-0.13.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
2406
- size = 17279385
2403
+ name = "uv-0.13.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
2404
+ upload-time = 2026-10-20 01:13:11.825804+00:00
2405
+ url = "https://files.pythonhosted.org/packages/7e/fa/45e1751beda39226d5472e6bb068747115a06f19c2559a8810aac9b881b7/uv-0.13.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl"
2406
+ size = 17301030
2407
2407
 
2408
2408
  [packages.wheels.hashes]
2409
- sha256 = "696dcf6d807d85da978f4db8472da81dccc1254b18b52cbd1367c4d923c421e0"
2409
+ sha256 = "8d9ba65db55f3701908b09394cb7d3248be28496aab6bd9a96e8e870261ad372"
2410
2410
 
2411
2411
  [[packages]]
2412
2412
  name = "vcs-versioning"
@@ -2522,7 +2522,7 @@ sha256 = "3fa599046443d4ca830d06e3d180cd0a675d5871af0a68daa5623318bb4d17e3"
2522
2522
 
2523
2523
  [tool.nab]
2524
2524
  nab-version = "0.0.22"
2525
- created-at = 2026-10-26 20:07:19.949900+00:00
2525
+ created-at = 2026-10-27 13:46:33.700020+00:00
2526
2526
  command-line = [
2527
2527
  "nab",
2528
2528
  "lock",
@@ -2530,9 +2530,6 @@ command-line = [
2530
2530
  "--all-extras",
2531
2531
  "--no-cache",
2532
2532
  "--upgrade",
2533
- "pyproject.toml",
2534
- "--output",
2535
- "pylock.toml",
2536
2533
  ]
2537
2534
  input-path = "pyproject.toml"
2538
2535
  mode = "universal"
@@ -158,7 +158,8 @@ def _check_exe(path: str, tested_exes: set[str]) -> str | None:
158
158
  if exe_id in tested_exes:
159
159
  return None
160
160
  tested_exes.add(exe_id)
161
- return str(Path(path).absolute())
161
+ # unlike Path.absolute(), abspath collapses "..", which PythonInfo._satisfies_path relies on
162
+ return os.path.abspath(path)
162
163
 
163
164
 
164
165
  def _is_new_exe(exe_raw: str, tested_exes: set[str]) -> bool:
@@ -295,7 +295,8 @@ class PythonInfo: # ruff:ignore[too-many-public-methods]
295
295
  return True
296
296
  version_info = self.version_info
297
297
  for specifier in spec.version_specifier:
298
- assert specifier.version is not None # ruff:ignore[assert]
298
+ if specifier.version is None: # a hand-built spec can carry an unparsable version, which matches nothing
299
+ return False
299
300
  numeric_version = specifier.version_str
300
301
  for prefix in ("rc", "b", "a"):
301
302
  if prefix in numeric_version:
@@ -104,6 +104,11 @@ def _parse_specifier(string_spec: str) -> PythonSpec | None:
104
104
  version_specifier = SpecifierSet.from_string(spec_text)
105
105
  except InvalidSpecifier: # pragma: no cover
106
106
  return None
107
+ # the set never raises: it keeps an unparsable version as None and drops items without an operator, so fall back
108
+ # to a literal path, like any other unrecognized spec, unless every item parsed into a usable version
109
+ items = [item for item in spec_text.split(",") if item.strip()]
110
+ if len(items) != len(version_specifier.specifiers) or any(spec.version is None for spec in version_specifier):
111
+ return None
107
112
  if impl in {"py", "python"}:
108
113
  impl = None
109
114
  if impl == "graalvm":
@@ -227,12 +227,10 @@ class SimpleSpecifier:
227
227
  return False
228
228
  if candidate < self.version:
229
229
  return False
230
- if len(self.version.release) >= 2: # ruff:ignore[magic-value-comparison] # pragma: no branch # SimpleVersion always has 3-part release
231
- upper_parts = list(self.version.release[:-1])
232
- upper_parts[-1] += 1
233
- upper = SimpleVersion.from_string(".".join(str(p) for p in upper_parts))
234
- return candidate < upper
235
- return True # pragma: no cover
230
+ # ~=X.Y is >=X.Y, ==X.*: compare all but the last part the spec wrote (release is padded to three).
231
+ # A bare ~=X still compares its one part, so it stays ==X.*.
232
+ prefix = max(self.version_str.count("."), 1)
233
+ return candidate.release[:prefix] == self.version.release[:prefix]
236
234
 
237
235
  def __eq__(self, other: object) -> bool:
238
236
  if not isinstance(other, SimpleSpecifier):
@@ -93,6 +93,25 @@ def test_relative_path(session_cache: DiskCache, monkeypatch: pytest.MonkeyPatch
93
93
  assert result is not None
94
94
 
95
95
 
96
+ @pytest.mark.parametrize(
97
+ "sep",
98
+ [
99
+ pytest.param("/", id="slash"),
100
+ pytest.param("\\", id="backslash", marks=pytest.mark.skipif(not IS_WIN, reason="Windows separator")),
101
+ ],
102
+ )
103
+ def test_relative_path_with_parent_reference(
104
+ session_cache: DiskCache, monkeypatch: pytest.MonkeyPatch, sep: str
105
+ ) -> None:
106
+ sys_executable = Path(PythonInfo.current_system(session_cache).system_executable)
107
+ monkeypatch.chdir(str(sys_executable.parent))
108
+ relative = sep.join((os.pardir, sys_executable.parent.name, sys_executable.name))
109
+ result = get_interpreter(relative, [], session_cache)
110
+ assert result is not None
111
+ assert os.pardir not in Path(result.executable).parts
112
+ assert Path(result.executable).samefile(sys_executable)
113
+
114
+
96
115
  def test_discovery_fallback_fail(session_cache: DiskCache, caplog: pytest.LogCaptureFixture) -> None:
97
116
  caplog.set_level(logging.DEBUG)
98
117
  result = get_interpreter(["magic-one", "magic-two"], cache=session_cache)
@@ -100,7 +119,7 @@ def test_discovery_fallback_fail(session_cache: DiskCache, caplog: pytest.LogCap
100
119
  assert "accepted" not in caplog.text
101
120
 
102
121
 
103
- @pytest.mark.parametrize("missing", ["magic-one", "python."])
122
+ @pytest.mark.parametrize("missing", ["magic-one", "python.", ">=3.12 <4"])
104
123
  def test_discovery_fallback_ok(missing: str, session_cache: DiskCache, caplog: pytest.LogCaptureFixture) -> None:
105
124
  caplog.set_level(logging.DEBUG)
106
125
  result = get_interpreter([missing, sys.executable], cache=session_cache)
@@ -64,6 +64,20 @@ def test_iter_interpreters_with_abs_path_yields_one(session_cache: DiskCache) ->
64
64
  assert results[0].executable == sys.executable
65
65
 
66
66
 
67
+ @pytest.mark.usefixtures("uv_dir")
68
+ def test_iter_interpreters_relative_path_with_parent_reference(
69
+ session_cache: DiskCache, monkeypatch: pytest.MonkeyPatch
70
+ ) -> None:
71
+ sys_executable = Path(PythonInfo.current_system(session_cache).system_executable)
72
+ monkeypatch.chdir(str(sys_executable.parent))
73
+ monkeypatch.setenv("PATH", "")
74
+ relative = str(Path(os.pardir) / sys_executable.parent.name / sys_executable.name)
75
+ results = list(iter_interpreters(relative, cache=session_cache))
76
+ assert len(results) == 1
77
+ assert os.pardir not in Path(results[0].executable).parts
78
+ assert Path(results[0].executable).samefile(sys_executable)
79
+
80
+
67
81
  def test_iter_interpreters_sequence_dedups_across_keys(session_cache: DiskCache) -> None:
68
82
  results = list(iter_interpreters([sys.executable, sys.executable], cache=session_cache))
69
83
  assert len(results) == 1
@@ -297,6 +311,19 @@ def test_iter_interpreters_uv_layout(
297
311
  ["cpython-3.12.13-macos-aarch64-none/bin/python"],
298
312
  id="specifier-rules-out-the-rest",
299
313
  ),
314
+ pytest.param(
315
+ (
316
+ "cpython-3.9.25-macos-aarch64-none/bin/python",
317
+ "cpython-3.10.19-macos-aarch64-none/bin/python",
318
+ "cpython-3.13.7-macos-aarch64-none/bin/python",
319
+ ),
320
+ "~=3.10",
321
+ [
322
+ "cpython-3.13.7-macos-aarch64-none/bin/python",
323
+ "cpython-3.10.19-macos-aarch64-none/bin/python",
324
+ ],
325
+ id="compatible-release-keeps-later-minors",
326
+ ),
300
327
  pytest.param(
301
328
  (
302
329
  "cpython-3.14.6-macos-aarch64-none/bin/python",
@@ -10,7 +10,7 @@ from unittest.mock import MagicMock
10
10
 
11
11
  import pytest
12
12
 
13
- from python_discovery import DiskCache, PythonInfo, PythonSpec
13
+ from python_discovery import DiskCache, PythonInfo, PythonSpec, SimpleSpecifierSet
14
14
  from python_discovery._py_info import VersionInfo
15
15
 
16
16
  if TYPE_CHECKING:
@@ -195,6 +195,12 @@ def test_satisfies_version_specifier_fails() -> None:
195
195
  assert CURRENT.satisfies(spec, impl_must_match=False) is False
196
196
 
197
197
 
198
+ def test_satisfies_version_specifier_unparsable_version() -> None:
199
+ specifier = SimpleSpecifierSet.from_string(">=3.x")
200
+ spec = PythonSpec(">=3.x", None, None, None, None, None, None, version_specifier=specifier)
201
+ assert CURRENT.satisfies(spec, impl_must_match=False) is False
202
+
203
+
198
204
  @pytest.mark.parametrize(
199
205
  ("version_info", "spec_str", "expected"),
200
206
  [
@@ -211,6 +217,9 @@ def test_satisfies_version_specifier_fails() -> None:
211
217
  pytest.param(VersionInfo(3, 15, 0, "final", 0), "<3.15.0a6", False, id="final_not_less_than_prerelease"),
212
218
  pytest.param(VersionInfo(3, 15, 0, "final", 0), ">=3.15", True, id="final_match_major_minor"),
213
219
  pytest.param(VersionInfo(3, 15, 1, "alpha", 1), ">=3.15.0", True, id="later_micro_prerelease_match"),
220
+ pytest.param(VersionInfo(3, 13, 7, "final", 0), "~=3.10", True, id="compatible_release_later_minor"),
221
+ pytest.param(VersionInfo(4, 0, 0, "final", 0), "~=3.10", False, id="compatible_release_next_major"),
222
+ pytest.param(VersionInfo(3, 13, 0, "alpha", 1), "~=3.12.0", False, id="compatible_release_next_minor_alpha"),
214
223
  ],
215
224
  )
216
225
  def test_satisfies_version_specifier_prerelease(version_info: VersionInfo, spec_str: str, expected: bool) -> None:
@@ -13,7 +13,27 @@ if TYPE_CHECKING:
13
13
  from pathlib import Path
14
14
 
15
15
 
16
- @pytest.mark.parametrize("text", ["python2.3.4.5", ".", "..", "...", "python.", "cpython..", "pypy..."])
16
+ @pytest.mark.parametrize(
17
+ "text",
18
+ [
19
+ "python2.3.4.5",
20
+ ".",
21
+ "..",
22
+ "...",
23
+ "python.",
24
+ "cpython..",
25
+ "pypy...",
26
+ ">=3.x",
27
+ ">=3.12 <4",
28
+ ">=3.10.post1",
29
+ "cpython>=v3.10",
30
+ ">=3.12,<4.x",
31
+ ">=3.x,<4",
32
+ "<,4",
33
+ ">=3.12,foo",
34
+ ">=3.12, 4",
35
+ ],
36
+ )
17
37
  def test_bad_py_spec(text: str) -> None:
18
38
  spec = PythonSpec.from_string_spec(text)
19
39
  assert text in repr(spec)
@@ -149,6 +149,12 @@ def test_specifier_parse_wildcard() -> None:
149
149
  pytest.param("~=3.12.0", "3.13.0", False, id="compatible-next-minor"),
150
150
  pytest.param("~=3.12.0", "3.11.0", False, id="compatible-below"),
151
151
  pytest.param("~=3.12.0", "3.11.9", False, id="compatible-just-below"),
152
+ pytest.param("~=3.12.0", "3.13.0a1", False, id="compatible-next-minor-prerelease"),
153
+ pytest.param("~=3.10", "3.13.7", True, id="compatible-two-part-next-minor"),
154
+ pytest.param("~=3.10", "3.9.25", False, id="compatible-two-part-below"),
155
+ pytest.param("~=3.10", "4.0.0", False, id="compatible-two-part-next-major"),
156
+ pytest.param("~=3.10", "4.0.0a1", False, id="compatible-two-part-next-major-prerelease"),
157
+ pytest.param("~=3.13rc1", "3.14.0", True, id="compatible-two-part-prerelease-next-minor"),
152
158
  pytest.param(">=3.12", "not_a_version", False, id="invalid-version"),
153
159
  ],
154
160
  )
@@ -297,3 +303,5 @@ def test_specifier_compatible_release_major_only() -> None:
297
303
  spec = SimpleSpecifier.from_string("~=3")
298
304
  assert spec.contains("3.0.0") is True
299
305
  assert spec.contains("3.0.5") is True
306
+ assert spec.contains("3.13.7") is True
307
+ assert spec.contains("4.0.0") is False
@@ -1,33 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: "github-actions"
4
- directory: "/"
5
- labels:
6
- - dependencies
7
- - github_actions
8
- - skip news
9
- schedule:
10
- interval: "weekly"
11
- day: "tuesday"
12
- groups:
13
- github-actions:
14
- patterns:
15
- - "*"
16
- cooldown:
17
- default-days: 7
18
- - package-ecosystem: "pre-commit"
19
- directory: "/"
20
- labels:
21
- - dependencies
22
- - skip news
23
- schedule:
24
- interval: "weekly"
25
- day: "tuesday"
26
- groups:
27
- formatting-plugins:
28
- patterns:
29
- - "mdformat-gfm"
30
- - "mdformat-ruff"
31
- - "sphinx"
32
- cooldown:
33
- default-days: 7