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
3 changes: 3 additions & 0 deletions .github/workflows/python-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Dependency vulnerability audit
run: |
make audit
- name: Install dependencies
run: |
uv sync --all-extras --dev
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This repository is a modern Python template. When making changes, prefer the rep
- Use `ruff` for linting and formatting.
- Use `ty` for type checking.
- Use `pytest` for testing.
- Use `pip-audit` for dependency vulnerability checks.
- Use `uv audit` for dependency vulnerability checks.
- Use `prek` for repository hooks and pre-commit-style checks.

## Dependency Management Rules
Expand All @@ -32,7 +32,7 @@ This repository is a modern Python template. When making changes, prefer the rep
- Lint code: `uv run ruff check .`
- Type check: `uv run ty check src tests`
- Test: `uv run pytest`
- Audit dependencies: `uv run pip-audit`
- Audit dependencies: `uv audit --locked`

## Editing Guidance

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ test:
uv run pytest

audit:
uv run pip-audit
uv audit --locked

docs:
uv run sphinx-apidoc -f -o docs/source/ src/pytemplate
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pytemplate

This is a Python 3.14 package template called `pytemplate`. The project uses `uv` for dependency management, `ruff` for linting and formatting, `ty` for type checking, `pytest` with coverage for tests, `prek` for repository checks, and Sphinx for docs.
This is a Python 3.14 package template called `pytemplate`. The project uses `uv` for dependency management, `ruff` for linting and formatting, `ty` for type checking, `pytest` with coverage for tests, `prek` for repository checks, `uv audit` for dependency vulnerability scanning, and Sphinx for docs.

The extremely fast Python package and project manager, [uv](https://docs.astral.sh/uv/#getting-started), is required.

Expand Down Expand Up @@ -61,4 +61,4 @@ Use `make lint` to run `ruff`, `ty`, and `prek`.

## Dependency Audit

Use `make audit` or `uv run pip-audit` to scan the environment for known vulnerable packages.
Use `make audit` or `uv audit --locked` to scan locked dependencies for known vulnerabilities. The template also configures uv with a 7-day dependency cooldown so routine dependency resolution avoids newly uploaded packages while the package ecosystem has time to discover and report supply-chain compromises.
5 changes: 1 addition & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,7 @@ authors = [{ name = "Author", email = "author@email.com" }]
pytemplate = "pytemplate.main:main"

[dependency-groups]
audit = [
"pip-audit>=2.10.0",
]
dev = [
{ include-group = "audit" },
{ include-group = "docs" },
{ include-group = "lint" },
{ include-group = "test" },
Expand All @@ -30,6 +26,7 @@ test = ["pytest~=9.0.3", "pytest-cov~=7.1.0"]

[tool.uv]
default-groups = ["dev"]
exclude-newer = "7 days"

[project.urls]
Repository = "https://github.com/CQCL/pytemplate.git"
Expand Down
Loading