A Copier template for Python 3.13 projects managed with uv.
$ uv tool install copier
$ copier copy --trust gh:karshosphere/template-python path/to/projectCopier asks for:
- Project Name and an optional Project Description.
- Library Packs, any of:
- Data: matplotlib, numpy and pandas.
- Dantic: pydantic.
- GUI: PySide6.
- Serial: pyserial.
- SQL: SQLAlchemy.
- WebServer: FastAPI and uvicorn.
--trust lets the template run git and uv lock. Without uv installed, run uv lock in the dev container afterwards and commit uv.lock.
Your name, email and GitHub user come from ~/.config/copier/settings.yml, and are left empty without it:
defaults:
user_name: "karsh"
user_email: "karshmail@icloud.com"
github_user: "karnull"From the project root:
$ copier update --defaults --answers-file .copier-py-answers.ymlOlder projects need a one-off step:
- Before 2.1.0: move the answers file to the root first, with
git mv .copier-generic-project/.copier-py-answers.yml .copier-py-answers.yml. - Before 2.2.0: run
uv lockafter the update and commituv.lock, as the lock still holds the old fixed version.
Updating to 4.0.0 removes VERSION; the project's existing tags carry on as before.
- A
Makefile:make buildinstalls the locked dependencies and byte-compiles the package.make formatformats the sources with ruff;make format-dry-runfails if any need it.make testruns the tests with pytest.make releasebuilds a wheel and an sdist intodist/.
- A package version taken from the release tags by setuptools-scm, so there is nothing to bump.
- A dev container with Python, uv and make.
- The shared CI from template-github-ci: it runs the four make targets in the dev container, works out each release's version from the commit messages, and publishes a GitHub release on each merge to main.
- A
renovate.jsonusing the shared Renovate settings. The project owns it; updates never overwrite it.
- There is no
VERSIONfile or changelog. CI works out each release's version from the commit messages:Xfor a change that breakscopier updatein existing projects, marked with!after the type as infeat!:,Yforfeat:, andZfor anything else. Each merge to main is published as a GitHub release taggedvX.Y.Z, with the pull request's description as its notes. - Renovate keeps the pinned actions and images current in one weekly pull request, which merges as a
Zrelease with no other change. - Bring in a newer release of the shared CI from the repository root with
copier update -a .github/.copier-ci-answers.yml template.