Skip to content

Commit 07947b4

Browse files
committed
Migrate template to Copier
1 parent 25fa38c commit 07947b4

45 files changed

Lines changed: 928 additions & 1308 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitattributes‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
.devcontainer/* -linguist-detectable
2-
.github/** -linguist-detectable
1+
.github/** -linguist-detectable
2+
template/.devcontainer/* -linguist-detectable
3+
template/.github/** -linguist-detectable

‎.github/dependabot.yml‎

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
# Dependabot configuration.
1+
# Dependabot configuration for the template repository.
22
# See https://docs.github.com/en/code-security/dependabot/working-with-dependabot/dependabot-options-reference
3+
#
4+
# Python dependencies are not listed: template/pyproject.toml.jinja is a Copier template that
5+
# Dependabot can't parse. New projects resolve the latest versions with `uv lock`, and generated
6+
# projects get their own uv Dependabot entry from template/.github/dependabot.yml.
37
version: 2
48

59
updates:
6-
# GitHub Actions used in .github/workflows (updates SHA pins and their version comments)
10+
# GitHub Actions used by the template repo and by generated projects
711
- package-ecosystem: "github-actions"
8-
directory: "/"
12+
directories: ["/", "/template"]
913
schedule:
1014
interval: "monthly"
1115
cooldown:
@@ -15,30 +19,18 @@ updates:
1519
github-actions:
1620
patterns: ["*"]
1721

18-
# Python dependencies in pyproject.toml / uv.lock
19-
- package-ecosystem: "uv"
20-
directory: "/"
21-
schedule:
22-
interval: "monthly"
23-
cooldown:
24-
default-days: 7
25-
labels: ["dependencies"]
26-
groups:
27-
python-minor-and-patch:
28-
update-types: ["minor", "patch"]
29-
30-
# Base image in .devcontainer/Dockerfile
22+
# Base image in template/.devcontainer/Dockerfile
3123
- package-ecosystem: "docker"
32-
directory: "/.devcontainer"
24+
directory: "/template/.devcontainer"
3325
schedule:
3426
interval: "monthly"
3527
cooldown:
3628
default-days: 7
3729
labels: ["dependencies"]
3830

39-
# Features in .devcontainer/devcontainer.json
31+
# Features in template/.devcontainer/devcontainer.json
4032
- package-ecosystem: "devcontainers"
41-
directory: "/"
33+
directory: "/template"
4234
schedule:
4335
interval: "monthly"
4436
cooldown:

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Release
22

3+
# Publishes a template release. Copier reads the resulting vX.Y.Z tags as template versions.
4+
35
on:
46
workflow_dispatch:
57

@@ -12,62 +14,21 @@ permissions:
1214

1315
jobs:
1416
release:
15-
runs-on: ubuntu-latest
17+
runs-on: ubuntu-slim
1618
permissions:
1719
contents: write
1820
steps:
19-
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
20-
with:
21-
ref: main
22-
persist-credentials: false
23-
- name: Install uv
24-
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
25-
with:
26-
enable-cache: false
27-
version: ">=0.13,<0.14"
28-
2921
- name: Refresh draft release
3022
id: drafter
3123
uses: release-drafter/release-drafter@978bb0b30c5ee8cdd332ced253758157150d43f0 # v7.10.0
3224
env:
3325
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3426

35-
- name: Bump version
36-
env:
37-
VERSION: ${{ steps.drafter.outputs.resolved_version }}
38-
run: uv version "$VERSION"
39-
40-
- name: Update CHANGELOG.md
41-
uses: stefanzweifel/changelog-updater-action@a938690fad7edf25368f37e43a1ed1b34303eb36 # v1.12.0
42-
with:
43-
latest-version: ${{ steps.drafter.outputs.tag_name }}
44-
release-notes: ${{ steps.drafter.outputs.body }}
45-
46-
- name: Commit and push
47-
id: commit
48-
env:
49-
TAG: ${{ steps.drafter.outputs.tag_name }}
50-
run: |
51-
git config user.name "github-actions[bot]"
52-
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
53-
git add pyproject.toml uv.lock CHANGELOG.md
54-
git commit -m "Release $TAG"
55-
git push origin main
56-
echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
57-
27+
# Publishing the draft creates the vX.Y.Z tag at the commit this workflow ran on
5828
- name: Publish release
5929
env:
6030
GH_TOKEN: ${{ github.token }}
6131
RELEASE_ID: ${{ steps.drafter.outputs.id }}
62-
SHA: ${{ steps.commit.outputs.sha }}
6332
run: |
6433
gh api -X PATCH "repos/${{ github.repository }}/releases/$RELEASE_ID" \
65-
-F draft=false -f target_commitish="$SHA"
66-
67-
- name: Build and upload artifacts
68-
env:
69-
GH_TOKEN: ${{ github.token }}
70-
TAG: ${{ steps.drafter.outputs.tag_name }}
71-
run: |
72-
uv build
73-
gh release upload "$TAG" dist/*
34+
-F draft=false -f target_commitish="$GITHUB_SHA"

‎.github/workflows/security.yml‎

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,6 @@ jobs:
2424
uses: zizmorcore/zizmor-action@45d7276c9ca790aabd705e31ca99c6185c3e76dd # v0.8.1
2525
with:
2626
advanced-security: false
27-
pip-audit:
28-
runs-on: ubuntu-slim
29-
permissions:
30-
contents: read
31-
steps:
32-
- name: Checkout repository
33-
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
34-
with:
35-
persist-credentials: false
36-
- name: Install uv
37-
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
38-
with:
39-
enable-cache: false
40-
version: ">=0.13,<0.14"
41-
- name: Setup environment
42-
run: |
43-
uv tool install rust-just
44-
just sync
45-
- name: Audit dependencies
46-
run: |
47-
just audit
4827
gitleaks:
4928
runs-on: ubuntu-slim
5029
steps:

‎.github/workflows/template.yml‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Template Checks
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions: {}
10+
11+
jobs:
12+
actionlint:
13+
runs-on: ubuntu-slim
14+
permissions:
15+
contents: read
16+
steps:
17+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
18+
with:
19+
persist-credentials: false
20+
- name: Install uv
21+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
22+
with:
23+
enable-cache: false
24+
version: ">=0.13,<0.14"
25+
- name: Install just and actionlint
26+
run: |
27+
uv tool install rust-just
28+
uv tool install actionlint-py
29+
- name: Lint workflows
30+
run: |
31+
just actionlint
32+
render-and-check:
33+
# ubuntu-latest includes Node, which markdownlint-cli2 needs
34+
runs-on: ubuntu-latest
35+
permissions:
36+
contents: read
37+
steps:
38+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
39+
with:
40+
persist-credentials: false
41+
- name: Install uv
42+
uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
43+
with:
44+
enable-cache: false
45+
version: ">=0.13,<0.14"
46+
- name: Install just
47+
run: |
48+
uv tool install rust-just
49+
- name: Render a project and run its checks
50+
run: |
51+
just check
52+
# Same markdownlint-cli2 version as the VS Code markdownlint extension
53+
- name: Markdownlint
54+
working-directory: _rendered/demo-project
55+
run: |
56+
npx --yes markdownlint-cli2@0.23.2 "**/*.md"

