Skip to content

Commit

Permalink
MAINT: update lock files (#302)
Browse files Browse the repository at this point in the history
* DOC: update instructions about `tool.tox.env`
* DX: always run `pytest` with `nbmake`
* DX: convert Tox config to native TOML
* DX: run Pyright over correct environment
* FIX: downgrade `pygments` and `sphinx-codeautolink`
* FIX: ignore Mathworks in linkecheck
* FIX: remove `uv --locked` flag from RTD config
* MAINT: remove all mentions of `PYTHONHASHSEED`
* MAINT: sort cSpell config

Co-authored-by: GitHub <[email protected]>
  • Loading branch information
pre-commit-ci[bot] and web-flow authored Jan 13, 2025
1 parent ac8b316 commit c11417b
Show file tree
Hide file tree
Showing 15 changed files with 694 additions and 597 deletions.
6 changes: 4 additions & 2 deletions .binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ set -ex
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.cargo/env
uv export \
--extra jupyter \
--extra notebooks \
--group jupyter \
--group notebooks \
--no-dev \
> requirements.txt
uv pip install \
--requirement requirements.txt \
--system
rm requirements.txt
uv cache clean
69 changes: 35 additions & 34 deletions .cspell.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"version": "0.2",
"allowCompoundWords": false,
"enableFiletypes": [
"git-commit",
Expand Down Expand Up @@ -31,47 +30,15 @@
".pre-commit-config.yaml",
".prettierignore",
".readthedocs.yml",
".taplo.toml",
".vscode/*",
"CITATION.cff",
"docs/adr/*/*",
"docs/conf.py",
"pyproject.toml"
],
"language": "en-US",
"words": [
"AmpForm",
"Blatt",
"Breit",
"Chromodynamics",
"Colab",
"ComPWA",
"Curvenote",
"docstrings",
"helicity",
"lambdify",
"Mathematica",
"Miniconda",
"Numba",
"NumPy",
"parametrizations",
"PyPA",
"PyPI",
"pytest",
"QRules",
"Reana",
"Scikit",
"SciPy",
"SymPy",
"TensorWaves",
"Theano",
"TPUs",
"unbinned",
"Weisskopf",
"Zenodo"
],
"ignoreWords": [
"MAINT",
"PYTHONHASHSEED",
"codemirror",
"commitlint",
"cxxcode",
Expand Down Expand Up @@ -113,5 +80,39 @@
"toprettyxml",
"unsrt",
"venv"
],
"language": "en-US",
"useGitignore": true,
"version": "0.2",
"words": [
"AmpForm",
"Blatt",
"Breit",
"Chromodynamics",
"Colab",
"ComPWA",
"Curvenote",
"docstrings",
"helicity",
"lambdify",
"Mathematica",
"Miniconda",
"Numba",
"NumPy",
"parametrizations",
"PyPA",
"PyPI",
"pytest",
"QRules",
"Reana",
"Scikit",
"SciPy",
"SymPy",
"TensorWaves",
"Theano",
"TPUs",
"unbinned",
"Weisskopf",
"Zenodo"
]
}
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ concurrency:
cancel-in-progress: |-
${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }}
env:
PYTHONHASHSEED: "0"

on:
push:
branches:
Expand All @@ -28,7 +25,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 @@ -40,4 +37,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
18 changes: 9 additions & 9 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.0
rev: 0.5.15
hooks:
- id: check-dev-files
args:
Expand All @@ -28,7 +28,7 @@ repos:
- id: remove-empty-tags

- repo: https://github.com/kynan/nbstripout
rev: 0.7.1
rev: 0.8.1
hooks:
- id: nbstripout
args:
Expand Down Expand Up @@ -56,7 +56,7 @@ repos:
metadata.vscode
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.9.1
hooks:
- id: ruff
args: [--fix]
Expand Down Expand Up @@ -90,7 +90,7 @@ repos:
)$
- repo: https://github.com/ComPWA/prettier-pre-commit
rev: v3.3.3
rev: v3.4.2
hooks:
- id: prettier

Expand All @@ -100,13 +100,13 @@ repos:
- id: taplo-format

- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
rev: v0.24.2
hooks:
- id: toml-sort
args: [--in-place]

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.29.4
rev: 0.31.0
hooks:
- id: check-jsonschema
name: Check CITATION.cff
Expand All @@ -119,7 +119,7 @@ repos:
pass_filenames: false

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.15.2
rev: v8.17.0
hooks:
- id: cspell

Expand All @@ -145,11 +145,11 @@ repos:
)$
- repo: https://github.com/ComPWA/pyright-pre-commit
rev: v1.1.385
rev: v1.1.391
hooks:
- id: pyright

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.25
rev: 0.5.18
hooks:
- id: uv-lock
8 changes: 7 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ build:
pixi global install graphviz uv
- |-
export UV_LINK_MODE=copy
uv run --extra doc --locked --with tox \
uv run \
--group doc \
--no-dev \
--with tox \
tox -e doc
mkdir -p $READTHEDOCS_OUTPUT
mv docs/_build/html $READTHEDOCS_OUTPUT
sphinx:
configuration: docs/conf.py
7 changes: 7 additions & 0 deletions .taplo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,10 @@ compact_inline_tables = true
indent_string = " "
reorder_arrays = true
reorder_keys = true

