Skip to content

Commit

Permalink
MAINT: update lock files (#151)
Browse files Browse the repository at this point in the history
* DX: lower minimal test coverage to 54%
* DX: remove `setuptools-scm` version configuration
* DX: run tests with `uv-venv-lock-runner`
* FIX: set correct ignore patterns for `sphinx-autobuild`
* MAINT: remove dynamic version from `uv.lock`
* MAINT: remove `pygments` version constraint
* MAINT: update developer configuration
  • Loading branch information
grayson-helmholz authored Jan 29, 2025
1 parent 7c2db34 commit b658ea0
Show file tree
Hide file tree
Showing 7 changed files with 608 additions and 475 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
uses: ComPWA/actions/.github/workflows/[email protected]
with:
coverage-target: ampform_dpd
macos-python-version: "3.9"
macos-python-version: "3.10"
specific-pip-packages: ${{ inputs.specific-pip-packages }}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
13 changes: 7 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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:
Expand All @@ -23,6 +23,7 @@ repos:
- --repo-title=AmpForm-DPD
- id: colab-toc-visible
- id: remove-empty-tags
- id: set-nb-display-name

- repo: https://github.com/kynan/nbstripout
rev: 0.8.1
Expand Down Expand Up @@ -53,7 +54,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 @@ -94,12 +95,12 @@ repos:
- --in-place

- 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 @@ -120,11 +121,11 @@ repos:
- python

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

- 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
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,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", "--verbose", "--verbose"],
"python.testing.pytestEnabled": true,
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ coverage:
status:
project:
default:
target: 58%
target: 54%
threshold: 1%
base: auto
if_no_uploads: error
Expand Down
90 changes: 59 additions & 31 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 @@ -121,10 +122,17 @@ namespaces = false
where = ["src"]

[tool.setuptools_scm]
local_scheme = "no-local-version"
version_scheme = "only-version"
write_to = "src/ampform_dpd/version.py"

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

[tool.coverage.run]
branch = true
source = ["src"]

[tool.mypy]
exclude = "_build"
show_error_codes = true
Expand All @@ -145,7 +153,6 @@ disallow_untyped_defs = false
module = ["tests.*"]

[tool.pyright]
exclude = ["**/.venv/"]
reportArgumentType = false
reportAssignmentType = false
reportAttributeAccessIssue = false
Expand Down Expand Up @@ -358,6 +365,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 @@ -369,18 +381,21 @@ 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",
{replace = "posargs", extend = true},
"--cov-fail-under=58",
"--cov-fail-under=54",
"--cov-report=html",
"--cov-report=xml",
"--cov=ampform_dpd",
Expand All @@ -390,76 +405,76 @@ description = "Compute test coverage"

[tool.tox.env.doc]
allowlist_externals = ["sphinx-build"]
base = []
commands = [
[
"sphinx-build",
"--builder=html",
"--fail-on-warning",
"--keep-going",
"docs/",
"docs/_build/html",
"docs/_build/html/",
],
]
description = "Build documentation with Sphinx"

[tool.tox.env.doclive]
allowlist_externals = ["sphinx-autobuild"]
base = []
commands = [
[
"sphinx-autobuild",
"--ignore=docs/_build/",
"--ignore=docs/_images/",
"--ignore=docs/api/",
"--ignore=docs/export/",
"--open-browser",
"--port=0",
"--re-ignore='.*/__pycache__/.*'",
"--re-ignore='.*/.ipynb_checkpoints/.*'",
"--re-ignore='.*/.virtual_documents/.*'",
"--re-ignore='.*\\.pdf'",
"--re-ignore='.*\\.pkl'",
"--re-ignore='.*\\.png'",
"--re-ignore='.*\\.svg'",
"--re-ignore='.*\\.tmp'",
"--watch=docs",
"--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=\\.egg-info(/.*)?$",
"--re-ignore=\\.pkl$",
"--re-ignore=\\.png$",
"--re-ignore=\\.svg$",
"--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"]
commands = [
[
"sphinx-build",
"--builder=linkcheck",
"--show-traceback",
"docs/",
"docs/_build/linkcheck",
"docs/_build/linkcheck/",
],
]
description = "Check external links in the documentation (requires internet connection)"
set_env.PYTHONWARNINGS = ""

[tool.tox.env.nb]
allowlist_externals = ["pytest"]
commands = [
[
"pytest",
Expand All @@ -469,15 +484,28 @@ commands = [
],
]
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.9",
"3.10",
"3.11",
"3.12",
"3.13",
]

[tool.uv]
constraint-dependencies = [
"numpy~=1.0",
"pygments!=2.19.*", # https://github.com/felix-hilden/sphinx-codeautolink/issues/152
"sphinx-codeautolink!=0.16.0",
]
Loading

0 comments on commit b658ea0

Please sign in to comment.