Skip to content

Latest commit

 

History

History
199 lines (134 loc) · 3.44 KB

CONTRIBUTING.md

File metadata and controls

199 lines (134 loc) · 3.44 KB

How to contribute

Dependencies

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.

Codestyle

After installation, you may execute code formatting.

make codestyle

Checks

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

Before submitting your code please do the following steps:

  1. Add any changes you want
  2. Add tests for the new changes
  3. Edit documentation if you have changed something significant
  4. Run make codestyle to format your changes.
  5. Run make lint to ensure that types, security and docstrings are okay.

Other help

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.

Detailed Makefile usage

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 uses isort, black and darglint 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 and releasing your package

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 as major, minor, or patch. For more details, refer to the Semantic Versions standard.
  • Make a commit to GitHub.
  • Create a GitHub release.
  • And... publish 🙂 poetry publish --build

📈 Releases

You can see the list of available releases on the GitHub Releases page.

We follow Semantic Versions specification.