ISISComputingGroup / ISISComputingGroup/IBEX

Set up python `copier` template for python repositories

Open
#8,903 0 comments 0 reactions 0 assignees View on GitHub
training
Dominant language
No language data
Stars
6
Forks
2
Avg merge
16h 40m
Merged PRs (30d)
2

Description

We have a number of python repositories that use many common components, e.g.
- `pyproject.toml` metadata
- Github actions CI setup including dependabot
- `ruff` & `pyright` or `ty` configuration
- `pytest` + coverage configuration
- Docs/sphinx boilerplate configuration
- Github releases
- Optional `pypi` publishing
- License

Examples include `ibex_bluesky_core`, `genie`, `lewis`, `fastcs-secop`, `IBEX-device-generator` (currently a bit different, can be made consistent), `saluki`, and others.

As a developer I would like it to be easier to:
- Set up a new python project, following modern best-practices - i.e. in approximately the shape of the repositories above, with GHA, docs, tests, linting, releases all configured
- Update to newer best-practices across all python repos, as and when we choose to use different tools for linting/ci/docs/building etc
- But still allow each project to make local modifications to it's local configuration as makes sense for that specific project

A common tool for this in python is [copier](https://copier.readthedocs.io/en/stable/), see the following repositories for Diamond and ESS example templates using this tool:
- https://github.com/diamondLightSource/python-copier-template
- https://github.com/scipp/copier_template

Our "template structure" should look roughly like this: https://github.com/ISISComputingGroup/kafka_dae_diagnostics/commit/f716e5b85cdd21d941a6c585e326c72b168eb567 (but don't just _blindly_ copy that commit - there'll be a few things we want to adjust).

Copier "questions" to include:
- Repo/project name
- module name
- Whether to publish to pypi
- Docs theme colour
- CI (windows only / linux only / windows + linux)
- choice of `pyright` or `ty` for type-checking

### Acceptance criteria
- "Copier" template set up for our repository shape and our team's current practices, to make it easier to create new python projects and update the repository setup of existing projects as and when best practices change
- Document how to use it, either in the copier template repo itself, and/or in the dev wiki

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.