Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 5 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ jobs:
with:
python-version: "3.12"
- uses: actions/checkout@v7
- name: uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Updated documentation
run: |
git config --global user.email "${{ github.actor }}@users.noreply.github.com"
Expand All @@ -26,9 +30,7 @@ jobs:
git checkout documentation
git pull
git merge --allow-unrelated-histories -X theirs develop
python -m pip install --upgrade pip
pip install .
pip install pdoc
uv pip install . --group docs --system
echo $(ls -l docs)
pdoc --docformat numpy --math -o ./docs ./pyerrors
echo $(ls -l docs)
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install LaTeX
run: |
Expand All @@ -40,10 +42,7 @@ jobs:
dvipng texlive-latex-extra texlive-fonts-recommended cm-super

- name: Install
run: |
uv pip install . --system
uv pip install pytest pytest-xdist nbmake --system
uv pip install -U matplotlib!=3.7.0 --system # Exclude version 3.7.0 of matplotlib as this breaks local imports of style files.
run: uv pip install . --group examples --system

# The notebooks are independent (only 07 writes to disk), so execute them in
# parallel instead of serially.
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install
run: |
uv pip install . --system
uv pip install pytest pytest-cov pytest-benchmark hypothesis --system
uv pip install . --group test --system
uv pip freeze --system

- name: Run tests
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ jobs:
with:
python-version: "3.12"

- name: Install pypa/build
run: >-
python3 -m
pip install
build
--user
- name: uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install build tooling
run: uv pip install --group release --system

- name: Build wheel and source tarball
run: python3 -m build
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/ruff-action@v4.1.0
- uses: actions/setup-python@v7
with:
src: "./pyerrors"
python-version: "3.12"
- name: uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- name: Install lint tooling
run: uv pip install --group lint --system
- name: Run Ruff
run: ruff check pyerrors
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ and create your own branch for the feature or bug fix
cd pyerrors
git checkout -b feature/my_feature
```
Create a virtual environment and install the development dependencies with [uv](https://docs.astral.sh/uv/):
```
uv venv
source .venv/bin/activate
uv pip install --editable . --group test --group examples --group lint
```
After committing your changes please send a pull requests to the `develop` branch. A guide on how to create a pull request can be found [here](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).

### Documentation
Expand All @@ -26,7 +32,7 @@ pytest -vv -Werror
pytest --nbmake examples/*.ipynb
ruff check pyerrors
```
The tests require `pytest`, `pytest-cov`, `pytest-benchmark`, `hypothesis` and `nbmake`. To install the test dependencies one can run `pip install pyerrors[test]`. Linting is done with `ruff`, which can be installed via `pip install ruff` or run ad-hoc with `uvx ruff check pyerrors`.
Development dependencies are organized into the `test`, `examples`, `docs`, `lint`, and `release` groups in `pyproject.toml`. They are resolved against the newest compatible releases whenever they are installed.
Please make sure that all tests pass for a new pull requests.

To get a coverage report in html run
Expand Down
9 changes: 8 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,21 @@ dependencies = [
"odrpack>=0.5",
]

[project.optional-dependencies]
[dependency-groups]
test = [
"pytest",
"pytest-cov",
"pytest-benchmark",
"hypothesis",
]
examples = [
{ include-group = "test" },
"nbmake",
"pytest-xdist",
]
docs = ["pdoc"]
lint = ["ruff"]
release = ["build"]

[project.urls]
Homepage = "https://github.com/fjosw/pyerrors"
Expand Down