Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX: define developer environment with uv #23

Merged
merged 33 commits into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
72f9b78
MAINT: freeze TR-024
redeboer Oct 11, 2024
951aa96
FIX: rename PyPI project to `compwa-report`
redeboer Oct 11, 2024
5ef0cb1
DX: switch to `pre-commit-uv`
redeboer Oct 11, 2024
2a2a2a3
DX: define developer environment with `uv`
redeboer Oct 17, 2024
3c1791c
MAINT: update lock files and dev environment
redeboer Oct 18, 2024
9ff13ad
MAINT: update lock files
web-flow Oct 18, 2024
fe52fef
DX: clean up `tox` configuration
redeboer Oct 18, 2024
ec7e5e4
MAINT: update lock files
web-flow Oct 18, 2024
b0690ee
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Oct 18, 2024
39dfb55
DOC: update Binder links
redeboer Oct 18, 2024
5c8f37b
DX: switch to Julia from julia-forge
redeboer Oct 23, 2024
e9828a4
DX: remove `pre-commit-uv` and `tox` from dev dependencies
redeboer Oct 23, 2024
dd7fa5e
MAINT: update lock files
redeboer Oct 23, 2024
2fe69f9
DX: switch to `pyproject-local-kernel`
redeboer Oct 23, 2024
5ad0355
MAINT: convert TRs to index directories
redeboer Oct 23, 2024
0567e4e
FIX: write exported figures to same notebook dir
redeboer Oct 24, 2024
2a5acee
DX: remove `pin-nb-requirements` pre-commit hook
redeboer Oct 23, 2024
b3bbf7f
DX: switch to Python 3.12 in developer environment
redeboer Oct 23, 2024
5022244
DX: make Ruff configuration per-notebook
redeboer Oct 24, 2024
c892134
DX: always run notebooks with `EXECUTE_NB`
redeboer Oct 24, 2024
8d5aa1d
FEAT: define dependencies per notebook
redeboer Oct 24, 2024
9afaf04
FIX: run notebooks with `uv run pytest`
redeboer Oct 24, 2024
c4c521b
MAINT: update lock files
web-flow Oct 24, 2024
6b62603
FIX: set `passenv` on `docnb` jobs
redeboer Oct 24, 2024
631ae47
MAINT: remove Colab installation cell for `ipympl`
redeboer Oct 24, 2024
3def23c
DX: add `ALL_NOTEBOOKS` option to run all notebooks
redeboer Oct 24, 2024
27153cd
TEMP: run notebooks on any PR
redeboer Oct 24, 2024
00246d2
MAINT: simplify notebooks workflow
redeboer Oct 24, 2024
77d6272
Revert "TEMP: run notebooks on any PR"
redeboer Oct 24, 2024
0a36011
MAINT: clean up `sty` dependencies
redeboer Oct 24, 2024
5aba2d9
MAINT: update Ruff formatting to v0.7.1
redeboer Oct 24, 2024
e4be9d0
FIX: do not update nested `Manifest.toml`
redeboer Oct 24, 2024
594b1b7
MAINT: update lock files
redeboer Oct 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .binder/postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
set -ex
curl -LsSf https://pixi.sh/install.sh | bash
export PATH="$HOME/.pixi/bin:$PATH"

