Thank you for your interest in contributing to glpkg! This document provides guidelines and instructions for development.
- Python 3.11 or higher
- uv installed (
curl -LsSf https://astral.sh/uv/install.sh | sh)
# Clone the repository
git clone https://github.com/your-org/glpkg.git
cd glpkg
# Install all dependencies (including dev and test extras)
uv sync --all-extras-
Install pre-commit hooks:
uv run pre-commit install
-
Create a feature branch:
git checkout -b feature/your-feature-name
-
Make your changes
-
Run tests locally before committing
-
Commit your changes (pre-commit hooks run automatically)
-
Push and create a pull request
Fast tests that don't require external dependencies:
uv run pytest tests/unit/Require a GitLab token and opt-in via environment variable:
export RUN_INTEGRATION_TESTS=1
export GITLAB_TOKEN="your-token"
uv run pytest tests/integration/ -m integrationuv run pytest tests/Speed up test runs with parallel execution:
uv run pytest tests/ -n autoFor detailed testing documentation, see tests/README.md.
Pre-commit hooks run automatically on every commit. To run checks manually:
uv run ruff check src/uv run mypy src/uv run ruff format src/uv run pre-commit run --all-files- Target coverage: 95% (warning threshold in CI)
- Minimum coverage: 90% (tests fail below this threshold)
View coverage report locally:
uv run pytest tests/unit/ --cov=glpkg --cov-report=html
open htmlcov/index.html # or xdg-open on Linux- Create a feature branch from
main - Make changes with clear, descriptive commits
- Ensure all tests pass and coverage meets requirements
- Ensure pre-commit hooks pass
- Push your branch and create a pull request
- Address review feedback
- Squash commits if requested by maintainers
- Follow PEP 8 conventions (enforced by ruff)
- Use type hints (checked by mypy in strict mode)
- Write descriptive docstrings for public APIs
- Keep functions focused and testable
- Avoid over-engineering; keep solutions simple
When adding new features:
- Add unit tests in
tests/unit/ - Add integration tests in
tests/integration/if the feature interacts with external services - Update documentation in README.md or relevant docs
- Add appropriate pytest markers:
@pytest.mark.unitfor unit tests@pytest.mark.integrationfor integration tests
If you have questions about contributing, please open an issue on GitHub.