Clone a module
Every PLESTY module is a self-contained repository — clone the one you want to work on directly from gitlab.com/plesty:
git clone https://gitlab.com/plesty/hub/devices/thorlab/plesty-pm100d.git
cd plesty-pm100d
uv sync
uv sync creates .venv/ and installs all runtime and dev dependencies (including plesty-sdk and plesty-lib) from the lockfile. No --extra dev flag needed — dev dependencies live in [dependency-groups.dev].
All plesty CLI commands and uv run commands are run from within the repo directory.
Module repo layout
A device module looks like this (experiments and analyzers follow the same shape):
plesty-pm100d/
├── plesty/
│ └── pm100d/
│ ├── __init__.py
│ ├── __main__.py # TCP server entry point
│ ├── base_device.py # communication layer
│ ├── device.py # instrument operations
│ ├── schema_param.json # parameter definitions
│ └── schema_func.json # operation definitions
├── docs/ # module documentation (Sphinx via plesty docs)
├── tests/ # mock-based pytest suite
├── pyproject.toml
├── CHANGELOG.md
├── LICENSE / LICENSES / REUSE.toml
└── uv.lock
Virtual environment
To use the environment created by uv sync:
# Run a command in the env (preferred — no activation needed)
uv run plesty check
# Or activate it
source .venv/bin/activate
plesty check
Key files
| File | Purpose |
|---|---|
pyproject.toml |
Package metadata, dependencies, [tool.plesty] config |
CHANGELOG.md |
Required by Gate 5; must be updated before each release |
.gitlab-ci.yml |
CI pipeline using the plesty-standard-ci component |
.git/hooks/pre-push |
Pre-push hook that runs plesty check before every push |
plesty/<name>/schema_param.json |
Device parameter definitions (devices only) |
plesty/<name>/schema_func.json |
Device operation definitions (devices only) |
The [tool.plesty] section
pyproject.toml carries module metadata read by plesty check:
[tool.plesty]
# standard derives from the release version (<0.1 pixel, <1.0 nebula, >=1.0
# quantum; no tag yet = pixel) — set standard = "quantum" to pin it instead.
module_type = "device" # one of: device, experiment, analyzer, core
module_type activates the Device API Pipeline gate (d1) when set to "device".
CI/CD variables
The docs-deploy token is provided for you: CI_BOT_TOKEN is a group-level CI/CD variable inherited by every hub project — do not create a per-project CI_BOT_TOKEN; a project-level variable would shadow the group one and expire on its own schedule.
The only variable a module maintainer sets up is for publishing:
| Variable | Purpose | Where to set |
|---|---|---|
PYPI_TOKEN |
Publish to PyPI (Gate 14) | Project Settings → CI/CD → Variables (Masked + Protected) |