‎.gitignore‎

Lines changed: 8 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1,131 +1,12 @@
1-
# Byte-compiled / optimized / DLL files
1+
# Projects rendered by `just render` / `just check`
2+
_rendered/
3+
4+
# Local Python and docs artifacts
25
__pycache__/
3-
*.py[cod]
4-
*$py.class
6+
.cache/
7+
.coverage
8+
.venv/
9+
site/
510

611
# OS Stuff
712
.DS_Store
8-
9-
# C extensions
10-
*.so
11-
12-
# Distribution / packaging
13-
.Python
14-
build/
15-
develop-eggs/
16-
dist/
17-
downloads/
18-
eggs/
19-
.eggs/
20-
lib/
21-
lib64/
22-
parts/
23-
sdist/
24-
var/
25-
wheels/
26-
pip-wheel-metadata/
27-
share/python-wheels/
28-
*.egg-info/
29-
.installed.cfg
30-
*.egg
31-
MANIFEST
32-
33-
# PyInstaller
34-
# Usually these files are written by a python script from a template
35-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
36-
*.manifest
37-
*.spec
38-
39-
# Installer logs
40-
pip-log.txt
41-
pip-delete-this-directory.txt
42-
43-
# Unit test / coverage reports
44-
htmlcov/
45-
.tox/
46-
.nox/
47-
.coverage
48-
.coverage.*
49-
.cache
50-
nosetests.xml
51-
coverage.xml
52-
*.cover
53-
*.py,cover
54-
.hypothesis/
55-
.pytest_cache/
56-
57-
# Translations
58-
*.mo
59-
*.pot
60-
61-
# Django stuff:
62-
*.log
63-
local_settings.py
64-
db.sqlite3
65-
db.sqlite3-journal
66-
67-
# Flask stuff:
68-
instance/
69-
.webassets-cache
70-
71-
# Scrapy stuff:
72-
.scrapy
73-
74-
# Sphinx documentation
75-
docs/_build/
76-
77-
# PyBuilder
78-
target/
79-
80-
# Jupyter Notebook
81-
.ipynb_checkpoints
82-
83-
# IPython
84-
profile_default/
85-
ipython_config.py
86-
87-
# PEP 582; used by e.g. github.com/David-OConnor/pyflow
88-
__pypackages__/
89-
90-
# Celery stuff
91-
celerybeat-schedule
92-
celerybeat.pid
93-
94-
# SageMath parsed files
95-
*.sage.py
96-
97-
# Environments
98-
.env
99-
.venv
100-
env/
101-
venv/
102-
ENV/
103-
env.bak/
104-
venv.bak/
105-
106-
# Spyder project settings
107-
.spyderproject
108-
.spyproject
109-
110-
# Rope project settings
111-
.ropeproject
112-
113-
# mkdocs documentation
114-
/site
115-
116-
# mypy
117-
.mypy_cache/
118-
.dmypy.json
119-
dmypy.json
120-
121-
# Pyre type checker
122-
.pyre/
123-
124-
# Ruff
125-
.ruff_cache
126-
127-
# Claude
128-
.claude/*.local.*
129-
130-
# Dev Container
131-
.devcontainer/devcontainer-lock.json

‎.prekignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Directories prek skips when discovering nested projects (gitignore syntax).
2+
# template/prek.toml is for generated projects; its hooks can't run on the unrendered template.
3+
template/

‎Brewfile‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
brew "actionlint"
12
brew "gitleaks"
23
brew "just"
34
brew "markdownlint-cli2"
5+
brew "prek"
46
brew "uv"
57
brew "zizmor"

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6+
Release notes are generated from labeled pull requests by Release Drafter.
7+
8+
## [Unreleased]

0 commit comments

Comments
 (0)