Skip to content

Commit

Permalink
MAINT: update lock files and dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
redeboer committed Oct 16, 2024
1 parent 424ee4e commit 3bfee18
Show file tree
Hide file tree
Showing 13 changed files with 430 additions and 448 deletions.
1 change: 1 addition & 0 deletions .binder/apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graphviz
12 changes: 12 additions & 0 deletions .binder/postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -ex
curl -LsSf https://astral.sh/uv/install.sh | sh
source $HOME/.cargo/env
uv export \
--extra jupyter \
--extra notebooks \
> requirements.txt
uv pip install \
--requirement requirements.txt \
--system
uv cache clean
1 change: 1 addition & 0 deletions .binder/runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.10
8 changes: 4 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ on:
jobs:
milestone:
if: startsWith(github.ref, 'refs/tags')
uses: ComPWA/actions/.github/workflows/close-milestone.yml@v1
uses: ComPWA/actions/.github/workflows/close-milestone.yml@v2
package-name:
uses: ComPWA/actions/.github/workflows/get-pypi-name.yml@v1
uses: ComPWA/actions/.github/workflows/get-pypi-name.yml@v2
pypi:
environment:
name: PyPI
Expand All @@ -24,9 +24,9 @@ jobs:
id-token: write
runs-on: ubuntu-24.04
steps:
- uses: ComPWA/actions/build-pypi-distribution@v1
- uses: ComPWA/actions/build-pypi-distribution@v2
- uses: pypa/gh-action-pypi-publish@release/v1
push:
if: startsWith(github.ref, 'refs/tags') && !github.event.release.prerelease
secrets: inherit
uses: ComPWA/actions/.github/workflows/push-to-version-branches.yml@v1
uses: ComPWA/actions/.github/workflows/push-to-version-branches.yml@v2
6 changes: 3 additions & 3 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@v1
uses: ComPWA/actions/.github/workflows/ci-docs.yml@v2
permissions:
pages: write
id-token: write
Expand All @@ -37,7 +37,7 @@ jobs:
python-version: "3.10"
specific-pip-packages: ${{ inputs.specific-pip-packages }}
pytest:
uses: ComPWA/actions/.github/workflows/pytest.yml@v1
uses: ComPWA/actions/.github/workflows/pytest.yml@v2
with:
additional-extras: all
coverage-target: tensorwaves
Expand All @@ -48,6 +48,6 @@ jobs:
if: inputs.specific-pip-packages == ''
secrets:
token: ${{ secrets.PAT }}
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v1
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2
with:
python-version: "3.10"
2 changes: 1 addition & 1 deletion .github/workflows/clean-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Remove caches
runs-on: ubuntu-24.04
steps:
- uses: ComPWA/actions/clean-caches@v1
- uses: ComPWA/actions/clean-caches@v2
with:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ inputs.ref }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Requirements
name: Update

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -12,12 +12,13 @@ on:
- epic/*
paths:
- .pre-commit-config.yaml
- uv.lock
schedule:
- cron: "0 3 7 */1 *"
workflow_dispatch:

