First, install cookiecutter using pip:
$ pip install cookiecutter
Then, to create a new project, run:
$ cookiecutter gh:gabrielguarisa/poetry-template
project_name
: The name of the project.project_description
: A short description of the project.version
: The version of the project.author
: The name of the author.email
: The email of the author.github_name
: The author Github username.license
: The license of the project.minimal_python_version
: The minimal Python version required.line_length
: The line length of the project.
If you don't have a local development environment, you can follow these steps to set one up.
First, if you have not already, install poetry:
pip install poetry
Now, initialize poetry and pre-commit hooks:
make install && make install-pre-commit
You can run the tests with:
make test
This will run the tests with pytest and show information about the coverage.
To format the code, you can use the command:
make formatting
This will run the black, isort and )pyupgrade commands.
If you want to just check the formatting, use the command:
make check-formatting
To release a new version, you need to follow these steps:
-
Update the version with
poetry version <version>
and commit the changes. This project follows Semantic Versioning, so the version number should follow the format<major>.<minor>.<patch>
. Alternatively, you can also use the version asmajor
orminor
orpatch
, and the version number will be automatically incremented. -
Create a Github release with the new version number.
-
(Optional) Publish the new version to PyPI with
poetry publish --build
.
Some projects that inspired this repo: