Contributing
Issues
Use the issue forms for bugs, feature requests, documentation, usage questions and maintenance tasks. Select the priority, affected components and report templates. Include the package version and a minimal example for bugs. Report vulnerabilities through the private link described in the security policy.
Issues receive type, priority, component and template labels from the form. Maintainers
confirm priority, assign an owner and select a milestone when scheduling work.
The v0.1.0 milestone tracks the first public release.
| Priority | Use |
|---|---|
priority: critical |
P0: incorrect report content or a release-blocking failure |
priority: high |
P1: major functionality unavailable or significantly impaired |
priority: normal |
P2: standard fixes and planned improvements |
priority: low |
P3: minor improvements with a workaround |
New and reopened issues start with status: triage. Maintainers move accepted work to
status: ready, then status: in progress and status: in review. Use status: blocked
when work depends on another issue or decision. Adding a priority or status label removes
the previous label in that group. Closing
an issue removes its active status; GitHub's closed state records completion.
Form edits update the selected fields without resetting priority or component labels
changed by maintainers when those form fields have not changed. Custom labels are preserved.
Labels are defined in .github/labels.json. The Issue management workflow synchronizes them
when that file changes on master; it can also be run manually.
Development setup
From a source checkout, create an environment and install the development tools:
python -m venv .venv
source .venv/bin/activate
python -m pip install -e '.[dev,test,docs,pdf]'
python -m pre_commit install
python -m pre_commit run --all-files
PDF tests require the native libraries listed in installation. Pre-commit runs Ruff linting and formatting, checks JSON/YAML/TOML, and checks whitespace and merge conflict markers. CI runs the same hooks. Ruff uses a 100-character line limit and Google-style docstrings; EditorConfig supplies matching editor defaults.
Document public classes and functions with a concise description and relevant Args,
Returns and Raises sections. Keep package authorship and contact information in
pyproject.toml; source files need module docstrings rather than repeated metadata headers.
Tests and documentation
python -m pytest -q --cov=smd_reports --cov-branch --cov-report=term-missing --cov-report=html
python -m mkdocs build --strict
The coverage minimum is 75%, including branches. Add tests for observable behavior and
failure cases; see testing and releases for distribution checks.
Use python -m mkdocs serve to preview documentation locally.
Documentation hosting
The .readthedocs.yaml file configures Read the Docs to build mkdocs.yml with Python
3.12 and the package's docs extra. Documentation warnings fail the build, as they do in CI.
To enable hosting:
- Sign in to Read the Docs and connect GitHub.
- Add a project and import
SMD-Bioinformatics-Lund/smd-reportsthrough the GitHub integration. - Select a branch containing
.readthedocs.yaml. Usemasterfor release documentation; development branches can be activated separately for previews. - Run the first build and verify the published documentation URL.
- Update the GitHub website field, README documentation links and package documentation URL to the published site.
After import, the GitHub integration rebuilds enabled versions when their source changes. The project must be imported into Read the Docs before pushes can publish documentation. Until a hosted site is available, the GitHub wiki is the public documentation link.
Wiki publishing
Edit documentation in docs/ and navigation in mkdocs.yml. The Publish wiki workflow
synchronizes those pages after documentation changes merge into master. It can also be
run manually on master. Feature branches and pull requests check generated pages and links
without publishing them.
The wiki retains its existing page URLs, with a sidebar generated from MkDocs navigation and a footer from the configured copyright. Relative page links point to the wiki; images and repository files link to the source commit. Code examples remain unchanged. The workflow preserves wiki commit history and skips commits when the generated content is unchanged.
Wiki pages are generated files. Make edits in docs/; direct edits to the wiki are replaced
by the next synchronization. The workflow uses GitHub's automatic token with contents: write
permission, so no additional publishing secret is required. The wiki must already contain
at least one page before its Git repository can be cloned.
To preview the generated Markdown, choose an empty output directory:
python scripts/build_wiki.py --output .artifacts/wiki-preview \
--repository SMD-Bioinformatics-Lund/smd-reports --revision "$(git rev-parse HEAD)"
CI builds both MkDocs and the wiki output. Missing relative links or duplicate wiki page names fail the documentation check.
Example reports
JSON files in examples/inputs/ are the source for the report examples. Regenerate the
five versioned HTML/PDF previews after changing report appearance:
python examples/reports.py --previews --pdf --output examples/rendered
Review the PDFs and keep their data and artwork synthetic. Other generated output belongs
under .artifacts/.
Pull requests
Create feature or bugfix branches from dev and open development PRs against dev.
Include the behavior change and relevant test results. Development PRs use squash merges.
Release PRs go from dev to master and use merge commits to preserve branch ancestry.
Both branches require one approving review, resolved discussions and passing checks on an
up-to-date branch. The maintainer ramsainanduri may bypass the approving-review requirement
for solo maintenance. Required CI checks and the other protections still apply, including to
administrators. Force pushes and branch deletion are blocked. Required checks are branch-flow, lint, docs, core (3.10), core (3.12),
core (3.14) and pdf. Release PRs to master must originate from this repository's dev
branch. The PR templates in .github/PULL_REQUEST_TEMPLATE/ describe the expected checks.
See publishing setup for release configuration and commands.