Repository Guidelines
Project Structure & Modules
opentiler/: Core app (Qt/PySide6 GUI, dialogs, exporter, settings, utils, viewer). Assets inopentiler/assets/.main.py: CLI/GUI entry; callsopentiler.main_app.main().tests/: Pytest suite (unit, plugins, integration). Uses markers:gui,integration,slow.plugins/: Plugin system (manager, hooks, builtins) and plugin docs.docs/: User/dev docs and images. Seedocs/developer/DEVELOPER_MANUAL.md.tools/: Utilities (screen capture, validation helpers).- Other:
requirements*.txt,setup.py,BUILD_INSTRUCTIONS.md.
Build, Test, Run
- Install dev deps:
pip install -r requirements-dev.txt(optional features viarequirements-optional.txt). - Editable install:
pip install -e .(addsopentiler/opentiler-gui). - Run app locally:
python main.pyoropentiler. - Test fast:
pytest -q. - Test with markers:
pytest -m "not slow",pytest -m gui. - Coverage:
pytest --cov=opentiler --cov-report=term-missing. - Build dist:
python -m buildorpython setup.py sdist bdist_wheel(seeBUILD_INSTRUCTIONS.md).
Coding Style & Naming
- Python 3.10+; 4-space indent; PEP 8.
- Format:
black .; Imports:isort .; Lint:flake8; Types:mypy opentiler. - Names: modules/functions
snake_case, classesCamelCase, constantsUPPER_SNAKE. - UI resources live under
opentiler/assets/.
Testing Guidelines
- Framework:
pytest; filestests/test_*.py; classes start withTest*; test funcstest_*. - GUI tests set
QT_QPA_PLATFORM=offscreen(handled inconftest.py). - Use markers (
gui,integration,slow) and fixtures (qapp,temp_dir,mock_main_window). - Aim for meaningful unit tests around utils, exporters, and plugins; add integration tests for workflows.
Commit & Pull Requests
- Commit style: short imperative subject with component scope, e.g.
print: set first-page orientationorfix(preview): import QSize. - Include why when relevant; group related changes; keep diffs focused.
- PRs: clear description, linked issues (e.g.,
Closes #123), steps to test, screenshots/GIFs for UI changes, and notes on risks/rollout. - CI hygiene: pass lint/format/type/tests locally before opening PR.
Security & Configuration
- Optional features: CAD (
ezdxf), RAW (rawpy,numpy), automation (mss,pywinctl). Install only as needed. - Avoid committing large binaries; place assets under
opentiler/assets/.