11# Python Project Template
22
33[ ![ CI] ( https://github.com/ahcode0919/python-project-template/actions/workflows/python.yml/badge.svg?branch=main )] ( https://github.com/ahcode0919/python-project-template/actions/workflows/python.yml )
4+ [ ![ Security] ( https://github.com/ahcode0919/python-project-template/actions/workflows/security.yml/badge.svg?branch=main )] ( https://github.com/ahcode0919/python-project-template/actions/workflows/security.yml )
45[ ![ gitleaks] ( https://img.shields.io/badge/protected%20by-gitleaks-blue )] ( https://github.com/gitleaks/gitleaks )
56
67Baseline Python project template
@@ -11,10 +12,10 @@ Project supports local development and VSCode Dev container development
1112
1213### Local Development Installation
1314
14- Note: Project uses ` uv ` and ` just ` to manage project configuration and commands
15+ Note: Project uses ` uv ` (0.13.x, enforced by ` required-version ` in ` pyproject.toml ` ) and ` just ` to
16+ manage project configuration and commands
1517
16- * Install dependencies via Homebrew - ` brew bundle install `
17- * Sync project - ` just sync `
18+ * Install tools and sync the project - ` just setup ` (runs ` brew bundle install ` , then ` just sync ` )
1819
1920### VS Code Dev Container
2021
@@ -24,16 +25,36 @@ Note: Project uses `uv` and `just` to manage project configuration and commands
2425* Install recommended extensions
2526* Reopen in container using Remote Development Container menu
2627
28+ The base image, ` just ` , and ` uv ` are pinned by version and digest in ` .devcontainer/Dockerfile `
29+ and updated by Dependabot. To change the Python version, edit the ` FROM ` line.
30+
2731## Project Commands
2832
33+ * ` just setup ` - install Homebrew tools from the ` Brewfile ` and sync the project
2934* ` just sync ` - sync project dependencies (all groups)
3035* ` just lint ` - type check, lint, format, and spellcheck project files (applies fixes)
3136* ` just ci-lint ` - run the same checks without modifying files (used in CI)
3237* ` just test ` - run unit tests
3338* ` just prek ` - run pre-commit hooks via prek
3439* ` just git-leaks ` - scan staged changes for secrets with gitleaks
40+ * ` just zizmor ` - audit GitHub Actions workflows for security issues
41+ * ` just set-github-labels ` - create or update the release labels on GitHub (requires ` gh auth login ` )
3542* ` uv add {package} ` - install a dependency
3643
44+ ## CI and Security
45+
46+ | Workflow | Runs on | Purpose |
47+ | ------------------------------------------------- | ---------------------------- | ---------------------------------------------- |
48+ | ` python.yml ` | push / PR to ` main ` | lint and unit tests |
49+ | ` security.yml ` | push to ` main ` , all PRs | zizmor workflow audit, gitleaks secret scan |
50+ | ` release-drafter.yml ` | push to ` main ` , PRs | update the draft release, label PRs |
51+ | ` release.yml ` | manual | publish a release |
52+
53+ * GitHub Actions are pinned to full commit SHAs, with the version in a trailing comment
54+ * Dependabot (` .github/dependabot.yml ` ) checks weekly for updates to GitHub Actions, Python
55+ dependencies, the dev container image, and dev container features. New releases wait 7 days
56+ before an update is proposed. Dependabot PRs get the ` dependencies ` label
57+
3758## Releases
3859
3960Releases are managed with [ Release Drafter] ( https://github.com/release-drafter/release-drafter ) ,
@@ -56,6 +77,7 @@ labels; other repository labels (e.g. `good first issue`, `question`) are ignore
5677 has PRs with different labels, the largest bump wins
5778* Release labels are added automatically from the PR's branch name prefix (` feat/ ` , ` fix/ ` , ` chore/ ` ,
5879 ` ci/ ` , ` docs/ ` , ` refactor/ ` ) and from the files it changes. You can add or change them by hand
80+ * Run ` just set-github-labels ` once to create the release labels in the GitHub repository
5981* Merging to ` main ` updates a draft GitHub Release with the next version and notes
6082* To release, run the ** Release** workflow from the Actions tab. It bumps the version in
6183 ` pyproject.toml ` /` uv.lock ` , updates ` CHANGELOG.md ` , tags the release, and uploads build artifacts
0 commit comments