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:
You can also install different dependency groups:
- dev: dependencies for development
- doc: dependencies for building documentation
Useful PDM scripts¶
Tests¶
You can run tests via
Or run tests and generate coverage via
will print out the coverage file level report in terminal.
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
Or run a local server to preview documentation via
Jupytext¶
You can sync jupyter notebooks and python scripts via
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