A copier template that covers the boring bits of a new Ampel plugin, including:
- Skeleton directories for tests, config, plugin code, etc
- Project setup and core dependencies
- Pre-commit linting with ruff
- CI/CD
- Renovate setup
- Install copier
- Generate a new project skeleton:
copier copy gh:AmpelAstro/copier-ampel /path/to/new/project - Add code, tests, push to a new repo
Avoid changing content rendered by the template in your downstream project (.github, pyproject.toml, .pre-commit-config.yaml, renovate.json, etc). Instead, make a PR against this template repo, and once it is merged and a new release made, update your downstream repo with copier update. This way, all templated projects can benefit from updates.
The rendered template includes a CD stage that uses PyPI's Trusted Publisher workflow to publish packages. If you want your package to go to PyPI (a requirement for inclusion in e.g. the Ampel instance listening to the LSST alert stream), you need to do the following:
- Transfer your repository to the AmpelAstro organization
- Ask an Ampel maintainer to create a pending publisher for the package.
- Tag a release (either explicitly, or by incrementing the project version in pyproject.toml). When CI passes, a new release will be pushed to PyPI.
You may also keep the repo under your ownership and create a pending publisher yourself, but then also keep responsibility for maintenance.