Contributing
We welcome contributions to PromptPack Python! This guide will help you get started.
Development Setup
Section titled “Development Setup”Prerequisites
Section titled “Prerequisites”- Python 3.10 or higher
- Hatch for project management
Clone and Install
Section titled “Clone and Install”git clone https://github.com/AltairaLabs/promptpack-python.gitcd promptpack-pythonpip install hatchDevelopment Commands
Section titled “Development Commands”All development commands are run through Hatch:
# Run testshatch run test
# Run tests with coveragehatch run test-cov
# Lint codehatch run lint
# Format codehatch run format
# Type checkinghatch run typecheckProject Structure
Section titled “Project Structure”promptpack-python/├── packages/│ ├── promptpack/ # Base library│ │ ├── src/promptpack/│ │ └── tests/│ └── promptpack-langchain/ # LangChain integration│ ├── src/promptpack_langchain/│ └── tests/├── docs/ # Documentation (Astro/Starlight)└── pyproject.toml # Root project configurationCode Style
Section titled “Code Style”- Use ruff for linting and formatting
- Follow PEP 8 style guidelines
- Add type hints to all public functions and methods
- Write docstrings for all public APIs (Google style)
Testing
Section titled “Testing”- Write tests for all new functionality
- Maintain test coverage above 80%
- Use pytest for testing
- Place tests in the
tests/directory of each package
Running Specific Tests
Section titled “Running Specific Tests”# Run tests for a specific packagehatch run test packages/promptpack/tests/
# Run a specific test filehatch run test packages/promptpack/tests/test_parser.py
# Run tests matching a patternhatch run test -k "test_parse"Pull Request Process
Section titled “Pull Request Process”- Fork the repository
- Create a feature branch from
main - Make your changes
- Ensure all tests pass
- Ensure code passes linting and type checking
- Submit a pull request
Commit Messages
Section titled “Commit Messages”Use clear, descriptive commit messages:
feat: add support for array variablesfix: handle missing optional fieldsdocs: update installation instructionstest: add tests for fragment parsingchore: update dependencies
Documentation
Section titled “Documentation”Building Documentation
Section titled “Building Documentation”cd docsnpm installnpm run devThe documentation site will be available at http://localhost:4321.
Writing Documentation
Section titled “Writing Documentation”- Documentation is in
docs/src/content/docs/ - Use Markdown or MDX format
- Include frontmatter with title and description
- Add code examples where appropriate
License
Section titled “License”By contributing, you agree that your contributions will be licensed under the Apache License 2.0.