Agents and protocols for running on opentrons hardware
This is a Python application that uses pip-tools for packaging and
dependency management. It also provides pre-commit hooks (for
ruff and mypy) and automated tests using pytest and
GitHub Actions. Pre-commit hooks are automatically kept updated with a dedicated
GitHub Action, this can be removed and replaced with pre-commit.ci if using a public
repo. The package version is dynamically generated from the most recent git tag using
setuptools-scm.
pip-tools is chosen as a lightweight dependency manager that adheres to
the latest standards using pyproject.toml.
It was developed by the Imperial College Research Software Engineering Team.
To get started:
-
Activate a git repository (required for
pre-commitand the package versioning withsetuptools-scm):git init
-
Create and activate a virtual environment:
python -m venv .venv source .venv/bin/activate # with Powershell on Windows: `.venv\Scripts\Activate.ps1`
-
Install development requirements and the package in editable mode:
pip install -r dev-requirements.txt pip install -e . -
Install the git hooks:
pre-commit install
-
Run the main app:
python -m opentrons_drivers
-
Run the tests:
pytest
To add or remove dependencies:
- Edit the
dependenciesvariables in thepyproject.tomlfile (aim to keep development tools separate from the project requirements). - Update the requirements files:
pip-compileforrequirements.txt- the project requirements.pip-compile --extra dev -o dev-requirements.txtfor the development requirements.
- Sync the files with your installation (install packages):
pip-sync *requirements.txt
To upgrade pinned versions, use the --upgrade flag with pip-compile.
Versions can be restricted from updating within the pyproject.toml using standard
python package version specifiers, i.e. "black<23" or "pip-tools!=6.12.2"
All configuration can be customised to your preferences. The key places to make changes for this are:
- The
pyproject.tomlfile, where you can edit: - The
.pre-commit-config.yamlfor pre-commit settings. - The
.githubdirectory for all the CI configuration.