Skip to content

Commit

Permalink
MAINT: update lock files (#317)
Browse files Browse the repository at this point in the history
* DX: run `tox -e uv` with lock runner
* FIX: set correct ignore patterns for `sphinx-autobuild`
* MAINT: update developer environment
  • Loading branch information
grayson-helmholz authored Jan 29, 2025
1 parent a38e867 commit ecd47b9
Show file tree
Hide file tree
Showing 6 changed files with 191 additions and 166 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: ComPWA/actions/.github/workflows/[email protected]
with:
coverage-target: qrules
macos-python-version: "3.9"
macos-python-version: "3.10"
specific-pip-packages: ${{ inputs.specific-pip-packages }}
test-output-path: tests/output/
secrets:
Expand Down
9 changes: 5 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.5.16
rev: 0.6.1
hooks:
- id: check-dev-files
args:
Expand All @@ -30,6 +30,7 @@ repos:
- --add-install-cell
- --additional-packages=IPython
- --extras-require=doc,viz
- id: set-nb-display-name

- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
Expand Down Expand Up @@ -60,7 +61,7 @@ repos:
metadata.vscode
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.2
rev: v0.9.3
hooks:
- id: ruff
args: [--fix]
Expand Down Expand Up @@ -127,7 +128,7 @@ repos:
- id: cspell

- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 3.0.3
rev: 3.2.0
hooks:
- id: editorconfig-checker
name: editorconfig
Expand All @@ -153,6 +154,6 @@ repos:
- id: pyright

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.20
rev: 0.5.25
hooks:
- id: uv-lock
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ build:
uv run \
--group doc \
--no-dev \
--with tox \
--with tox-uv \
tox -e doc
mkdir -p $READTHEDOCS_OUTPUT
mv docs/_build/html $READTHEDOCS_OUTPUT
Expand Down
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"notebook.gotoSymbols.showAllSymbols": true,
"python.analysis.autoImportCompletions": false,
"python.analysis.inlayHints.pytestParameters": true,
"python.defaultInterpreterPath": ".venv/bin/python",
"python.terminal.activateEnvironment": false,
"python.testing.pytestArgs": [
"--color=no",
Expand Down
109 changes: 66 additions & 43 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python",
"Topic :: Scientific/Engineering :: Physics",
Expand Down Expand Up @@ -139,6 +140,11 @@ where = ["src"]
[tool.setuptools_scm]
write_to = "src/qrules/version.py"

[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
]

[tool.coverage.run]
branch = true
source = ["src"]
Expand Down Expand Up @@ -193,16 +199,6 @@ ignore_missing_imports = true
module = ["tqdm.*"]

[tool.pyright]
exclude = [
"**/.git",
"**/.ipynb_checkpoints",
"**/.mypy_cache",
"**/.pytest_cache",
"**/.tox",
"**/.venv/",
"**/__pycache__",
"**/_build",
]
reportArgumentType = false
reportAssignmentType = false
reportAttributeAccessIssue = false
Expand Down Expand Up @@ -397,6 +393,11 @@ trailing_comma_inline_array = true

[tool.tox]
env_list = [
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"cov",
"docnb-force",
"linkcheck",
Expand All @@ -409,15 +410,16 @@ skip_install = true
skip_missing_interpreters = true

[tool.tox.env_run_base]
allowlist_externals = ["pytest"]
commands = [
["pytest", {replace = "posargs", default = ["src tests/unit"], extend = true}],
]
description = "Run all fast unit tests and doctests"
commands = [["pytest", {replace = "posargs", extend = true}]]
dependency_groups = ["test"]
description = "Run test suite on Python {env_name}"
no_package = false
pass_env = ["*"]
runner = "uv-venv-lock-runner"
skip_install = false
skip_missing_interpreters = false

[tool.tox.env.cov]
allowlist_externals = ["pytest"]
commands = [
[
"pytest",
Expand All @@ -432,6 +434,7 @@ description = "Compute the test coverage of all unit tests"

[tool.tox.env.doc]
allowlist_externals = ["sphinx-build"]
base = []
commands = [
[
"sphinx-build",
Expand All @@ -440,90 +443,97 @@ commands = [
"--keep-going",
"--show-traceback",
"docs/",
"docs/_build/html",
"docs/_build/html/",
],
]
description = "Build documentation and API through Sphinx"
set_env.PYTHONWARNINGS = ""

[tool.tox.env.doclive]
allowlist_externals = ["sphinx-autobuild"]
base = []
commands = [
[
"sphinx-autobuild",
"--builder=html",
"--ignore=docs/_build/",
"--ignore=docs/_images/",
"--ignore=docs/_static/logo.*",
"--ignore=docs/api/",
"--open-browser",
"--port=0",
"--re-ignore='.*/__pycache__/.*'",
"--re-ignore='.*/.ipynb_checkpoints/.*'",
"--re-ignore='.*/.virtual_documents/.*'",
"--re-ignore='.*\\.csv'",
"--re-ignore='.*\\.gv'",
"--re-ignore='.*\\.inv'",
"--re-ignore='.*\\.json'",
"--re-ignore='.*\\.pickle'",
"--re-ignore='.*\\.tmp'",
"--re-ignore='.*\\.ya?ml'",
"--watch=docs",
"--re-ignore=/__pycache__(/.*)?$",
"--re-ignore=/_build(/.*)?$",
"--re-ignore=/_images(/.*)?$",
"--re-ignore=/\\.cache(/.*)?$",
"--re-ignore=/\\.egg-info(/.*)?$",
"--re-ignore=/\\.ipynb_checkpoints(/.*)?$",
"--re-ignore=/\\.virtual_documents(/.*)?$",
"--re-ignore=/api(/.*)?$",
"--re-ignore=/docs$",
"--re-ignore=/version\\.py$",
"--re-ignore=\\.csv$",
"--re-ignore=\\.egg-info(/.*)?$",
"--re-ignore=\\.gif$",
"--re-ignore=\\.gitignore$",
"--re-ignore=\\.gv$",
"--re-ignore=\\.inv$",
"--re-ignore=\\.json$",
"--re-ignore=\\.pickle$",
"--re-ignore=\\.pkl$",
"--re-ignore=\\.png$",
"--re-ignore=\\.root$",
"--re-ignore=\\.svg$",
"--re-ignore=\\.tmp$",
"--re-ignore=\\.ya?ml$",
"--watch=src",
"docs/",
"docs/_build/html",
"docs/_build/html/",
],
]
description = "Set up a server to directly preview changes to the HTML pages"

[tool.tox.env.docnb]
base = ["tool.tox.env.doc", "tool.tox.env_run_base"]
base = ["tool.tox.env.doc"]
set_env = [
{replace = "ref", of = ["tool.tox.env.doc.set_env"]},
{EXECUTE_NB = "yes"},
]

[tool.tox.env.docnb-force]
base = ["tool.tox.env.doc", "tool.tox.env_run_base"]
base = ["tool.tox.env.doc"]
description = "Execute Jupyter notebooks without cache and build documentation with Sphinx"
set_env = [
{replace = "ref", of = ["tool.tox.env.doc.set_env"]},
{FORCE_EXECUTE_NB = "yes"},
]

[tool.tox.env.docnblive]
base = ["tool.tox.env.doclive", "tool.tox.env_run_base"]
base = ["tool.tox.env.doclive"]
set_env = [
{replace = "ref", of = ["tool.tox.env.doclive.set_env"]},
{EXECUTE_NB = "yes"},
]

[tool.tox.env.linkcheck]
allowlist_externals = ["sphinx-build"]
base = ["tool.tox.env.doc", "tool.tox.env_run_base"]
base = ["tool.tox.env.doc"]
commands = [
[
"sphinx-build",
"--builder=linkcheck",
"--show-traceback",
"docs/",
"docs/_build/linkcheck",
"docs/_build/linkcheck/",
],
]
description = "Check external links in the documentation (requires internet connection)"

[tool.tox.env.nb]
allowlist_externals = ["pytest"]
commands = [["pytest", "--nbmake", "{posargs:docs}"]]
description = "Run all notebooks with pytest"
with_dev = true

[tool.tox.env.sty]
allowlist_externals = ["pre-commit"]
base = []
commands = [["pre-commit", "run", "--all-files", {replace = "posargs", extend = true}]]
description = "Perform all linting, formatting, and spelling checks"

[tool.tox.env.test]
allowlist_externals = ["pytest"]
commands = [
[
"pytest",
Expand All @@ -535,3 +545,16 @@ commands = [
],
]
description = "Run ALL tests, including the slow channel tests, and compute coverage"

[tool.tox.labels]
doc = [
"docnb-force",
"linkcheck",
]
test = [
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
]
Loading

0 comments on commit ecd47b9

Please sign in to comment.