Skip to content

Contributing

The goal here is to make contributing to bocoel as painless as possible.

Development installation

First, clone and navigate into the project:

git clone https://github.com/rentruewang/bocoel
cd bocoel/

Alternatively, use ssh:

git clone git@github.com:rentruewang/bocoel
cd bocoel/

I used PDM in this project for dependency management. To install all dependencies (including development dependencies) with pdm, run

pdm install -G:all

Alternatively, use of pip is also allowed (although might be less robust due to lack of version solving)

pip install -e .

Both commands perform an editable installation.

Python code style

The code style in the project closely follows the recommended standard of python:

  1. ClassName in CamelCase.
  2. CONSTANTS or ENUM_VALUES in UPPER_SNAKE_CASE.
  3. All others in snake_case.
  4. Class imports are non-qualified (from module.path import ClassName), and do not use unqualified function names (however, upper case functions acting as classes are treated as classes, lower case classes are treated as functions).

Formatting

Use autoflake, isort, black for consistent formatting.

Prior to commiting, please run the following commands:

autoflake -i $(find -iname "*.py" ! -path '*/.venv/*' ! -name __init__.py) --remove-all-unused-imports
isort . --profile black
black .