Skip to content

Latest commit

 

History

History
123 lines (78 loc) · 3.36 KB

CONTRIBUTING.md

File metadata and controls

123 lines (78 loc) · 3.36 KB

Contributing

Managing dependencies

Poetry

To guarantee repeatable installations, all project dependencies are managed using Poetry. The project’s direct dependencies are listed in pyproject.toml. Running poetry lock generates poetry.lock which has all versions pinned.

You can install Poetry by using pip install --pre poetry or by following the official installation guide here.

If you're using a PyCharm, also install a Poetry Plugin.

Coding style

Project uses various tools to maintain a common coding style and help with development. To install all the development tools, run the following commands:

python -m pip install -r requirements_dev.txt

or use poetry:

poetry install

Pre-commit

Project uses the pre-commit tool to check and automatically fix any formatting issue before creating a git commit.

Run the following command to install pre-commit into your git hooks and have it run on every commit:

pre-commit install

For more information on how it works, see the .pre-commit-config.yaml configuration file.

Commit naming

Project using Conventional Commits - specification for adding human and machine-readable meaning to commit messages.

The commit message should be structured as follows:

Commit message structure:

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Examples:

feat: implemented graceful close
BREAKING CHANGE: close method become async
fix: wrong object type
docs: add profile description

Formatting

Project has a strict formatting policy enforced by the black formatting tool.

Typing

Project has a strict typing policy enforced by the mypy. All functions with static typing must be described with the typing module. For example:

from typing import List


def collect_integers(a: int, b: int) -> List[int]:
    return [a, b]

Linters

  • black to make sure your code is correctly formatted.

  • ruff used to replace Flake8 (plus dozens of plugins), isort, pydocstyle, yesqa, eradicate, pyupgrade, and autoflake.

  • mypy to check that your types correctly assigned and used.

EditorConfig

EditorConfig is a standard configuration file that aims to ensure consistent style across multiple programming environments.

Project’s repository contains an .editorconfig file describing our formatting requirements.

Most editors and IDEs support this file either directly or via plugins. See the list of supported editors and IDEs for detailed instructions.

If you make sure that your programming environment respects the contents of this file, you will automatically get correct indentation, encoding, and line endings.

Changelog

Our changelog is not autogenerated. If you've changed something matters, don't forget to add it to the [Unreleased] section of the Changelog