Contributing¶
If you want to explore the interior of Piccolo API more deeply and help with the project, follow these instructions.
Get the tests running¶
Create a new virtualenv
Clone the Git repo
cd piccolo_apiInstall default dependencies:
pip install -r requirements/requirements.txtInstall development dependencies:
pip install -r requirements/dev-requirements.txtInstall test dependencies:
pip install -r requirements/test-requirements.txtSetup Postgres
Run the automated code linting/formatting tools:
./scripts/lint.shRun the test suite with Postgres:
./scripts/test-postgres.shRun the test suite with Sqlite:
./scripts/test-sqlite.sh
Contributing to the docs¶
The docs are written using Sphinx. To get them running locally:
Install the requirements:
pip install -r requirements/doc-requirements.txtcd docsDo an initial build of the docs:
make htmlcd ..Serve the docs:
./scripts/run-docs.shThe docs will auto rebuild as you make changes.
Code style¶
Piccolo uses Black for formatting, preferably with a max line length of 79, to keep it consistent with PEP8 .
You can configure VSCode by modifying
settings.json as follows:
{
"python.linting.enabled": true,
"python.linting.mypyEnabled": true,
"python.formatting.provider": "black",
"python.formatting.blackArgs": [
"--line-length",
"79"
],
"editor.formatOnSave": true
}
Type hints are used throughout the project.