| title | Keeping Up to Date | ||
|---|---|---|---|
| description | Stay in sync with improvements to the pyproject-template | ||
| audience |
|
||
| tags |
|
Stay in sync with improvements to the pyproject-template.
Tip: The easiest way to check for updates is through the Template Manager:
python tools/pyproject_template/manage.pySelect option [3] Check for template updates to compare your project against the latest template, then [5] Mark as synced after applying changes.
Don't have the template management suite? The automated New Project Setup removes the suite by default so your consumer project starts with a clean tree. Reinstall it at any time with:
curl -sSL https://raw.githubusercontent.com/endavis/pyproject-template/main/bootstrap.py \ | python3 - --syncThis installs
tools/pyproject_template/back into your project so you can usemanage.py,check_template_updates.py, and the rest of the sync tooling described below.
Consider checking for template updates when:
- A new template version is released
- You want new tooling or workflow improvements
- You're starting a new phase of development
- Security updates are announced
The check_template_updates.py script compares your project against the latest template and shows what's different.
python tools/pyproject_template/check_template_updates.py- Fetches the latest template (or specified version)
- Opens CHANGELOG.md so you can review what changed
- Compares files and categorizes them:
- Modified: Files that exist in both but differ
- Missing: Files in template but not in your project
- Extra: Files in your project but not in template
- Generates a diff for each modified file
- Cleans up temporary files
# Compare against specific version
python tools/pyproject_template/check_template_updates.py --template-version v2.2.0
# Skip opening CHANGELOG in editor
python tools/pyproject_template/check_template_updates.py --skip-changelog
# Keep downloaded template for manual inspection
python tools/pyproject_template/check_template_updates.py --keep-templateComparing your project against the latest pyproject-template...
Latest template release: v2.3.0
Template extracted to tmp/pyproject-template-2.3.0
Opening CHANGELOG.md for review...
(Close the editor when you're done)
=== Comparison Results ===
Modified files (differ from template):
- .github/workflows/ci.yml
- dodo.py
- .pre-commit-config.yaml
Missing files (in template, not in project):
- .github/ISSUE_TEMPLATE/chore.yml
- docs/template/updates.md
Your project-specific files (not in template):
- src/mypackage/custom_module.py
- tests/test_custom.py
Would you like to see diffs for modified files? [y/N]
| Category | Meaning | Action |
|---|---|---|
| Modified | File exists in both but content differs | Review diff, merge selectively |
| Missing | New file in template you don't have | Consider adding if useful |
| Extra | Your project-specific files | Keep as-is (expected) |
These files typically should be kept in sync:
.github/workflows/*.yml- CI/CD improvements.pre-commit-config.yaml- New hooks or version bumpsdodo.py- New tasks or improvementstools/pyproject_template/*.py- Template tooling
These may have project-specific customizations:
pyproject.toml- Your dependencies differmkdocs.yml- Your navigation differsREADME.md- Your content differs.github/CONTRIBUTING.md- May have project-specific rules
These are project-specific:
src/your_package/*- Your codetests/*- Your testsdocs/*.md- Your documentation contentCHANGELOG.md- Your release history
-
Run the comparison:
python tools/pyproject_template/check_template_updates.py --keep-template
-
Review the CHANGELOG to understand what changed and why
-
For each modified file, decide:
- Accept template version: Copy from
tmp/pyproject-template-*/ - Keep your version: No action needed
- Merge selectively: Manually combine changes
- Accept template version: Copy from
-
For missing files, decide:
- Add the file: Copy from template
- Skip: Not needed for your project
-
Test your changes:
doit check
-
Commit the updates:
git add -A git commit -m "chore: update from pyproject-template vX.Y.Z"
For complex merges, use your preferred diff tool:
# Compare specific file
diff -u your_file.py tmp/pyproject-template-*/your_file.py
# Use visual diff tool
code --diff your_file.py tmp/pyproject-template-*/your_file.pyIf you're using an AI agent (Claude, Codex, etc.) to perform the synchronization, see the AI Sync Checklist for a structured, step-by-step guide covering all phases from pre-flight through commit.
-
Update regularly - Small, frequent updates are easier than large ones
-
Read the CHANGELOG - Understand what changed before merging
-
Test after updating - Always run
doit checkafter merging changes -
Commit updates separately - Keep template updates in their own commits
-
Document deviations - If you intentionally differ from template, note why
If you're behind a proxy or have network issues:
# Download template manually
wget https://github.com/endavis/pyproject-template/archive/refs/heads/main.zip
unzip main.zip -d tmp/
# Compare manually
diff -r your_project/ tmp/pyproject-template-main/If your project has diverged significantly:
- Focus on critical files first (CI, pre-commit)
- Skip content files (docs, README)
- Consider a fresh migration if heavily outdated