Developer Notes
April 28, 2026 ยท View on GitHub
This page is for maintainers and developers.
For machine setup profiles, geometry, and limit-switch configuration, see Developer Setup Profiles.
Run Tests
Run all non-hardware tests:
uv run pytest -q -m "not hardware"
Run hardware tests only when the correct hardware is connected.
TMC5160 Hardware Tests
Set the hardware port:
DIP_COATER_TMC5160_PORT=/dev/tty.usbmodemTMCEVAL1 \
uv run pytest -m hardware src/test/test_tmc5160_hardware.py
Optional motion smoke test:
DIP_COATER_TMC5160_PORT=/dev/tty.usbmodemTMCEVAL1 \
DIP_COATER_TMC5160_RUN_MOTION=1 \
uv run pytest -m hardware src/test/test_tmc5160_hardware.py
Supported hardware-test variables:
| Variable | Meaning |
|---|---|
DIP_COATER_TMC5160_PORT | Required serial port |
DIP_COATER_TMC5160_INTERFACE | Interface type, defaults to usb_tmcl |
DIP_COATER_TMC5160_STEP_MODE | Step mode, defaults to 16 |
DIP_COATER_TMC5160_CURRENT_MA | Run current, defaults to 500 |
DIP_COATER_TMC5160_STANDSTILL_MA | Standstill current, defaults to 0 |
DIP_COATER_TMC5160_STANDSTILL_NONZERO_MA | Non-zero standstill check current, defaults to 140 |
DIP_COATER_TMC5160_RSENSE_MOHM | Sense resistor value, defaults to 75 |
Build the Docs
Install docs dependencies:
uv sync --extra docs
Preview:
uv run --extra docs mkdocs serve
Build:
uv run --extra docs mkdocs build
Publish to PyPI
Use this when releasing a new package version for pip install dip-coater.
PyPI package versions are immutable, so bump project.version in
pyproject.toml before building if that version has already been uploaded.
-
Update the version in
pyproject.toml. -
Refresh the lock file after changing package metadata:
uv lock -
Run the non-hardware tests:
uv run pytest -q -m "not hardware" -
Build fresh distributions:
uv build --clear -
Inspect the wheel metadata before uploading:
unzip -p dist/dip_coater-<version>-py3-none-any.whl \ dip_coater-<version>.dist-info/METADATAFor Windows compatibility, confirm the metadata includes these environment markers:
Requires-Dist: uvloop>=0.19.0; sys_platform != "win32" Requires-Dist: winloop; sys_platform == "win32" -
Dry-run the upload:
uv publish --dry-run -
Upload to PyPI with a project API token:
export UV_PUBLISH_TOKEN="pypi-..." uv publish -
Verify the published package from a clean environment:
python -m pip install --upgrade --no-cache-dir dip-coater==<version> dip-coater --version
For a Windows install check, use PowerShell:
py -m pip install --upgrade --no-cache-dir dip-coater==<version>
dip-coater --version
Publish With GitHub Pages
One simple option is to use GitHub Actions:
name: docs
on:
push:
branches: [main]
permissions:
contents: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: astral-sh/setup-uv@v5
- run: uv run --extra docs mkdocs gh-deploy --force
Then enable GitHub Pages for the gh-pages branch in the repository settings.
Documentation Style
Write for users who are operating a machine, not for Python developers.
Good docs should:
- show the exact command to run
- say what the user should see next
- explain what to check before moving hardware
- prefer short procedures over long explanations
- put dangerous actions in warnings