pixi_packages="$(NO_COLOR= pixi list --explicit --no-install | awk 'NR > 1 {print $1}')"
if [[ -n "$pixi_packages" ]]; then
pixi global install $pixi_packages
fi
export PYTHONHASHSEED="0"
pixi clean cache --yes

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.12
7 changes: 5 additions & 2 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@
".readthedocs.yml",
".vscode/*",
"docs/conf.py",
"pyproject.toml",
"tox.ini"
"pyproject.toml"
],
"language": "en-US",
"overrides": [
Expand Down Expand Up @@ -89,6 +88,7 @@
"Mikhasenko",
"NumPy",
"parametrizations",
"Pixi",
"plotly",
"pyplot",
"QRules",
Expand Down Expand Up @@ -172,6 +172,7 @@
"iframe",
"imag",
"infty",
"installkernel",
"ioff",
"iplt",
"ipykernel",
Expand Down Expand Up @@ -242,6 +243,7 @@
"pycode",
"pyfunc",
"pygments",
"pyproject",
"pytest",
"quadpy",
"rankdir",
Expand Down Expand Up @@ -283,6 +285,7 @@
"unbinned",
"unnormalized",
"unsrt",
"venv",
"viridis",
"vmax",
"vmin",
Expand Down
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ indent_size = 4

[LICENSE]
indent_size = unset

[uv.lock]
indent_size = 4
14 changes: 4 additions & 10 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
if [ -e .venv ]; then
source .venv/bin/activate
elif [ -e venv ]; then
source venv/bin/activate
elif [ -e .pixi ]; then
watch_file pixi.lock
eval "$(pixi shell-hook)"
else
layout anaconda
fi
watch_file pixi.lock
eval "$(pixi shell-hook)"
uv sync --all-extras --quiet
source .venv/bin/activate
39 changes: 0 additions & 39 deletions .github/release-drafter.yml

This file was deleted.

16 changes: 0 additions & 16 deletions .github/workflows/cd.yml

This file was deleted.

8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,15 @@ 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
with:
apt-packages: graphviz
gh-pages: true
python-version: "3.12"
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@v1
with:
python-version: "3.12"
uses: ComPWA/actions/.github/workflows/pre-commit.yml@v2
4 changes: 2 additions & 2 deletions .github/workflows/clean-caches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ on:
jobs:
cleanup:
name: Remove caches
runs-on: ubuntu-22.04
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 }}
24 changes: 24 additions & 0 deletions .github/workflows/lock.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Update

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: |-
${{ github.ref != format('refs/heads/{0}', github.event.repository.default_branch) }}

on:
pull_request:
branches:
- main
- epic/*
paths:
- .pre-commit-config.yaml
- Manifest.toml
- pixi.lock
- uv.lock
workflow_dispatch:

jobs:
lock:
uses: ComPWA/actions/.github/workflows/lock.yml@v2
secrets:
token: ${{ secrets.PAT }}
36 changes: 9 additions & 27 deletions .github/workflows/notebooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,16 @@ on:
jobs:
pytest:
name: Test all notebooks
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
key: |
${{ github.workflow }}-${{ github.job }}-${{ runner.os }}-${{ hashFiles('.constraints/py3.*.txt', 'setup.cfg') }}
path: |
.pytest_cache
~/.cache/pip/
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Install dependencies
run: |
sudo apt-get -y install graphviz
pip install .[test]
- run: |
function run-nbmake() {
set +e
pytest --nbmake ${{ github.event.inputs.notebook-selector }}
error_code=$?
set -e
echo "Pytest returned error code $error_code"
case $error_code in
0|5) return 0;;
*) return $error_code;;
esac
}
run-nbmake
# cspell:ignore esac
python-version: "3.12"
- uses: astral-sh/setup-uv@v3
with:
enable-cache: true
- name: Install graphviz
run: sudo apt-get -y install graphviz
- name: Run all notebooks
run: uv run --extra test pytest ${{ github.event.inputs.notebook-selector }}
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
16 changes: 0 additions & 16 deletions .github/workflows/release-drafter.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ version.py

# Temporary files
*.pyc
*condaenv.*
.coverage
.coverage.*
.ipynb_checkpoints/
Expand All @@ -38,7 +37,6 @@ prof/
.pixi/
.tox/
*venv/
pixi.lock
pyvenv*/

# Settings
Expand All @@ -53,6 +51,5 @@ pyvenv*/
!.readthedocs.yml
!.vscode/*.json
!codecov.yml
!environment.yml
!pyrightconfig.json
.jupyter_ystore.db
Loading
Loading