Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ jobs:
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- type-3.8
- type-3.14
- type-3.9
- type-3.15
- dev
- pkg_meta
steps:
Expand All @@ -40,13 +39,14 @@ jobs:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.15"
enable-cache: false
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install tox
run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv
run: uv tool install --python-preference only-managed --python 3.15 tox --with tox-uv
- name: Install Python
if: startsWith(matrix.env, '3.') && matrix.env != '3.14'
if: startsWith(matrix.env, '3.') && matrix.env != '3.15'
run: uv python install --python-preference only-managed ${{ matrix.env }}
- name: Setup test suite
run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.env }}
Expand All @@ -65,6 +65,7 @@ jobs:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.15"
enable-cache: false
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/prepare-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.15"
enable-cache: true
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -79,7 +80,7 @@ jobs:
echo "Next version: $next"
echo "version=$next" >> $GITHUB_OUTPUT
- name: Install tox
run: uv tool install --python-preference only-managed --python 3.14 tox@latest --with tox-uv
run: uv tool install --python-preference only-managed --python 3.15 tox@latest --with tox-uv
- name: Run release process
run: tox run -e release -- ${STEPS_VERSION_OUTPUTS_VERSION}
env:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ jobs:
- name: Install the latest version of uv
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
python-version: "3.15"
enable-cache: false
cache-dependency-glob: "pyproject.toml"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build package
run: uv build --python 3.14 --python-preference only-managed --sdist --wheel . --out-dir dist
run: uv build --python 3.15 --python-preference only-managed --sdist --wheel . --out-dir dist
- name: Store the distribution packages
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
default_language_version:
python: python3.15
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
Expand All @@ -13,7 +15,6 @@ repos:
rev: v2.4.3
hooks:
- id: codespell
additional_dependencies: ["tomli>=2.4.1"]
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "v2.30.1"
hooks:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ build:
tools: {}
commands:
- curl -LsSf https://astral.sh/uv/install.sh | sh
- ~/.local/bin/uv tool install tox --with tox-uv -p 3.14 --managed-python
- ~/.local/bin/uv tool install tox --with tox-uv -p 3.15 --managed-python
- ~/.local/bin/tox run -e docs -- "$READTHEDOCS_OUTPUT/html"
8 changes: 4 additions & 4 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2
build:
os: ubuntu-22.04
tools:
python: "3.12"
tools: {}
commands:
- pip install tox
- tox r -e docs -- "${READTHEDOCS_OUTPUT}"/html
- curl -LsSf https://astral.sh/uv/install.sh | sh
- ~/.local/bin/uv tool install tox --with tox-uv -p 3.15 --managed-python
- ~/.local/bin/tox run -e docs -- "${READTHEDOCS_OUTPUT}"/html
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ the right one for you.
Give it a requirement like `python3.12` or `>=3.11,<3.13`, and it searches all known locations, verifies each candidate,
and returns detailed metadata about the match. Results are cached to disk so repeated lookups are fast.

The library runs on Python 3.8+ and discovers interpreters as old as Python 3.6; anything older is skipped with a
The library runs on Python 3.9+ and discovers interpreters as old as Python 3.6; anything older is skipped with a
warning naming the version it found.

## Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/explanation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ when encountering problematic interpreters.
Supported Python versions
-------------------------

Two floors apply: python-discovery itself runs on Python 3.8+ (``requires-python``), while discovery
Two floors apply: python-discovery itself runs on Python 3.9+ (``requires-python``), while discovery
reaches down to Python 3.6 - old enough to cover RHEL 8's system Python.

