Skip to content

Development

github-actions[bot] edited this page Nov 28, 2026 · 57 revisions

This page is mirrored automatically from docs/en/development.md (v1.7.2). Changes made here are overwritten; please suggest them as a pull request.

Development

English · Deutsch · ← Documentation

Running and testing locally

python -m venv .venv && . .venv/bin/activate
pip install -r requirements-dev.txt
python -m ruff check                       # linter, also runs in CI
python -m pytest -q                        # run the tests
python tools/make_sample.py ./library      # create sample files
LIBRARY_DIR=./library DATA_DIR=./data uvicorn app.main:app --reload

There is also a browser test that opens all pages and the 3D preview in Chromium. It fails on any JavaScript error, on any request to another server, and on serious or critical accessibility problems (WCAG 2 A/AA, checked with axe-core from tests/vendor/, in the light and the dark theme):

pip install -r requirements-browser.txt
python -m playwright install chromium
python -m pytest -q -n auto tests/test_browser.py

Translations

The German texts in the code double as keys for the translations in app/locales/<language>.json. After changing or adding texts,

python tools/i18n_extract.py

shows per language what is missing or no longer used. The tests fail as long as a translation is missing or its placeholders ({n}, {name} …) don’t match the German text. A new language needs an entry in LANGUAGES, NUMBER_FORMAT, MONTHS and DAY_MONTH in app/i18n.py plus its own JSON file.

Reporting problems

Bug reports and ideas are welcome as GitHub issues; the forms ask for the details that are usually needed. For bugs, open “Settings” → “Diagnostics” in PlateShelf, click “Copy” and paste the text into the issue. It lists version, platform, library figures, printer types with their last result, which settings are set and the latest warnings, without credentials, IP addresses, host names or printer names.

If a printer is not recognised correctly (status, progress or project wrong), also attach the file from “Download as file”. Besides the text it contains the last 500 log lines and, for each printer, the result of the last sync, the file list on the printer and the last answer to the status query. Credentials, serial numbers, addresses and printer names are removed (printers are called “printer 1” etc.); file names stay. The answers are only kept in memory, nothing is sent.

Tests, builds and releases

  • Every pull request and every push to main runs Ruff, the Python tests and the browser test and builds the image for amd64 and arm64 as a trial. Nothing is published.

  • Trivy then scans the image for known vulnerabilities. Critical and high ones that already have a fix are listed; the build only fails on critical ones, so a fresh “high” in the base image does not block a release until Debian has shipped the fix.

  • Pull requests that only change documentation skip the tests, browser test and image build. The same applies to a further push to a pull request that only changes documentation (for example the version in CHANGELOG.md), as long as the run for the previous state succeeded.

  • A release is created by a version tag:

    1. Add the changes to CHANGELOG.md under the new version number.

    2. Create and push the tag:

      git tag -a v1.2.3 -m "PlateShelf 1.2.3" && git push --tags
    3. GitHub Actions builds the image for all platforms (the tests already ran in the pull request), scans it and publishes it as 1.2.3, 1.2, 1 and latest, and creates the GitHub release with the notes from the changelog. Older versions are then removed; the last five releases are kept.

  • Dependabot (.github/dependabot.yml) checks Python packages, GitHub Actions and the base image weekly and proposes updates as pull requests. Known vulnerabilities are reported immediately and fixed automatically via pull request. Such updates reach the published image with the next release.

  • The documentation lives in docs/ and is mirrored into the GitHub wiki (.github/workflows/wiki.yml, tools/wiki_sync.py) on every release and on demand (Actions → Wiki → Run workflow). Edit docs/ only: changes made in the wiki are overwritten by the next mirror.

Clone this wiki locally