Skip to content

Commit

Permalink
Merge pull request #239 from jond01/chore/uv-dependency-groups
Browse files Browse the repository at this point in the history
Add dependency groups
  • Loading branch information
jond01 authored Nov 2, 2024
2 parents e7b6112 + 909d323 commit 07e3de9
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
RUFF_CACHE_DIR: /opt/.cache/ruff
MYPY_CACHE_DIR: /opt/.cache/mypy
FORCE_COLOR: 1
UV_NO_SYNC: true
steps:
- uses: actions/checkout@v4
- name: Get uv version
Expand All @@ -32,6 +33,7 @@ jobs:
version: ${{ steps.uv-version.outputs.version }}
enable-cache: true
cache-dependency-glob: uv.lock
cache-suffix: pre-commit
- name: Install dependencies
# This step may also install the Python version set in the `.python-version` file on the fly if not available
run: uv sync
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
env:
FORCE_COLOR: 1
UV_PYTHON: ${{ matrix.python-version }}
UV_NO_SYNC: true
steps:
- uses: actions/checkout@v4
- name: Get uv version
Expand All @@ -48,9 +49,10 @@ jobs:
version: ${{ steps.uv-version.outputs.version }}
enable-cache: true
cache-dependency-glob: uv.lock
cache-suffix: tests
- name: Install dependencies
# This step may also install the Python version set by the `UV_PYTHON` env var on the fly if not available
run: uv sync
run: uv sync --no-group lint --no-group type-check
- name: Run live tests (needing an internet connection)
run: uv run coverage run -m pytest -m live
- name: Run offline tests
Expand Down
18 changes: 13 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,27 @@ Repository = "https://github.com/jond01/xil"
Documentation = "https://github.com/jond01/xil#readme"
"Bug Tracker" = "https://github.com/jond01/xil/issues"

[tool.uv]
dev-dependencies = [
# Testing
[dependency-groups]
test = [
"pytest>=8.3.2",
"coverage>=7.6.1",
# Linting
]
lint = [
"pre-commit>=3.8.0",
"pylint>=3.2.6",
# Type-checking
]
type-check = [
"mypy>=1.11.2",
"pandas-stubs>=2.2.2.240807",
]

[tool.uv]
default-groups = [
"test",
"lint",
"type-check",
]

[tool.ruff]
target-version = "py311"
required-version = ">=0.5.1"
Expand Down
26 changes: 17 additions & 9 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 07e3de9

Please sign in to comment.