python-discovery skips candidates below 3.6 with one warning naming the executable, the version
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ license.file = "LICENSE"
maintainers = [
{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" },
]
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
Expand All @@ -28,7 +28,6 @@ classifiers = [
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
Expand Down Expand Up @@ -59,6 +58,7 @@ test = [
"pytest>=8.3.5",
"pytest-mock>=3.14.1",
"setuptools>=75.3.4",
"typing-extensions>=4.12",
"vermin>=1.8",
]
docs = [
Expand All @@ -81,6 +81,7 @@ release = [
version.source = "vcs"

[tool.ruff]
target-version = "py39"
line-length = 120
format.preview = true
format.docstring-code-line-length = 100
Expand Down
2 changes: 1 addition & 1 deletion tests/test_py_info_extra.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def test_satisfies_path_not_abs_basename_match() -> None:
# stem drops everything from the first dot, so python3.15t arrives as python3 and stops naming a free-threaded
# build; only the Windows .exe belongs off the end.
name = Path(info.original_executable).name
basename = name[: -len(".exe")] if name.endswith(".exe") else name
basename = name.removesuffix(".exe")
spec = PythonSpec.from_string_spec(basename)
assert info.satisfies(spec, impl_must_match=False) is True

Expand Down
82 changes: 43 additions & 39 deletions tox.toml
Original file line number Diff line number Diff line change
@@ -1,52 +1,49 @@
requires = ["tox>=4.38", "tox-uv>=1.29"]
env_list = ["fix", "3.15", "3.15t", "3.14", "3.13", "3.12", "3.11", "3.10", "3.9", "3.8", "type-3.8", "type-3.14", "docs", "pkg_meta"]
requires = [ "tox>=4.64.7", "tox-uv>=1.29" ]
env_list = [ "3.15", "type-3.15", "3.14", "3.13", "3.12", "3.11", "3.10", "3.9", "type-3.9", "3.15t", "docs", "fix", "pkg_meta" ]
skip_missing_interpreters = true

[env_run_base]
description = "run the tests with pytest"
default_base_python = [ "3.15" ]
package = "wheel"
wheel_build_env = ".pkg"
dependency_groups = ["test"]
pass_env = ["DIFF_AGAINST", "PYTEST_*"]
dependency_groups = [ "test" ]
pass_env = [ "DIFF_AGAINST", "PYTEST_*" ]
set_env.COVERAGE_FILE = "{work_dir}{/}.coverage.{env_name}"
commands = [
["coverage", "erase"],
[ "coverage", "erase" ],
[
"coverage",
"run",
"-m",
"pytest",
{ replace = "posargs", extend = true, default = [
{ replace = "posargs", default = [
"--junitxml",
"{work_dir}{/}junit.{env_name}.xml",
"tests",
] },
], extend = true },
],
["coverage", "combine"],
["coverage", "report"],
["coverage", "html", "-d", "{env_tmp_dir}{/}htmlcov"],
[ "coverage", "combine" ],
[ "coverage", "report" ],
[ "coverage", "html", "-d", "{env_tmp_dir}{/}htmlcov" ],
]

[env.fix]
description = "run static analysis and style check using flake8"
skip_install = true
deps = ["pre-commit-uv>=4.2.1"]
pass_env = ["HOMEPATH", "PROGRAMDATA"]
commands = [["pre-commit", "run", "--all-files", "--show-diff-on-failure"]]
[env_pkg_base]
default_base_python = [ "3.15" ]

[env."type-3.8"]
description = "run type check on code base (3.8)"
deps = ["gitpython>=3.2", "packaging>=26.2", "ty==0.0.84"]
commands = [["ty", "check", "--output-format", "concise", "--error-on-warning", "--python-version", "3.8", "."]]
[env."type-3.15"]
description = "run type check on code base (3.15)"
deps = [ "gitpython>=3.2", "packaging>=26.2", "ty==0.0.84" ]
commands = [ [ "ty", "check", "--output-format", "concise", "--error-on-warning", "--python-version", "3.15", "." ] ]

[env."type-3.14"]
description = "run type check on code base (3.14)"
deps = ["gitpython>=3.2", "packaging>=26.2", "ty==0.0.84"]
commands = [["ty", "check", "--output-format", "concise", "--error-on-warning", "--python-version", "3.14", "."]]
[env."type-3.9"]
description = "run type check on code base (3.9)"
deps = [ "gitpython>=3.2", "packaging>=26.2", "ty==0.0.84" ]
commands = [ [ "ty", "check", "--output-format", "concise", "--error-on-warning", "--python-version", "3.9", "." ] ]

[env.docs]
description = "build documentation"
dependency_groups = ["docs"]
dependency_groups = [ "docs" ]
commands = [
[
"sphinx-build",
Expand All @@ -57,29 +54,36 @@ commands = [
"-b",
"html",
"-W",
{ replace = "posargs", extend = true, default = ["{work_dir}{/}docs_out"] },
{ replace = "posargs", default = [ "{work_dir}{/}docs_out" ], extend = true },
],
]

[env.fix]
description = "run static analysis and style check using flake8"
skip_install = true
deps = [ "pre-commit-uv>=4.2.1" ]
pass_env = [ "HOMEPATH", "PROGRAMDATA" ]
commands = [ [ "pre-commit", "run", "--all-files", "--show-diff-on-failure" ] ]

[env.pkg_meta]
description = "check that the long description is valid"
skip_install = true
deps = ["check-wheel-contents>=0.6.3", "twine>=6.2", "uv>=0.12.22"]
deps = [ "check-wheel-contents>=0.6.3", "twine>=6.2", "uv>=0.12.22" ]
commands = [
["uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "."],
["twine", "check", "{env_tmp_dir}{/}*"],
["check-wheel-contents", "--no-config", "{env_tmp_dir}"],
[ "uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "." ],
[ "twine", "check", "{env_tmp_dir}{/}*" ],
[ "check-wheel-contents", "--no-config", "{env_tmp_dir}" ],
]

[env.release]
description = "do a release, required posargs of the version number"
skip_install = true
dependency_groups = ["release"]
pass_env = ["GH_TOKEN"]
commands = [["python", "{tox_root}/tasks/release.py", "--version", "{posargs}"]]

[env.dev]
description = "generate a DEV environment"
package = "editable"
dependency_groups = ["test"]
commands = [["uv", "pip", "tree"], ["python", "-c", "import sys; print(sys.executable)"]]
dependency_groups = [ "test" ]
commands = [ [ "uv", "pip", "tree" ], [ "python", "-c", "import sys; print(sys.executable)" ] ]

[env.release]
description = "do a release, required posargs of the version number"
skip_install = true
dependency_groups = [ "release" ]
pass_env = [ "GH_TOKEN" ]
commands = [ [ "python", "{tox_root}/tasks/release.py", "--version", "{posargs}" ] ]
Loading