Thank you for your interest in contributing to Sphinx-SimplePDF! This document provides guidelines and instructions for contributing.
- Python 3.10 or higher
- uv package manager
Note for macOS users: We recommend using the devcontainer for building and testing, as WeasyPrint has additional system dependencies that are easier to manage in a containerized environment.
-
Clone the repository:
git clone https://github.com/useblocks/sphinx-simplepdf.git cd sphinx-simplepdf -
Install dependencies using uv:
uv sync --group dev
-
Install pre-commit hooks:
uv run pre-commit install
uv run pytestFor parallel test execution:
uv run pytest -n autoThis project uses several tools to maintain code quality:
- Ruff - Linting and formatting
- mypy - Static type checking
- pre-commit - Automated checks before commits
uv run pre-commit run --all-files# Linting
uv run ruff check .
# Formatting
uv run ruff format .
# Type checking
uv run mypy .uv sync --extra docs
cd docs
make htmlcd docs
make simplepdfThe generated PDF will be in docs/_build/simplepdf/.
- Fork the repository and create a new branch from
main - Make your changes
- Ensure all tests pass and pre-commit checks succeed
- Submit a pull request to the
mainbranch
Write clear and descriptive commit messages that explain what changes were made and why.
- Follow the existing code style in the project
- Maximum line length is 120 characters
- Use type hints where appropriate
- Keep changes focused and avoid unrelated modifications
When reporting issues, please include:
- A clear description of the problem
- Steps to reproduce the issue
- Expected vs actual behavior
- Python version and OS information
- Any relevant error messages or logs
If you have questions, feel free to open an issue on the GitHub repository.
By contributing to Sphinx-SimplePDF, you agree that your contributions will be licensed under the MIT License.