A python cookiecutter application to create a new python project that uses poetry to manage its dependencies.
Project description
This is a modern Cookiecutter template that can be used to initiate a Python project with all the necessary tools for development, testing, and deployment. It supports the following features:
- Poetry for dependency management
- CI/CD with GitHub Actions
- Pre-commit hooks with pre-commit
- Code quality with black, ruff, mypy, and deptry
- Publishing to Pypi or Artifactory by creating a new release on GitHub
- Testing and coverage with pytest and codecov
- Documentation with MkDocs
- Compatibility testing for multiple versions of Python with Tox
- Containerization with Docker
Documentation - Example - PyPi
Quickstart
On your local machine, navigate to the directory in which you want to create a project directory, and run the following two commands:
pip install cookiecutter-poetry
ccp
Alternatively, install cookiecutter
and directly pass the URL to this
Github repository to the cookiecutter
command:
pip install cookiecutter
cookiecutter https://github.com/fpgmaas/cookiecutter-poetry.git
Create a repository on GitHub, and then run the following commands, replacing <project-name>
, with the name that you gave the Github repository and
<github_author_handle>
with your Github username.
cd <project_name>
git init -b main
git add .
git commit -m "Init commit"
git remote add origin git@github.com:<github_author_handle>/<project_name>.git
git push -u origin main
Finally, install the environment and the pre-commit hooks with
make install
You are now ready to start development on your project! The CI/CD pipeline will be triggered when you open a pull request, merge to main, or when you create a new release.
To finalize the set-up for publishing to PyPi or Artifactory, see here. For activating the automatic documentation with MkDocs, see here. To enable the code coverage reports, see here.
Acknowledgements
This project is partially based on Audrey Feldroy's's great cookiecutter-pypackage repository.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for cookiecutter_poetry-0.5.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e5c4eaabdc49890c376a8dce84475daa7058a26c1dc43a81548caf7966d9f2c7 |
|
MD5 | 19eebd39b89d0cb7ffdf43d14b0c6e21 |
|
BLAKE2b-256 | aaf7134bae2782b36c5e7fd4e16ad67f04c501ca67c973fe27a954a5b29c02a5 |
Hashes for cookiecutter_poetry-0.5.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1917f2ac5f863176caa494f35849ea88adbcc01008f6ecf8839f760157691274 |
|
MD5 | 428a5b7ef32c6ec80b84dd4259dc1787 |
|
BLAKE2b-256 | 73ef1250633f9f8912ff0a924fbf9f34ccb3b71c2c34a284d1c1907d05979e8a |