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
1 change: 1 addition & 0 deletions .aws-architecture
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
linux/arm64
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI
permissions: read-all
on:
pull_request:
paths-ignore:
Expand Down
31 changes: 15 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
default_language_version:
python: python3.12
python: python3.13
default_stages:
- pre-push
repos:
- repo: local
hooks:
- id: black-apply
name: black-apply
entry: uv run black
- id: ruff-format
name: ruff-format
entry: uv run ruff format --diff
language: system
pass_filenames: true
types: ["python"]
types: [ "python" ]

- id: mypy
name: mypy
entry: uv run mypy
language: system
pass_filenames: true
types: ["python"]
exclude: "tests/"
- id: ruff-apply
name: ruff-apply
entry: uv run ruff check --fix
types: [ "python" ]
exclude: "(tests/|output/|migrations/)"

- id: ruff-check
name: ruff-check
entry: uv run ruff check
language: system
pass_filenames: true
types: ["python"]
- id: pip-audit
name: pip-audit
entry: uv run pip-audit
language: system
pass_filenames: false
types: [ "python" ]
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.12
3.13
40 changes: 17 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,26 @@ help: # Preview Makefile commands
/^[-_[:alpha:]]+:.?*#/ { printf " %-15s%s\n", $$1, $$2 }' $(MAKEFILE_LIST)

# ensure OS binaries aren't called if naming conflict with Make recipes
.PHONY: help venv install update test coveralls lint black mypy ruff safety lint-apply black-apply ruff-apply
.PHONY: help install venv update test coveralls lint lint-fix security my-app

##############################################
# Python Environment and Dependency commands
##############################################

install: .venv .git/hooks/pre-commit # Install Python dependencies and create virtual environment if not exists
install: .venv .git/hooks/pre-commit .git/hooks/pre-push # Install Python dependencies and create virtual environment if not exists
uv sync --dev

.venv: # Creates virtual environment if not found
@echo "Creating virtual environment at .venv..."
uv venv .venv

.git/hooks/pre-commit: # Sets up pre-commit hook if not setup
@echo "Installing pre-commit hooks..."
uv run pre-commit install
.git/hooks/pre-commit: # Sets up pre-commit commit hooks if not setup
@echo "Installing pre-commit commit hooks..."
uv run pre-commit install --hook-type pre-commit

.git/hooks/pre-push: # Sets up pre-commit push hooks if not setup
@echo "Installing pre-commit push hooks..."
uv run pre-commit install --hook-type pre-push
Comment on lines +15 to +28
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The install recipe still installs a pre-commit hook (in addition to pre-push), but .pre-commit-config.yaml sets default_stages: [pre-push], so the commit-time hook will be a no-op (and contradicts the stated goal of “hooks only on push”). Consider removing .git/hooks/pre-commit from install (and the corresponding target), or expanding default_stages to include pre-commit if you do want commit-time enforcement.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@ghukill ghukill Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted, but we want the ability to modify the default_stages in .pre-commit-config.yaml and have the hooks ready.


venv: .venv # Create the Python virtual environment

Expand All @@ -41,31 +45,21 @@ coveralls: test # Write coverage data to an LCOV report
uv run coverage lcov -o ./coverage/lcov.info

####################################
# Code quality and safety commands
# Code linting and formatting
####################################

lint: black mypy ruff safety # Run linters

black: # Run 'black' linter and print a preview of suggested changes
uv run black --check --diff .

mypy: # Run 'mypy' linter
lint: # Run linting, alerts only, no code changes
uv run ruff format --diff
uv run mypy .

ruff: # Run 'ruff' linter and print a preview of errors
uv run ruff check .

safety: # Check for security vulnerabilities
uv run pip-audit

lint-apply: black-apply ruff-apply # Apply changes with 'black' and resolve 'fixable errors' with 'ruff'

black-apply: # Apply changes with 'black'
uv run black .

ruff-apply: # Resolve 'fixable errors' with 'ruff'
lint-fix: # Run linting, auto fix behaviors where supported
uv run ruff format .
uv run ruff check --fix .

security: # Run security / vulnerability checks
uv run pip-audit

##############################
# CLI convenience commands
##############################
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ A template repository for creating Python CLI applications.

1. Rename "my_app" to the desired app name across the repo. (May be helpful to do a project-wide find-and-replace).
2. Update Python version if needed.
3. Install all dependencies with `make install` to create initial Pipfile.lock with latest dependency versions.
3. Install all dependencies with `make install` to install dependencies and set up the development environment.
4. Add initial app description to README and update initial required ENV variable documentation as needed.
5. Update license if needed (check app-specific dependencies for licensing terms).
6. Check Github repository settings:
Expand Down
10 changes: 2 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[project]
name = "my-app"
version = "2.0.0"
requires-python = ">=3.12"
requires-python = ">=3.13"

dependencies = [
"click>=8.2.1",
Expand All @@ -14,7 +14,6 @@ dependencies = [

[dependency-groups]
dev = [
"black>=25.1.0",
"coveralls>=4.0.1",
"mypy>=1.17.1",
"pip-audit>=2.9.0",
Expand All @@ -23,9 +22,6 @@ dev = [
"ruff>=0.12.8",
]

[tool.black]
line-length = 90

[tool.mypy]
disallow_untyped_calls = true
disallow_untyped_defs = true
Expand All @@ -35,9 +31,7 @@ exclude = ["tests/"]
log_level = "INFO"

[tool.ruff]
target-version = "py312"

# set max line length
target-version = "py313"
line-length = 90

# enumerate all fixed violations
Expand Down
Loading