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

Add dependency groups #239

Merged
merged 1 commit into from
Nov 2, 2024
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
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.