Add complete Python project base template#1
Merged
Conversation
Sets up the repository as a reusable base for any Python project: - Dockerfile: multi-stage build (dev target for dev containers, prod for deployment) - docker-compose.yml: app, dev, and test services - pyproject.toml: uv project config with ruff, mypy, pytest, bandit, pip-audit - .devcontainer/: VS Code dev container using the dev Dockerfile target - .vscode/: settings, recommended extensions, and debug launch configs - .github/workflows/: CI (lint, test, security scan, Docker build) + CodeQL - src/app/: minimal application entry point - tests/: pytest example with coverage - CLAUDE.md: AI context for Claude Code - .claude/commands/: /test, /lint, /security, /build slash commands https://claude.ai/code/session_01TiXyp1vCmxNP2ewP4s1TGH
Commits the generated lock file so CI and Docker builds resolve identical dependency versions across all environments. https://claude.ai/code/session_01TiXyp1vCmxNP2ewP4s1TGH
Correctness: - pytest: add pythonpath = ["src"] so bare pytest works without uv sync - pyproject.toml: remove dead `targets` key from [tool.bandit] (silently ignored) Developer experience: - pytest addopts: remove coverage flags; pass --cov=src explicitly in CI only - VS Code: set python.analysis.typeCheckingMode to "off" (defer to mypy strict) - pyproject.toml: remove warn_return_any/warn_unused_configs (already in strict) CI: - ci.yml: add enable-cache: true to all setup-uv steps - ci.yml: drop bandit from CI; CodeQL covers SAST with better data-flow analysis - ci.yml: add scope=dev/prod to Docker GHA cache steps to prevent collision - ci.yml: add --cov=src to test job run step Docker / devcontainer: - Dockerfile dev stage: add non-root devuser (uid 1000), remove redundant build-time uv sync (the venv volume always shadows it anyway) - devcontainer.json: change remoteUser from root to devuser - docker-compose.yml: remove confusing `dev` service (was just a pytest runner with a misleading name); single `test` service covers that use case https://claude.ai/code/session_01TiXyp1vCmxNP2ewP4s1TGH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets up the repository as a reusable base for any Python project:
https://claude.ai/code/session_01TiXyp1vCmxNP2ewP4s1TGH