How to contribute

First steps

  1. Fork our repo, here's the guide on forking
  2. Clone your new repo (forked repo) to have a local copy of the code
  3. Apply the required changes!
  4. Send a Pull Request to our original repo. Here's the helpful guide on how to do that

Dependencies

We use poetry to manage the dependencies.

To install them you would need to run install command:

poetry install

To activate your virtualenv run poetry shell.

Two magic command

Run make autotests or make lint to run checks in docker/

Tests

We use pytest and flake8 for quality control. We also use wemake_python_styleguide.

To run all tests:

pytest

To run linting:

flake8 .

Before submitting

Before submitting your code please do the following steps:

  1. Run pytest to make sure everything was working before
  2. Add any changes you want
  3. Add tests for the new changes
  4. Edit documentation if you have changed something significant
  5. Update CHANGELOG.md with a quick summary of your changes
  6. Run pytest again to make sure it is still working
  7. Run flake8 to ensure that style is correct

You can run everything at once with make autotests, run make help for more details.

Notes for maintainers

This section is intended for maintainers only. If you are not a maintainer (or do not know what it means), just skip it. You are not going to miss anything useful.

Making new release

Releases are shipped using git-flow https://danielkummer.github.io/git-flow-cheatsheet/index.html

This command has to be run only once to set up git flow, keep default value for all parameters.

git flow init
  1. Update master and develop branches

    git checkout develop && git pull
    git checkout master && git pull
    
  2. Start a new release

    git flow release start <VERSION>
    

    <VERSION> - new release version

  3. Update CHANGELOG.md

  4. Update project version

    poetry version <VERSION>
    
  5. Commit project configuration with the new version

    git commit -m "bump version" pyproject.toml
    
  6. Finish building a release

    git flow release finish <VERSION>
    
  7. Push all the changes into the repository

    git push origin master develop --follow-tags
    
  8. Create a new release specifying pushed tag