Skip to content

Commit

Permalink
MAINT: update lock files (#231)
Browse files Browse the repository at this point in the history
* DX: remove VS Code setting `files.watcherExclude`
* DX: run `tox -e uv` with lock runner
* FIX: set correct ignore patterns for `sphinx-autobuild`
* MAINT: remove dynamic version from `uv.lock`
* MAINT: update developer environment
  • Loading branch information
grayson-helmholz authored Jan 29, 2025
1 parent 56b7c19 commit a15b5a5
Show file tree
Hide file tree
Showing 6 changed files with 259 additions and 245 deletions.
15 changes: 8 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.5.15
rev: 0.6.1
hooks:
- id: check-dev-files
args:
- --ci-skipped-tests=all
- --macos-python-version=disable
- --no-binder
- --no-cd
- --no-macos
- --no-pypi
- --repo-name=PWA-pages
- --repo-title=PWA Pages
- id: colab-toc-visible
- id: fix-nbformat-version
- id: remove-empty-tags
- id: set-nb-display-name

- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
Expand Down Expand Up @@ -59,7 +60,7 @@ repos:
metadata.vscode
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1
rev: v0.9.3
hooks:
- id: ruff
args: [--fix]
Expand Down Expand Up @@ -119,12 +120,12 @@ repos:
args: ["--schemafile", "./docs/software/project-inventory-schema.json"]

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.17.0
rev: v8.17.1
hooks:
- 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 @@ -145,7 +146,7 @@ repos:
- python

- repo: https://github.com/ComPWA/pyright-pre-commit
rev: v1.1.391
rev: v1.1.392
hooks:
- id: pyright

Expand All @@ -159,6 +160,6 @@ repos:
files: (docs/software/.*\.json|src/pwa_pages/project_inventory.py)

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.18
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
7 changes: 1 addition & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@
"coverage-gutters.showLineCoverage": true,
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
"files.watcherExclude": {
"**/*_cache/**": true,
"**/.eggs/**": true,
"**/.git/**": true,
"**/.tox/**": true
},
"git.rebaseWhenSync": true,
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"gitlens.telemetry.enabled": false,
Expand All @@ -59,6 +53,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.autoTestDiscoverOnSaveEnabled": false,
"python.testing.pytestArgs": [
Expand Down
2 changes: 1 addition & 1 deletion docs/dynamics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@
"toc_visible": true
},
"kernelspec": {
"display_name": "Python 3",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
}
Expand Down
98 changes: 56 additions & 42 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ pwa_pages = ["py.typed"]
namespaces = false
where = ["src"]

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

[tool.coverage.run]
branch = true
source = ["src"]
Expand Down Expand Up @@ -142,16 +147,6 @@ ignore_missing_imports = true
module = ["sphinxcontrib.bibtex.*"]

[tool.pyright]
exclude = [
"**/.git",
"**/.ipynb_checkpoints",
"**/.mypy_cache",
"**/.pytest_cache",
"**/.tox",
"**/.venv/",
"**/__pycache__",
"**/_build",
]
include = [
"docs",
"src",
Expand Down Expand Up @@ -321,6 +316,8 @@ trailing_comma_inline_array = true

[tool.tox]
env_list = [
"3.12",
"3.13",
"cov",
"docnb-force",
"linkcheck",
Expand All @@ -332,13 +329,16 @@ skip_install = true
skip_missing_interpreters = true

[tool.tox.env_run_base]
allowlist_externals = ["pytest"]
commands = [["pytest", {replace = "posargs", extend = true}]]
description = "Run all unit tests"
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 @@ -353,6 +353,7 @@ description = "Compute test coverage"

[tool.tox.env.doc]
allowlist_externals = ["sphinx-build"]
base = []
commands = [
[
"sphinx-build",
Expand All @@ -361,79 +362,92 @@ commands = [
"--keep-going",
"--show-traceback",
"docs/",
"docs/_build/html",
"docs/_build/html/",
],
]
description = "Build documentation and API through Sphinx"

[tool.tox.env.doclive]
allowlist_externals = ["sphinx-autobuild"]
base = []
commands = [
[
"sphinx-autobuild",
"--builder=dirhtml",
"--ignore=docs/api",
"--open-browser",
"--port=0",
"--re-ignore='.*/__pycache__/.*'",
"--re-ignore='.*/.ipynb_checkpoints/.*'",
"--re-ignore='.*/.virtual_documents/.*'",
"--re-ignore='.*\\.csv'",
"--re-ignore='.*\\.gif'",
"--re-ignore='.*\\.gitignore'",
"--re-ignore='.*\\.gv'",
"--re-ignore='.*\\.inv'",
"--re-ignore='.*\\.json'",
"--re-ignore='.*\\.pickle'",
"--re-ignore='.*\\.png'",
"--re-ignore='.*\\.svg'",
"--re-ignore='.*\\.ya?ml'",
"--re-ignore='docs/_build/.*'",
"--watch",
"docs",
"--watch",
"src",
"--re-ignore=/__pycache__(/.*)?$",
"--re-ignore=/_build(/.*)?$",
"--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=\\.svg$",
"--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"]
description = "{[tool.tox.env.doc]description} with cached notebook execution"
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 = "{[tool.tox.env.doc]description} with notebook execution (no cache)"
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"]
description = "{[tool.tox.env.doclive]description} with cached notebook execution"
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.labels]
doc = [
"docnb-force",
"linkcheck",
]
test = [
"3.12",
"3.13",
]
Loading

0 comments on commit a15b5a5

Please sign in to comment.