Contributing

Contributing to PyTestLab

Thank you for your interest in contributing to PyTestLab! Your help makes this project better for everyone in the scientific and engineering community.

This guide explains how to get started, the development workflow, and best practices for contributing code, documentation, and ideas.


Code of Conduct

All contributors are expected to follow the PyTestLab Code of Conduct. Please help us keep the community welcoming and inclusive.


Getting Started

  1. Fork the repository on GitHub.
  2. Clone your fork locally:
    git clone https://github.com/YOUR_USERNAME/pytestlab.git
    cd pytestlab
  3. Set up a virtual environment (recommended):
    python -m venv .venv
    source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  4. Install dependencies (including development tools):
    pip install -e .[dev,full]
  5. Install pre-commit hooks (for linting and formatting):
    pre-commit install

Development Workflow

  • Create a feature branch for your work:
    git checkout -b feat/short-description
  • Make your changes (code, docs, or tests).
  • Add or update tests to cover your changes.
  • Run the test suite:
    pytest
  • Run pre-commit checks (these will also run automatically on commit):
    pre-commit run --all-files
  • Commit using Conventional Commits (enforced by commitizen):
    cz c
  • Push your branch to your fork:
    git push origin feat/short-description
  • Open a Pull Request against the main branch on GitHub.

Code Style & Quality

  • Linting & Formatting: PyTestLab uses Ruff for linting and formatting, and Black for code style. These are enforced by pre-commit.
  • Type Checking: Use MyPy for static type checking.
  • Commit Messages: Follow the Conventional Commits specification. Use cz c to help format your commit messages.

Documentation

  • Docs live in docs/ and are written in Markdown or Jupyter Notebooks.
  • API docs are generated using mkdocstrings.
  • To preview docs locally:
    mkdocs serve
  • Update or add docstrings to your code as needed.

Tests

  • Unit tests live in the tests/ directory.
  • All new features and bugfixes must include tests.
  • Run the full test suite before submitting a PR.

Submitting a Pull Request

  • Ensure your branch is up to date with main.
  • Provide a clear title and description for your PR.
  • Link to any relevant issues.
  • Be responsive to code review feedback.

Need Help?

  • Bugs & Feature Requests: Open an issue on GitHub.
  • Questions: Use GitHub Discussions or reach out via the project chat (see the README for links).
  • Security Issues: Please report security vulnerabilities privately to the maintainers.

Thank you for helping make PyTestLab better!