We use poetry
to manage
the dependencies. If you don't
have poetry
, you should install with make poetry-download
.
To install dependencies and prepare pre-commit
hooks you would need to run install
command:
make install
make pre-commit-install
To activate your virtualenv
run poetry shell
.
After installation, you may execute code formatting.
make codestyle
Many checks are configured for this project. Command make check-codestyle
will check black, isort and darglint.
Command make lint
applies all checks.
Before submitting your code please do the following steps:
- Add any changes you want
- Add tests for the new changes
- Edit documentation if you have changed something significant
- Run
make codestyle
to format your changes. - Run
make lint
to ensure that types, security and docstrings are okay.
You can contribute by spreading a word about this library. It would also be a huge contribution to write a short article on how you are using this project. You can also share your best practices with us.
Makefile
contains a lot of functions for faster development.
1. Download and remove Poetry
To download and install Poetry run:
make poetry-download
To uninstall
make poetry-remove
2. Install all dependencies and pre-commit hooks
Install requirements:
make install
Pre-commit hooks could be installed after git init
via
make pre-commit-install
3. Codestyle
Automatic formatting uses pyupgrade
, isort
and black
.
make codestyle
# or use synonym
make formatting
Codestyle checks only, without rewriting files:
make check-codestyle
Note:
check-codestyle
usesisort
,black
anddarglint
library
4. Type checks
Run mypy
static type checker
make mypy
5. Tests
Run pytest
make test
6. All linters
Of course there is a command to rule run all linters in one:
make lint
the same as:
make test && make check-codestyle && make mypy
7. Cleanup
Delete pycache files
make pycache-remove
Remove package build
make build-remove
Or to remove pycache and build run:
make clean-all
Building a new version of the application contains steps:
- Bump the version of your package
poetry version <version>
. You can pass the new version explicitly, or a rule such asmajor
,minor
, orpatch
. For more details, refer to the Semantic Versions standard. - Make a commit to
GitHub
. - Create a
GitHub release
. - And... publish 🙂
poetry publish --build
You can see the list of available releases on the GitHub Releases page.
We follow Semantic Versions specification.