ImperialCollegeLondon / ImperialCollegeLondon/python-template
Test template via `pytest`
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 14
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
Testing that the template actually works is currently a bit of a pain and has to be done manually. You have to run `cookiecutter` manually, then do whatever checks you want on top of the result (e.g. running `pre-commit`).
There are various checks we run as part of the CI workflow on templates generated with the different packaging options:
- Run `mypy`
- Run `pytest`
- Run `pre-commit`
- Run `mkdocs build --strict`
- Run `uv build`
We could make each of these separate `pytest` tests, running each of the commands with `subprocess.run`. This would make it easier to test locally and would provide other benefits (e.g. easy parameterisation).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing CI workflow and the tests around generated templates. Check how the template is rendered and how packaging options are represented, then assess separate pytest tests that invoke the listed commands with subprocess.run. Done means the generated templates can run mypy, pytest, pre-commit, mkdocs build --strict, and uv build through local tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- build-system, testing-qa
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100