Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
70c22ca
🔧 build(lint): adopt simplint 0.8.0
gaborbernat Nov 7, 2026
efce059
♻️ refactor: apply simplint's autofixes
gaborbernat Nov 7, 2026
a019069
🐛 fix(specifier): drop the repeated frozen
gaborbernat Nov 7, 2026
d26c025
♻️ refactor(discovery): drop reST from a comment
gaborbernat Nov 7, 2026
9ae59bd
🔧 build(lint): give shfmt and shellcheck prek tiers
gaborbernat Nov 7, 2026
b5ed2f9
📝 docs: explain existing lint suppressions
gaborbernat Nov 7, 2026
4ed3072
📝 docs: describe the empty reST fields
gaborbernat Nov 7, 2026
f959bba
♻️ refactor(test): autospec mocked callables
gaborbernat Nov 7, 2026
5f68d6b
♻️ refactor: annotate module constants Final
gaborbernat Nov 7, 2026
5e0d3e1
♻️ refactor(test): give parametrize rows ids
gaborbernat Nov 7, 2026
f5cfb17
♻️ refactor: clear simplint's source findings
gaborbernat Nov 7, 2026
cfa5be3
♻️ refactor(test): clear simplint's test findings
gaborbernat Nov 7, 2026
fdef0c3
♻️ refactor: keep package __init__ to re-exports
gaborbernat Nov 7, 2026
41eb9f0
♻️ refactor(test): give mocks a spec
gaborbernat Nov 7, 2026
3f411a3
♻️ refactor: name tuples returned by private helpers
gaborbernat Nov 7, 2026
3c6683b
♻️ refactor(test): hoist platform names out of test bodies
gaborbernat Nov 7, 2026
5d98179
♻️ refactor(test): drop host branches from test bodies
gaborbernat Nov 7, 2026
b45c3e8
♻️ refactor: order definitions and drop test branches
gaborbernat Nov 7, 2026
c77b10f
♻️ refactor(windows): name the registry result and drop single-use he…
gaborbernat Nov 7, 2026
d9c9e3e
♻️ refactor(test): clear the remaining simplint findings
gaborbernat Nov 7, 2026
7d6ea11
🐛 fix(windows): restore stop_query_reader name
gaborbernat Nov 8, 2026
fb5edb1
🧪 test: build mocks through mocker with specs
gaborbernat Nov 8, 2026
c7f99c3
🧪 test: give winreg fixture and fakes precise types
gaborbernat Nov 8, 2026
db6e90a
♻️ refactor(test): inline the registry fake's helpers
gaborbernat Nov 8, 2026
c8b469e
🧪 test: drop branches and loops from test bodies
gaborbernat Nov 8, 2026
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
27 changes: 26 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# prek runs lower priorities first and equal ones concurrently, so hooks sharing a priority never write the same
# file; pre-commit ignores the key and runs hooks in file order.
ci:
autoupdate_schedule: quarterly
default_language_version:
Expand All @@ -7,34 +9,51 @@ repos:
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
hooks:
- id: end-of-file-fixer
priority: 1
- id: trailing-whitespace
priority: 2
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: a76b92851fc9eede9f9bc4073eb55202f34eb0df # frozen: 0.39.0
hooks:
- id: check-github-workflows
priority: 8
args: ["--verbose"]
- repo: https://github.com/codespell-project/codespell
rev: 57b21406f092110c18776e39b0bda50d37c945c8 # frozen: v2.4.3
hooks:
- id: codespell
priority: 8
- repo: https://github.com/tox-dev/pyproject-fmt
rev: "50e0f3aee9dc5747a5f173f79a7417403c18dda6" # frozen: v2.30.3
hooks:
- id: pyproject-fmt
priority: 3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "25bcf95026b96e2dd3c0aec3090c3d6ef6ca2e6c" # frozen: v0.17.3
hooks:
- id: ruff-format
- id: ruff
priority: 5
args: ["--fix", "--unsafe-fixes", "--exit-non-zero-on-fix"]
- repo: https://github.com/gaborbernat/simplint-pre-commit
rev: "f15525433ac9797aa1580f46fdadfe60dd77923c" # frozen: v0.8.0
hooks:
- id: simplint
priority: 6
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "25bcf95026b96e2dd3c0aec3090c3d6ef6ca2e6c" # frozen: v0.17.3
hooks:
- id: ruff-format
priority: 7
- repo: https://github.com/google/yamlfmt
rev: "21ca5323a9c87ee37a434e0ca908efc0a89daa07" # frozen: v0.21.0
hooks:
- id: yamlfmt
priority: 3
- repo: https://github.com/executablebooks/mdformat
rev: 82912cdaea4fb830f751504486a7879c70526547 # frozen: 1.0.0
hooks:
- id: mdformat
priority: 3
args: ["--wrap", "120"]
additional_dependencies:
- mdformat-gfm==1.0.0
Expand All @@ -43,15 +62,18 @@ repos:
rev: 479be5958357ba5ab65ce47172117348516860e9 # frozen: v3.14.1-1
hooks:
- id: shfmt
priority: 3
args: ["-i", "2"]
- repo: https://github.com/shellcheck-py/shellcheck-py
rev: 745eface02aef23e168a8afb6b5737818efbea95 # frozen: v0.11.0.1
hooks:
- id: shellcheck
priority: 8
- repo: https://github.com/LilSpazJoekp/docstrfmt
rev: c1813841673cdcd6cf602dde1edb78a5d5e45235 # frozen: v2.2.1
hooks:
- id: docstrfmt
priority: 3
files: |
(?x)
^docs/changelog[.]rst$ # Only the generated release history.
Expand All @@ -62,7 +84,10 @@ repos:
rev: c92afdf2c6ca336aaa8f39e2bd8d48f62dbd8e1f # frozen: v1.31.1
hooks:
- id: zizmor
priority: 8
- repo: meta
hooks:
- id: check-hooks-apply
priority: 8
- id: check-useless-excludes
priority: 8
27 changes: 14 additions & 13 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
import os
from datetime import datetime, timezone
from pathlib import Path
from typing import Final