[[rule]]
include = ["**/pyproject.toml"]
keys = ["tool.tox"]

[rule.formatting]
reorder_arrays = false
2 changes: 2 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"mhutchie.git-graph",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-toolsai.jupyter",
"ms-toolsai.vscode-jupyter-cell-tags",
"ms-vscode.live-server",
"ms-vsliveshare.vsliveshare",
Expand All @@ -32,6 +33,7 @@
"ms-python.isort",
"ms-python.mypy-type-checker",
"ms-python.pylint",
"ms-toolsai.vscode-jupyter-slideshow",
"travisillig.vscode-json-stable-stringify",
"tyriar.sort-lines"
]
Expand Down
24 changes: 21 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,33 @@ git clone https://github.com/ComPWA/compwa.github.io
cd compwa.github.io
```

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).
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/layout/#the-lockfile).

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

Formatting and linting checks are automatically performed when committing changes. This is done with [pre-commit](https://pre-commit.com). To install the hooks in your local repository, run [`pre-commit install`](https://pre-commit.com/#3-install-the-git-hook-scripts) **once**:
Formatting and linting checks are automatically performed when committing changes. This is done with [pre-commit](https://pre-commit.com). To install the hooks in your local repository, run install `pre-commit` with `uv`:

```shell
uv tool install pre-commit --with pre-commit-uv --force-reinstall
```

and [`pre-commit install`](https://pre-commit.com/#3-install-the-git-hook-scripts) **once**:

```shell
pre-commit install --install-hooks
```

In addition, it may be handy to install `tox`:

```shell
uv tool install tox --with tox-uv
```

If the repository provides a Tox configuration under [`pyproject.toml`](./pyproject.toml), you can see which jobs it defines with:

```shell
tox list
```
4 changes: 2 additions & 2 deletions docs/adr/002/composition.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
") -> DynamicsExpression:\n",
" edge_ids = determine_attached_final_state(graph, edge_id)\n",
" final_state_ids = map(str, edge_ids)\n",
" mass = sp.Symbol(f\"m_{{{\"+\".join(final_state_ids)}}}\")\n",
" mass = sp.Symbol(f\"m_{{{'+'.join(final_state_ids)}}}\")\n",
" particle, _ = graph.get_edge_props(edge_id)\n",
" mass0 = sp.Symbol(f\"m_{{{particle.latex}}}\")\n",
" gamma0 = sp.Symbol(Rf\"\\Gamma_{{{particle.latex}}}\")\n",
Expand All @@ -212,7 +212,7 @@
") -> DynamicsExpression:\n",
" edge_ids = determine_attached_final_state(graph, edge_id)\n",
" final_state_ids = map(str, edge_ids)\n",
" mass = sp.Symbol(f\"m_{{{\"+\".join(final_state_ids)}}}\")\n",
" mass = sp.Symbol(f\"m_{{{'+'.join(final_state_ids)}}}\")\n",
" particle, _ = graph.get_edge_props(edge_id)\n",
" mass0 = sp.Symbol(f\"m_{{{particle.latex}}}\")\n",
" gamma0 = sp.Symbol(Rf\"\\Gamma_{{{particle.latex}}}\")\n",
Expand Down
6 changes: 3 additions & 3 deletions docs/adr/002/expr.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
" ) -> RelativisticBreitWigner:\n",
" edge_ids = determine_attached_final_state(graph, edge_id)\n",
" final_state_ids = map(str, edge_ids)\n",
" mass = sp.Symbol(f\"m_{{{\"+\".join(final_state_ids)}}}\")\n",
" mass = sp.Symbol(f\"m_{{{'+'.join(final_state_ids)}}}\")\n",
" particle, _ = graph.get_edge_props(edge_id)\n",
" mass0 = sp.Symbol(f\"m_{{{particle.latex}}}\")\n",
" gamma0 = sp.Symbol(Rf\"\\Gamma_{{{particle.latex}}}\")\n",
Expand Down Expand Up @@ -247,7 +247,7 @@
" ) -> RelativisticBreitWignerWithFF:\n",
" edge_ids = determine_attached_final_state(graph, edge_id)\n",
" final_state_ids = map(str, edge_ids)\n",
" mass = sp.Symbol(f\"m_{{{\"+\".join(final_state_ids)}}}\")\n",
" mass = sp.Symbol(f\"m_{{{'+'.join(final_state_ids)}}}\")\n",
" particle, _ = graph.get_edge_props(edge_id)\n",
" mass0 = sp.Symbol(f\"m_{{{particle.latex}}}\")\n",
" gamma0 = sp.Symbol(Rf\"\\Gamma_{{{particle.latex}}}\")\n",
Expand Down Expand Up @@ -459,7 +459,7 @@
" ) -> RelativisticBreitWigner:\n",
" edge_ids = determine_attached_final_state(graph, edge_id)\n",
" final_state_ids = map(str, edge_ids)\n",
" mass = sp.Symbol(f\"m_{{{\"+\".join(final_state_ids)}}}\")\n",
" mass = sp.Symbol(f\"m_{{{'+'.join(final_state_ids)}}}\")\n",
" particle, _ = graph.get_edge_props(edge_id)\n",
" mass0 = sp.Symbol(Rf\"\\mu_{{{particle.latex}}}\")\n",
" gamma0 = sp.Symbol(Rf\"\\sigma_{{{particle.latex}}}\")\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/adr/002/function.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
" ) -> \"RelativisticBreitWigner\":\n",
" edge_ids = determine_attached_final_state(graph, edge_id)\n",
" final_state_ids = map(str, edge_ids)\n",
" mass = sp.Symbol(f\"m_{{{\"+\".join(final_state_ids)}}}\")\n",
" mass = sp.Symbol(f\"m_{{{'+'.join(final_state_ids)}}}\")\n",
" particle, _ = graph.get_edge_props(edge_id)\n",
" mass0 = sp.Symbol(f\"m_{{{particle.latex}}}\")\n",
" gamma0 = sp.Symbol(Rf\"\\Gamma_{{{particle.latex}}}\")\n",
Expand Down Expand Up @@ -159,7 +159,7 @@
" ) -> \"RelativisticBreitWignerWithFF\":\n",
" edge_ids = determine_attached_final_state(graph, edge_id)\n",
" final_state_ids = map(str, edge_ids)\n",
" mass = sp.Symbol(f\"m_{{{\"+\".join(final_state_ids)}}}\")\n",
" mass = sp.Symbol(f\"m_{{{'+'.join(final_state_ids)}}}\")\n",
" particle, _ = graph.get_edge_props(edge_id)\n",
" mass0 = sp.Symbol(f\"m_{{{particle.latex}}}\")\n",
" gamma0 = sp.Symbol(Rf\"\\Gamma_{{{particle.latex}}}\")\n",
Expand Down
13 changes: 7 additions & 6 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,14 @@
html_title = "Common Partial Wave Analysis Project"
intersphinx_mapping = {
"ampform": ("https://ampform.readthedocs.io/stable", None),
"attrs": (f"https://www.attrs.org/en/{pin("attrs")}", None),
"attrs": (f"https://www.attrs.org/en/{pin('attrs')}", None),
"expertsystem": ("https://expertsystem.readthedocs.io/stable", None),
"graphviz": ("https://graphviz.readthedocs.io/en/stable", None),
"IPython": (f"https://ipython.readthedocs.io/en/{pin("IPython")}", None),
"IPython": (f"https://ipython.readthedocs.io/en/{pin('IPython')}", None),
"jax": ("https://jax.readthedocs.io/en/latest", None),
"matplotlib": (f"https://matplotlib.org/{pin("matplotlib")}", None),
"numba": (f"https://numba.readthedocs.io/en/{pin("numba")}", None),
"numpy": (f"https://numpy.org/doc/{pin_minor("numpy")}", None),
"matplotlib": (f"https://matplotlib.org/{pin('matplotlib')}", None),
"numba": (f"https://numba.readthedocs.io/en/{pin('numba')}", None),
"numpy": (f"https://numpy.org/doc/{pin_minor('numpy')}", None),
"pwa": ("https://pwa.readthedocs.io", None),
"python": ("https://docs.python.org/3", None),
"qrules": ("https://qrules.readthedocs.io/stable", None),
Expand All @@ -147,7 +147,6 @@
}
linkcheck_anchors = False
linkcheck_ignore = [
"https://github.com/search",
"http://127.0.0.1:8000",
"https://atom.io", # often instable
"https://doi.org/10.1002/andp.19955070504", # 403 for onlinelibrary.wiley.com
Expand All @@ -156,6 +155,7 @@
"https://doi.org/10.7566/JPSCP.26.022002", # 403 for journals.jps.jp
"https://downloads.hindawi.com", # 403
"https://github.com/organizations/ComPWA/settings/repository-defaults", # private
"https://github.com/search",
"https://ieeexplore.ieee.org/document/6312940", # 401
"https://indico.ific.uv.es/event/6803", # SSL error
"https://journals.aps.org",
Expand All @@ -167,6 +167,7 @@
"https://via.placeholder.com", # irregular timeout
"https://www.andiamo.co.uk/resources/iso-language-codes", # 443, but works
"https://www.bookfinder.com",
"https://www.mathworks.com/products/matlab.html",
r"https://github.com/ComPWA/RUB-EP1-AG/.*", # private
r"https://github.com/orgs/ComPWA/projects/\d+", # private
]
Expand Down
Loading

0 comments on commit c11417b

Please sign in to comment.