https://github.com/diamondlightsource/python-copier-template
Diamond's opinionated copier template for pure Python projects managed by pip
https://github.com/diamondlightsource/python-copier-template
Last synced: 3 months ago
JSON representation
Diamond's opinionated copier template for pure Python projects managed by pip
- Host: GitHub
- URL: https://github.com/diamondlightsource/python-copier-template
- Owner: DiamondLightSource
- License: apache-2.0
- Created: 2023-11-29T16:40:43.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-10T10:48:38.000Z (3 months ago)
- Last Synced: 2025-02-10T11:35:07.572Z (3 months ago)
- Language: Jinja
- Homepage:
- Size: 6.12 MB
- Stars: 5
- Watchers: 23
- Forks: 5
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
- Contributing: .github/CONTRIBUTING.md
Awesome Lists containing this project
README
[](https://github.com/DiamondLightSource/python-copier-template/actions/workflows/ci.yml)
[](https://www.apache.org/licenses/LICENSE-2.0)# python-copier-template
Diamond's opinionated [copier](https://copier.readthedocs.io) template for pure Python projects managed by pip. It can be optionally used to:
- Create new projects from
- Update existing projects in line with it
- Keep projects in sync with changes to it
- Provide a source of inspiration to cherry-pick fromSource |
:---: | :---:
Documentation |
Releases |It integrates the following tools:
- [setuptools](https://setuptools.pypa.io) and [setuptools-scm](https://setuptools-scm.readthedocs.io) for packaging
- [pip](https://pip.pypa.io) to manage installation
- [pytest](https://docs.pytest.org) for code testing and coverage
- [pre-commit](https://pre-commit.com) to run linting and formatting such as [ruff](https://docs.astral.sh/ruff)
- [pyright](https://microsoft.github.io/pyright) or [mypy](https://www.mypy-lang.org) for static type checking
- [sphinx](https://www.sphinx-doc.org) for tutorials, how-to guides, explanations and reference documentation
- [tox](https://tox.wiki) to run the above tasks locally and in CI
- [GitHub Actions](https://docs.github.com/en/actions) to provide CI and deployment to PyPI and GitHub Pages
- [VSCode](https://code.visualstudio.com/docs) settings for running the above tools on save## Example
You can see the template in action in the [example project](https://github.com/DiamondLightSource/python-copier-template-example). This is an up to date expansion of the template to illustrate how it looks with all the options enabled.
## Create a new project via Developer Portal
> [!NOTE]
> Template creation from the developer portal is currently under construction, so these instructions do not work yetVisit and you will see a list of templates that you can create. Pick the one marked `Python Template` and fill in the details of the project.
## Create a new project from the commandline
You will need to `pip install copier` inside an activated `venv` from python3.10 or later, then you can create a new module via:
```
mkdir /path/to/my-project
# The --trust argument is required to run setup tasks such as initializing a git repository
copier copy --trust gh:DiamondLightSource/python-copier-template /path/to/my-project
```You can also use it via `pipx run copier` if you have that installed.
See https://DiamondLightSource.github.io/python-copier-template for more detailed documentation.