jobs:
requirements:
uses: ComPWA/actions/.github/workflows/requirements.yml@v1
lock:
uses: ComPWA/actions/.github/workflows/lock.yml@v2
secrets:
token: ${{ secrets.PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/pr-linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ on:

jobs:
lint-pr:
uses: ComPWA/actions/.github/workflows/pr-linting.yml@v1
uses: ComPWA/actions/.github/workflows/pr-linting.yml@v2
20 changes: 10 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ ci:
- check-jsonschema
- mypy
- pyright
- uv-lock

repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: /data/local/redeboer/work/ComPWA/policy
rev: 565f235682bdafe8ea5c0d7e88220c95a919a26f
- repo: https://github.com/ComPWA/policy
rev: 0.5.0rc8
hooks:
- id: check-dev-files
args:
- --ci-test-extras=all
- --dev-python-version=3.10
- --doc-apt-packages=graphviz
- --no-prettierrc
- --pin-requirements=monthly
- --repo-name=tensorwaves
- --repo-title=TensorWaves
- --update-lock-files=monthly
- id: colab-toc-visible
- id: fix-nbformat-version
- id: remove-empty-tags
Expand Down Expand Up @@ -62,7 +62,7 @@ repos:
metadata.vscode
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.4
rev: v0.6.9
hooks:
- id: ruff
args: [--fix]
Expand All @@ -71,7 +71,7 @@ repos:
types_or: [python, pyi, jupyter]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand Down Expand Up @@ -115,7 +115,7 @@ repos:
- --in-place

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

- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v8.13.3
rev: v8.15.1
hooks:
- id: cspell

Expand All @@ -154,11 +154,11 @@ repos:
- python

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

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.20
rev: 0.4.22
hooks:
- id: uv-lock
27 changes: 14 additions & 13 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@ build:
os: ubuntu-24.04
tools:
python: "3.10"
apt_packages:
- graphviz
jobs:
post_install:
- python -m pip install 'uv>=0.2.0'
- python -m uv sync --extra=doc
formats:
- htmlzip

sphinx:
builder: dirhtml
configuration: docs/conf.py
fail_on_warning: true
commands:
- |-
export PIXI_HOME=$READTHEDOCS_VIRTUALENV_PATH
curl -fsSL https://pixi.sh/install.sh | bash
pixi global install graphviz uv
- |-
export UV_LINK_MODE=copy
uv run \
--extra doc \
--locked \
--with tox \
tox -e doc
mkdir -p $READTHEDOCS_OUTPUT
mv docs/_build/html $READTHEDOCS_OUTPUT
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
[![Spelling checked](https://img.shields.io/badge/cspell-checked-brightgreen.svg)](https://github.com/streetsidesoftware/cspell/tree/master/packages/cspell)
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)

TensorWaves is a fitter package that optimizes mathematical models to data samples. The
models can be any _symbolic_ mathematical expression that is then converted to any
Expand Down
30 changes: 19 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,14 @@ dev = [
"tensorwaves[jupyter]",
"tensorwaves[sty]",
"tensorwaves[test]",
"tox >=1.9", # for skip_install, use_develop
"tox",
]
doc = [
"Sphinx >=3",
"black",
"ipympl",
"jupyter",
"matplotlib",
"myst-nb >=0.14", # nb_ configuration prefixes
"pandas",
"sphinx-api-relink >=0.0.4",
"myst-nb",
"sphinx",
"sphinx-api-relink",
"sphinx-book-theme",
"sphinx-codeautolink[ipython]",
"sphinx-comments",
Expand All @@ -83,11 +80,12 @@ doc = [
"sphinx-thebe",
"sphinx-togglebutton",
"sphobjinv",
"tensorwaves[all]",
"tensorwaves[notebooks]",
]
jax = [
"jax",
"jaxlib",
"tensorwaves[all]",
]
jupyter = [
"jupyterlab",
Expand All @@ -99,6 +97,11 @@ jupyter = [
"python-lsp-server[rope]",
"tensorwaves[doc]",
]
notebooks = [
"black",
"ipympl",
"pandas",
]
numba = [
"numba",
]
Expand Down Expand Up @@ -138,15 +141,15 @@ test = [
test-types = [
"ipython", # test _repr_pretty_
"pytest",
"pytest-mock >=3.3.0",
"pytest-mock",
]
tf = [
"numpy<2",
"tensorflow !=2.15.0.post1", # https://github.com/ComPWA/tensorwaves/actions/runs/7147814088/job/19467965144?pr=509
"tensorflow >=2.4", # tensorflow.experimental.numpy
]
types = [
"sphinx-api-relink >=0.0.4",
"sphinx-api-relink",
"tensorwaves[jax]",
"tensorwaves[pwa]",
"tensorwaves[test-types]",
Expand Down Expand Up @@ -481,6 +484,8 @@ commands =
pytest {posargs}
description = Run all unit tests
passenv = *
setenv =
PYTHONHASHSEED = 0
[testenv:bench]
allowlist_externals =
Expand Down Expand Up @@ -525,6 +530,7 @@ commands =
docs/ docs/_build/html
description = Build documentation and API through Sphinx
setenv =
{[testenv]setenv}
PYTHONWARNINGS =
[testenv:docnb]
Expand All @@ -544,13 +550,15 @@ setenv =
[testenv:doclive]
allowlist_externals =
sphinx-autobuild
base = doc
commands =
sphinx-autobuild \
--builder=dirhtml \
--ignore=docs/_build/ \
--ignore=docs/api/ \
--ignore=docs/usage/logs/ \
--open-browser \
--port=0 \
--re-ignore='.*/__pycache__/.*' \
--re-ignore='.*/.ipynb_checkpoints/.*' \
--re-ignore='.*/.virtual_documents/.*' \
Expand Down Expand Up @@ -598,7 +606,7 @@ description = Run all notebooks with pytest
allowlist_externals =
pre-commit
commands =
pre-commit run {posargs} --all-files
pre-commit run --all-files {posargs}
description = Perform all linting, formatting, and spelling checks
setenv =
SKIP = pyright
Expand Down
Loading

0 comments on commit 3bfee18

Please sign in to comment.