Development Guidelines

Install

  1. Clone this repository with git:

git clone git@github.com:crusaderky/pathfinder2e_stats.git
cd pathfinder2e_stats
  1. Install anaconda or miniconda (OS-dependent)

  2. conda env create -n pathfinder2e_stats-3.10 --file ci/requirements-latest.yml python=3.10
    conda activate pathfinder2e_stats-3.10
    

To keep a fork in sync with the upstream source:

cd pathfinder2e_stats
git remote add upstream git@github.com:crusaderky/pathfinder2e_stats.git
git remote -v
git fetch -a upstream
git checkout main
git pull upstream main
git push origin main

Test

Test using py.test:

py.test pathfinder2e_stats

Code Formatting

pathfinder2e_stats uses several code linters (ruff, black, mypy), which are enforced by CI. Developers should run them locally before they submit a PR, through the single command

pre-commit run --all-files

This makes sure that linter versions and options are aligned for all developers.

Optionally, you may wish to setup the pre-commit hooks to run automatically when you make a git commit. This can be done by running:

pre-commit install

from the root of the pathfinder2e_stats repository. Now the code linters will be run each time you commit changes. You can skip these checks with git commit --no-verify or with the short version git commit -n.