Skip to content

Commit

Permalink
FIX: define dev dependencies as dependency groups (#24)
Browse files Browse the repository at this point in the history
* DX: disable Sphinx warnings in `linkcheck` job
* DX: run `pyright` in `tox -e sty` job
* MAINT: remove redundant `types` dependency group
* MAINT: update lock files
* MAINT: update links to TRs
  • Loading branch information
redeboer authored Oct 29, 2024
1 parent 10900e8 commit c9167da
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 110 deletions.
5 changes: 3 additions & 2 deletions .binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export PYTHONHASHSEED="0"
pixi clean cache --yes

uv export \
--extra jupyter \
--extra notebooks \
--group jupyter \
--group notebooks \
--no-dev \
> requirements.txt
uv pip install \
--requirement requirements.txt \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ on:

jobs:
doc:
uses: ComPWA/actions/.github/workflows/ci-docs.yml@v2
uses: ComPWA/actions/.github/workflows/ci-docs.yml@v2.1
permissions:
pages: write
id-token: write
Expand All @@ -39,4 +39,4 @@ jobs:
if: inputs.specific-pip-packages == ''
secrets:
token: ${{ secrets.PAT }}
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2.1
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.5.3
rev: 0.5.5
hooks:
- id: check-dev-files
args:
Expand Down Expand Up @@ -152,6 +152,6 @@ repos:
- id: pyright

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.26
rev: 0.4.28
hooks:
- id: uv-lock
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ build:
export UV_LINK_MODE=copy
pixi run \
uv run \
--extra doc \
--group doc \
--locked \
--no-dev \
--with tox \
tox -e doc
mkdir -p $READTHEDOCS_OUTPUT
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cd report
Now it's simply a matter of creating and activating the [virtual environment](https://docs.astral.sh/uv/pip/environments) with [`uv sync`](https://docs.astral.sh/uv/reference/cli/#uv-sync). The dependencies for the project are 'pinned' in each commit through the [`uv.lock` file](https://docs.astral.sh/uv/concepts/projects/#project-lockfile).

```shell
uv sync
uv sync --all-extras
source .venv/bin/activate
```

Expand Down
2 changes: 1 addition & 1 deletion docs/033/index.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@
"metadata": {},
"source": [
":::{seealso}\n",
"- [Section of helicity formalism in **TR-015** (Spin alignment implementation)](https://compwa.github.io/report/015.html#helicity-formalism)\n",
"- [Section of helicity formalism in **TR-015** (Spin alignment implementation)](../015/index.ipynb#helicity-formalism)\n",
"- [Helicity versus canonical in Ampform](https://ampform.readthedocs.io/stable/usage/helicity/formalism.html)\n",
":::"
]
Expand Down
42 changes: 21 additions & 21 deletions pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 27 additions & 30 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,25 @@ maintainers = [{email = "[email protected]"}]
name = "compwa-report"
requires-python = ">=3.9"

[project.optional-dependencies]
[project.readme]
content-type = "text/markdown"
file = "README.md"

[project.urls]
Documentation = "https://compwa.github.io/report"
Source = "https://github.com/ComPWA/report"
Tracker = "https://github.com/ComPWA/report/issues"

[dependency-groups]
dev = [
"compwa-report[doc]",
"compwa-report[jupyter]",
"compwa-report[sty]",
"compwa-report[test]",
"ruff",
"sphinx-autobuild",
{include-group = "doc"},
{include-group = "jupyter"},
{include-group = "style"},
{include-group = "test"},
]
doc = [
"compwa-report[notebooks]",
"myst-nb",
"nbformat",
"sphinx",
Expand All @@ -39,42 +48,28 @@ doc = [
"sphinx-thebe",
"sphinx-togglebutton",
"sphinxcontrib-bibtex >=2",
{include-group = "notebooks"},
]
jupyter = [
"compwa-report[notebooks]",
"jupyterlab",
"jupyterlab-code-formatter >=3.0.0",
"jupyterlab-code-formatter",
"jupyterlab-git",
"jupyterlab-lsp",
"jupyterlab-myst",
"python-lsp-ruff",
"python-lsp-server[rope]",
{include-group = "notebooks"},
]
notebooks = [
"pyproject-local-kernel",
]
sty = [
"compwa-report[types]",
"ruff",
notebooks = ["pyproject-local-kernel"]
style = [
"nbformat",
"sphinx-api-relink",
]
test = [
"compwa-report[notebooks]",
"nbmake",
"pytest-env",
{include-group = "notebooks"},
]
types = [
"nbformat",
"sphinx-api-relink",
]

[project.readme]
content-type = "text/markdown"
file = "README.md"

[project.urls]
Documentation = "https://compwa.github.io/report"
Source = "https://github.com/ComPWA/report"
Tracker = "https://github.com/ComPWA/report/issues"

[tool.setuptools]
include-package-data = false
Expand Down Expand Up @@ -124,6 +119,8 @@ reportUnusedFunction = true
reportUnusedImport = true
reportUnusedVariable = true
typeCheckingMode = "strict"
venv = ".venv"
venvPath = "."

[tool.pytest.ini_options]
addopts = [
Expand Down Expand Up @@ -348,6 +345,8 @@ commands =
--show-traceback \
docs/ docs/_build/linkcheck
description = Check external links in the documentation (requires internet connection)
setenv =
PYTHONWARNINGS =
[testenv:nb]
allowlist_externals =
Expand All @@ -362,6 +361,4 @@ allowlist_externals =
commands =
pre-commit run --all-files {posargs}
description = Perform all linting, formatting, and spelling checks
setenv =
SKIP = pyright
"""
Loading

0 comments on commit c9167da

Please sign in to comment.