Skip to content

Latest commit

 

History

History
84 lines (71 loc) · 2.95 KB

CONTRIBUTING.md

File metadata and controls

84 lines (71 loc) · 2.95 KB

Contributing to PathOfBuilding-Python

Setting up a development installation

  • This project targets Python 3.10. You can install it from here.
  • For dependency management, we use poetry. Install it like so (Powershell):
    (Invoke-WebRequest -Uri https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python -
  • Run this command to clone the repository:
    git clone -b dev https://github.com/PathOfBuildingCommunity/PathOfBuilding.git
  • Afterwards, run this command to install all dependencies:
    poetry install

Before submitting your PR

Style guide

  • Code: PEP 8
  • Docstrings: PEP 257
  • Type hints: PEP 484
  • Formatting: black and isort
  • Commit message: Follow the Conventional Commits guidelines
  • Branch: Pull requests must be created against the dev branch. It is strongly recommended creating a new branch off of dev to contain your proposed changes.

Here's a primer on the specifics:

  • Class/type names: CamelCase
  • Variable/function/module/file names: snake_case.
  • Variables with values that do not change during program execution: UPPER_SNAKE_CASE. These could be literals or enum variants.
  • Mark module- or class-level implementation details by prepending a single underscore, like _variable, _method.
  • Do not shadow built-ins (even id, help and the like). Instead, append a single underscore, like id_, `help_.
  • Likewise for reserved keywords (class_, import_, etc. Please no klass, `clazz or similar!)

In case of contradictions between individual guidelines, black is right.

In the specific case of third-party libraries with divergent style conventions, follow theirs. This is in line with PEP 8.

Getting in touch with the developers

There is a Discord server, intended for active development on this project. If you are interested in joining, send a private message to Cinnabarit#1341.

Keeping your fork up to date

  • Add a new remote repository and name it upstream.
    git remote add upstream https://github.com/PathOfBuildingCommunity/PathOfBuilding.git
  • Verify that adding the remote worked.
    git remote -v
  • Fetch all branches and their commits from upstream.
    git fetch upstream
  • Check out your local dev branch if you haven't already.
    git checkout dev
  • Merge all changes from upstream/dev into your local dev branch.
    git rebase upstream/dev
  • Push your updated branch to GitHub.
    git push -f origin dev