Skip to content

Commit

Permalink
FIX: define dev dependencies as dependency groups (#366)
Browse files Browse the repository at this point in the history
* DX: activate `FORCE_COLOR`
* DX: always run documentation workflow
* DX: install Julia through julia-forge
* DX: move `ruff` and `nbmake` to `dev` dependencies
* DX: run `pyright` in `tox -e sty` job
* FIX: give phase space to `interpolate_intensity()`
* FIX: install `tox` in Pixi environment
* FIX: move `cloutpickle and `svgutils` to `notebooks` dependency group
* FIX: remove `tox` from venv
* MAINT: update lock files
  • Loading branch information
redeboer authored Oct 29, 2024
1 parent 97a693e commit adaa4d2
Show file tree
Hide file tree
Showing 13 changed files with 844 additions and 1,246 deletions.
6 changes: 3 additions & 3 deletions .binder/postBuild
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ if [[ -n "$pixi_packages" ]]; then
pixi global install $pixi_packages
fi
export PYTHONHASHSEED="0"
bash julia/install.sh
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
29 changes: 23 additions & 6 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
env:
FORCE_COLOR: "1"
JULIA_CI: "true"
PYTHONHASHSEED: "0"
PYTHON_VERSION: "3.9"
Expand Down Expand Up @@ -27,7 +28,8 @@ jobs:
- name: Build documentation without running notebooks
run: >-
uv run \
--extra doc \
--group doc \
--no-dev \
--with tox \
tox -e doc
- uses: actions/upload-artifact@v4
Expand All @@ -52,7 +54,8 @@ jobs:
sudo apt-get update -y
sudo apt-get install -y inkscape latexmk make texlive-fonts-extra texlive-xetex xindy
uv run \
--extra doc \
--group doc \
--no-dev \
--with tox \
tox -e pdf
- uses: actions/upload-artifact@v4
Expand All @@ -76,13 +79,13 @@ jobs:
- name: Check external links with Sphinx linkcheck
run: >-
uv run \
--extra doc \
--group doc \
--no-dev \
--with tox \
tox -e linkcheck
documentation:
name: Run notebooks and build documentation
if: github.event_name != 'pull_request'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -135,7 +138,14 @@ jobs:
./docs/_static/images
./docs/appendix/export
- name: Build PDF with notebook execution
run: pixi run tox -e pdfnb
run: >-
pixi run \
uv run \
--group doc \
--group notebooks \
--no-dev \
--with tox \
tox -e pdfnb
- uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
Expand All @@ -144,7 +154,14 @@ jobs:
- name: Build PDF with notebook execution
env:
EXECUTE_PLUTO: "YES"
run: pixi run tox -e docnb
run: >-
pixi run \
uv run \
--group doc \
--group notebooks \
--no-dev \
--with tox \
tox -e docnb
- uses: actions/upload-pages-artifact@v3
if: always()
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@ jobs:
with:
specific-pip-packages: ${{ inputs.specific-pip-packages }}
pytest:
uses: ComPWA/actions/.github/workflows/pytest.yml@v1
uses: ComPWA/actions/.github/workflows/pytest.yml@v2.1
with:
additional-extras: all
specific-pip-packages: ${{ inputs.specific-pip-packages }}
style:
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
2 changes: 2 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
- epic/*
paths:
- .pre-commit-config.yaml
- Manifest.toml
- pixi.lock
- uv.lock
workflow_dispatch:

Expand Down
8 changes: 4 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.0
rev: 0.5.6
hooks:
- id: check-dev-files
args:
Expand Down Expand Up @@ -55,7 +55,7 @@ repos:
metadata.vscode
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.0
rev: v0.7.1
hooks:
- id: ruff
args: [--fix]
Expand Down Expand Up @@ -140,11 +140,11 @@ repos:
- python

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

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.25
rev: 0.4.28
hooks:
- id: uv-lock
2 changes: 1 addition & 1 deletion docs/extensions/support_bibtex_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def _patch_format_math(self, text: list[Text]) -> list[docutils.nodes.math]:

class Math(Protected):
def __repr__(self) -> str:
return f'Math({", ".join(repr(part) for part in self.parts)})'
return f"Math({', '.join(repr(part) for part in self.parts)})"

def render(self, backend):
text = super().render(backend)
Expand Down
2 changes: 1 addition & 1 deletion docs/zz.polarization-fit.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
"P = (+0.2165, +0.0108, -0.665)\n",
"I = compute_polarized_intensity(\n",
" *P,\n",
" I0=interpolate_intensity(model_id=0),\n",
" I0=interpolate_intensity(PHSP, model_id=0),\n",
" alpha=interpolate_polarimetry_field(PHSP, model_id=0),\n",
" phsp=PHSP,\n",
")\n",
Expand Down
Loading

0 comments on commit adaa4d2

Please sign in to comment.