Skip to content

Commit

Permalink
MNT: migrate requirement files to PEP 735 dependency groups
Browse files Browse the repository at this point in the history
  • Loading branch information
neutrinoceros committed Nov 23, 2024
1 parent d25c96b commit b290e78
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 33 deletions.
9 changes: 0 additions & 9 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,6 @@

version: 2
updates:
- package-ecosystem: pip
directory: /requirements
schedule:
interval: monthly
groups:
actions:
patterns:
- '*'

- package-ecosystem: github-actions
directory: /.github/workflows
schedule:
Expand Down
25 changes: 12 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ jobs:
unit-tests:
name: ${{matrix.os}} x py${{matrix.python-version}} ${{matrix.marker}}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
Expand Down Expand Up @@ -69,18 +70,16 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: |
**/requirements/tests.txt
**/pyproject.toml
- name: Test
env:
GPGI_PY_LIB: ${{ matrix.marker == 'PY_LIB' }}
shell: bash # for windows-compat (using `\` as a line continuation)
# pinning [email protected] inline so it's up to date
# even with UV_RESOLUTION=lowest-direct
run: |
uvx --with-requirements=requirements/tests.txt --no-build ${{ matrix.install-args }} \
[email protected] run --parallel-mode -m pytest --color=yes -ra
uv sync --only-group test --only-group covcheck --no-build ${{ matrix.install-args }}
uv run ${{ matrix.install-args }} \
coverage run --parallel-mode -m pytest --color=yes -ra
- name: Upload coverage data
# only using reports from ubuntu because
Expand All @@ -103,12 +102,12 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: |
**/requirements/tests.txt
**/pyproject.toml
- run: uv python install 3.13
- name: Run Image Tests
run: |
uvx --with-requirements=requirements/tests.txt --no-build \
uv sync --only-group test --no-build
uv run \
pytest --color=yes --mpl -m mpl_image_compare \
--mpl-generate-summary=html \
--mpl-results-path=gpgi_pytest_mpl_results \
Expand All @@ -117,7 +116,8 @@ jobs:
- name: Generate new image baseline
if: failure()
run: |
uvx --with-requirements=requirements/tests.txt --no-build \
uv sync --only-group test --no-build
uv run \
pytest --color=yes --mpl -m mpl_image_compare \
--mpl-generate-path=gpgi_pytest_mpl_new_baseline \
--last-failed
Expand Down Expand Up @@ -149,12 +149,12 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: |
**/requirements/tests.txt
**/pyproject.toml
- run: uv python install 3.13
- name: Run Concurrency Tests
run: |
uvx --with-requirements=requirements/tests.txt --no-build \
uv sync --only-group test --only-group concurrency --no-build
uv run \
pytest --color=yes --count 500 tests/test_concurrent.py
coverage:
Expand Down Expand Up @@ -205,14 +205,13 @@ jobs:
with:
enable-cache: true
cache-dependency-glob: |
**/requirements/typecheck.txt
**/pyproject.toml
- run: uv python install ${{ matrix.python-version }}
- name: Typecheck
run: |
uvx --with-requirements=requirements/typecheck.txt \
mypy src/gpgi
uv sync --only-group typecheck --no-build
uv run mypy src/gpgi
future:
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,3 @@ exclude src/gpgi/_lib.py
recursive-exclude tests *
exclude .pre-commit-config.yaml
exclude _typos.toml
exclude constraints/*
exclude requirements/*
18 changes: 17 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ text = "GPL-3.0"
Homepage = "https://github.com/neutrinoceros/gpgi"
Changelog = "https://github.com/neutrinoceros/gpgi/blob/main/CHANGELOG.md"

[dependency-groups]
covcheck = [
"coverage>=7.6.1",
]
concurrency = [
"pytest-repeat>=0.9.3",
]
test = [
"matplotlib>=3.6.0",
"pytest-mpl>=0.16.1",
"pytest>=7.0.0",
]
typecheck = [
"mypy>=1.13.0",
]

[tool.setuptools]
license-files = [
"LICENSE",
Expand Down Expand Up @@ -126,7 +142,7 @@ filterwarnings = [
build = "cp311-* cp312-* cp313-*"
build-frontend = "build[uv]"
build-verbosity = 1
before-test = "uv pip install -r requirements/tests.txt --no-build"
test-groups = ["test", "concurrency"]
test-command = [
"pytest --color=yes -ra {project}/tests",
"pytest --color=yes --count 500 {project}/tests/test_concurrent.py",
Expand Down
6 changes: 0 additions & 6 deletions requirements/tests.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements/typecheck.txt

This file was deleted.

0 comments on commit b290e78

Please sign in to comment.