Software for Public Quantum Network nodes.
-
Install uv, which will handle project management
-
Clone and navigate into this repository
-
Install the dependencies and set up the virtual environment 🏗️
uv sync
-
Run the code 🚀
uv run pqn
A few of the most useful uv commands are shown below. See the uv project guide for more information about working on projects with uv.
uv add
-- Add dependencies to the projectuv remove
-- Remove dependencies from the projectuv sync
-- Update the project's environmentuv run
-- Run a command or script
Important
Instead of pip install <package>
, use uv add <package>
.
To run your code, or a command that is aware of your project environment, use the following command:
uv run
-- Run a command or script
See the script documentation for more information.
Use Ruff to lint and format your code.
It is already specified as a development dependency in this template's pyproject.toml
, and is automatically installed when you run uv sync
.
You can run the linter with uv run ruff check
(use the --fix
flag to apply fixes), and the formatter with uv run ruff format
.
There are many options available to customize which linting rules are applied.
All rules are enabled by default, and I have disabled a few redundant ones as a starting point in the pyproject.toml
.
Feel free to modify the list as needed for your project.
See the documentation or command help output for additional information.
Use mypy for type checking: uv run mypy
.
Use pytest to run tests:
uv run pytest
- Use
uv run pytest --cov
to check code coverage.
If it is not possible to use uv for installation, there is a workaround using virtualenv
and pip
.
Important
This method is intended as a workaround only for situations where uv is not available, and only for local installations rather than for active project development.
From the root directory of the repository:
-
Create the virtual environment
virtualenv .venv
-
Activate the virtual environment
source .venv/bin/activate
-
Install the project dependencies
pip install -e .
-
Run the code
pqn
What to try if things don't seem to be working:
- Remove the
.venv/
directory and try again ♻️