from python_discovery import __version__

company = "tox-dev"
company: Final[str] = "tox-dev"
name = "python-discovery"
repository = f"https://github.com/{company}/{name}"
repository: Final[str] = f"https://github.com/{company}/{name}"
version = ".".join(__version__.split(".")[:2])
release = __version__
copyright = f"2026-{datetime.now(tz=timezone.utc).year}, {company}" # ruff:ignore[builtin-variable-shadowing]
copyright: Final[str] = f"2026-{datetime.now(tz=timezone.utc).year}, {company}" # ruff:ignore[builtin-variable-shadowing] Sphinx reads the name `copyright`

extensions = [
"sphinx_llm.txt",
Expand All @@ -26,10 +27,10 @@
"sphinxcontrib.towncrier.ext",
]

towncrier_draft_autoversion_mode = "draft"
towncrier_draft_include_empty = True
towncrier_draft_autoversion_mode: Final[str] = "draft"
towncrier_draft_include_empty: Final[bool] = True
towncrier_draft_working_directory = Path(__file__).parent.parent
autosectionlabel_maxdepth = 2
autosectionlabel_maxdepth: Final[int] = 2

extlinks = {
"issue": (f"{repository}/issues/%s", "#%s"),
Expand All @@ -43,19 +44,19 @@
}

templates_path = []
source_suffix = ".rst"
source_suffix: Final[str] = ".rst"
exclude_patterns = ["_build", "changelog/*"]

main_doc = "index"
pygments_style = "default"
always_document_param_types = True
main_doc: Final[str] = "index"
pygments_style: Final[str] = "default"
always_document_param_types: Final[bool] = True
project = name

html_theme = "furo"
html_theme: Final[str] = "furo"
html_title = project
html_last_updated_fmt = datetime.now(tz=timezone.utc).isoformat()
pygments_dark_style = "monokai"
html_show_sourcelink = False
pygments_dark_style: Final[str] = "monokai"
html_show_sourcelink: Final[bool] = False
html_static_path = ["_static"]
html_theme_options = {
"light_logo": "logo.svg",
Expand Down
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,12 @@ lint.ignore = [
"missing-trailing-comma", # Conflict with formatter
"multi-line-summary-first-line", # `multi-line-summary-first-line` and `multi-line-summary-second-line` are incompatible
"single-line-implicit-string-concatenation", # Conflict with formatter
"undocumented-magic-method", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-class", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-function", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-init", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-method", # undocumented-public-api (simplint SMP903) covers the public API instead
"undocumented-public-nested-class", # undocumented-public-api (simplint SMP903) covers the public API instead
]
lint.per-file-ignores."docs/**/*.py" = [
"implicit-namespace-package", # no __init__.py in docs directory
Expand Down Expand Up @@ -274,3 +280,6 @@ matrix.platforms = [ "linux_x86_64" ]
# release-creator 4.4.0 needs a seven-day cutoff exception.
# expires 2026-11-09
packages.release-creator.uploaded-prior-to = 2026-11-02T21:45:00Z

[tool.simplint]
docstring-style = "rst"
5 changes: 1 addition & 4 deletions src/python_discovery/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

from __future__ import annotations

from importlib.metadata import version

from ._about import __version__
from ._cache import ContentStore, DiskCache, PyInfoCache
from ._discovery import get_interpreter, iter_interpreters
from ._py_info import KNOWN_ARCHITECTURES, MarkerEnvironment, PythonInfo, normalize_isa
from ._py_spec import KNOWN_IMPLEMENTATIONS, PythonSpec
from ._specifier import SimpleSpecifier, SimpleSpecifierSet, SimpleVersion

__version__ = version("python-discovery")

__all__ = [
"KNOWN_ARCHITECTURES",
"KNOWN_IMPLEMENTATIONS",
Expand Down
8 changes: 8 additions & 0 deletions src/python_discovery/_about.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""The installed distribution version."""

from __future__ import annotations

from importlib.metadata import version

#: the installed distribution version
__version__ = version("python-discovery")
Loading