This project is a simple template that I am building for my own python projects. The setup and plan are based mostly on these pieces of writing and existing projects:
- Hypermodern Python by Claudio Jolowicz
- This answer by michau on StackOverflow
- An opinionated guide to Python environments in 2021 by James Ravenscroft
- PyScaffold
- cookiecutter-cruft-poetry-tox-pre-commit-ci-cd
I am creating setup that suited my needs and preferences, while allowing me to learn the tools involved. That is why, if you read the references above, you will notice that some significant decisions are different, while the fundamental idea remains.
In the (near?) future I will convert this template-sandbox into a proper cruft/cookicutter/cookieninja template.
In the meantime, when you fork the project, you can set it up using these steps:
conda create --name <environment name> --file conda-linux-64.lock
poetry install --all-extras
pre-commit install
- Get a URL with localtunnel:
./createtunnel.sh
- Setup an OAuth application for Woodpecker on Github.
- Setup a personal token for Renovate
- Create a TestPyPI account and token
- Fill in the missing variables from
docker-compose.yml
in new file called.env
in the project root. - Start the CI and Renovate with
docker compose up -d
- Log in into the Woodpecker container (e.g. if nothing was changed, by going to
localhost:8082
) - Enable the repository
- Add the TestPyPI token as a secret named
test_pypi_token
- Check that the project can be built locally using
nox
- AUTHORS.md
- CHANGELOG.md
- CONTRIBUTING.md
- README.md
- Conda/Mamba
- Poetry
- pre-commit
- REUSE
- REUSE pre-commit hook
- pytest
- Coverage.py
- pytest-cov
- nox
- pytest-mock
- Hypothesis
- MutMut
- ruff (keep this in mind: ruff #2459)
- ruff pre-commit hook
- black
- black pre-commit hook
- safety
- pylint
- pre-commit-hooks
- end-of-file-fixer
- trailing-whitespace-fixer
- check-yaml
- debug-statements
- check-added-large-files
- check-ast
- Mypy (Consider
dmypy
in the future) - Mypy pre-commit hook (Consider removing due to time consumed)
- Typeguard
- xdoctest
- Sphinx
- MyST (the docstrings still need to use rST)
- autodoc
- napoleon
- sphinx-autodoc-typehints
- towncrier
- Trufflehog (Consider removing as pre-commit hook due to time, consider changing to detect-secrets due to license issues)
- Woodpecker CI/CD setup (local) + Localtunnel script
- Build recipe
- Renovate
- TestPyPI
- PyPI (disabled by default)
- ReadTheDocs (disabled by default)
- structlog-sentry-logger