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
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ repos:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending

# Ensure the uv.lock file has been updated
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.8.7
hooks:
- id: uv-lock
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ pre-commit.
uvx nox -s dev
```

### Validate uv.lock

```console
uvx nox -s lock
```

### Run tests and display coverage

```console
Expand All @@ -68,7 +74,7 @@ uvx nox -s test
Passing extra arguements to pytest:

```console
uvx nos -s test -- -vvv -x --full-trace
uvx nox -s test -- -vvv -x --full-trace
```

### Run linters
Expand Down
8 changes: 7 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# Define the default sessions run when `nox` is called on the CLI
nox.options.default_venv_backend = "uv"
nox.options.sessions = ["format", "lint", "test"]
nox.options.sessions = ["lock", "format", "lint", "test"]

# All linters and formatters are run with `uv run --active`
LINTERS: list[tuple[str, ...]] = [
Expand Down Expand Up @@ -123,6 +123,12 @@ def build_artifacts(session: nox.Session) -> None:
session.run("uv", "build")


@nox.session(name="lock", python=False)
def validate_lock_file(session: nox.Session) -> None:
"""Ensure the uv.lock file exists and is aligned with dependencies."""
session.run("uv", "lock")


@nox.session(name="upgrade", python=False)
def upgrade_dependencies(session: nox.Session) -> None:
"""Upgrade all versions of all dependencies."""
Expand Down