Skip to content

Latest commit

 

History

History
109 lines (91 loc) · 4.25 KB

File metadata and controls

109 lines (91 loc) · 4.25 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://github.com/python-poetry/poetry/master/install-poetry.py -UseBasicParsing).Content | python -
    or so (Curl):
    curl -sSL https://github.com/python-poetry/poetry/master/get-poetry.py | 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

Compiling UI/QRC

If you would like to manually generate UI/QRC you can execute a Python script:

python build-ui.py

Obtaining initial base_items.json data

In the data/ folder, we are currently ignoring base_items.json. Create one for yourself locally, and utilize the base_items.json data found in this repo.

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

Formatting guide line

A superset of PEP 8, PEP 257, PEP 484 and black. In case of contradictions, black is right. 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 the specific case of third-party libraries with divergent style conventions, follow theirs. This is in line with PEP 8.