Skip to content

Setting up your Development Environment

Before You Get Started

Depending on the complexity of the contribution you'd like to make to Bloqade, it may be worth reading the Design Philosophy and Architecture section to get an idea of why Bloqade is structured the way that it is and how to make your contribution adhere to this philosophy.

Our development environment contains a set of tools we use for development, testing, and documentation. This section describes how to set up the development environment. We primarily use pdm to manage python environments and dependencies.

Setting up Python

We use pdm to manage dependencies and virtual environment. After cloning the repository, run the following command to install dependencies:

pdm install

You can also install different dependency groups:

  • dev: dependencies for development
pdm install --dev
# or
pdm install -d
  • doc: dependencies for building documentation
pdm install -G doc

Useful PDM scripts

Tests

You can run tests via

pdm run test

Or run tests and generate coverage via

pdm run coverage

will print out the coverage file level report in terminal.

pdm run coverage-html

This command generates an interactive html report in htmlcov folder. This will show which specific lines are not covered by tests.

Documentation

You can build documentation via

pdm run doc_build

Or run a local server to preview documentation via

pdm run doc

Jupytext

You can sync jupyter notebooks and python scripts via

pdm run jupytext

this will help you development examples in jupyter notebook and python scripts simultaneously.

Lint

We primarily use ruff - an extremely fast linter for Python, and black as formatter. These have been configured into pre-commit hooks. After installing pre-commit on your own system, you can install pre-commit hooks to git via

pre-commit install