Contributing¶
Welcome to ArchiPy! We're excited that you're interested in contributing. This document outlines the process for contributing to ArchiPy.
Getting Started¶
- Fork the Repository
Fork the ArchiPy repository on GitHub.
- Clone Your Fork
- Set Up Development Environment
!!! tip "Pre-commit Hooks"
Running make install-dev sets up pre-commit hooks that automatically run linting, formatting, and type checking on
every commit. Use make pre-commit to run all hooks manually before opening a pull request.
- Create a Branch
Create a branch for your feature or bugfix:
Development Installation¶
To set up a full local development environment from scratch:
# Clone the repository
git clone https://github.com/SyntaxArc/ArchiPy.git
cd ArchiPy
# Set up the project (installs UV)
make setup
# Install dependencies
make install
# Install all development tools and optional dependencies
make install-dev
Tip: Running
make install-devsets up pre-commit hooks that automatically run linting, formatting, and type checking on every commit. Usemake pre-committo run all hooks manually before opening a pull request.
Contribution Guidelines¶
Code Style¶
ArchiPy follows a strict code style to maintain consistency across the codebase:
- Ruff: For linting and code formatting
- Ty: For type checking
All code must pass these checks before being merged:
Testing¶
All contributions must include appropriate BDD tests:
- BDD Tests: All tests are written as Gherkin scenarios in
features/
Run the tests to ensure your changes don't break existing functionality:
Documentation¶
All new features or changes should be documented:
- Docstrings: Update or add docstrings to document functions, classes, and methods
- Type Annotations: Include type annotations for all functions and methods
- Documentation Files: Update relevant documentation files if necessary
Building the documentation locally:
Commit Messages¶
ArchiPy follows the Conventional Commits specification for commit messages:
Common types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Formatting changesrefactor: Code refactoringtest: Adding or modifying testschore: Maintenance tasks
Pull Request Process¶
- Update Your Branch
Before submitting a pull request, make sure your branch is up to date with the master branch:
- Run All Checks
Ensure all checks pass:
- Submit Your Pull Request
Push your branch to your fork and create a pull request:
- Code Review
Your pull request will be reviewed by the maintainers. They may suggest changes or improvements.
- Merge
Once your pull request is approved, it will be merged into the master branch.
Bug Reports and Feature Requests¶
If you find a bug or have a feature request, please create an issue on the GitHub issues page.
When reporting a bug, please include:
- A clear and descriptive title
- A detailed description of the bug
- Steps to reproduce the bug
- Expected behavior
- Actual behavior
- Any relevant logs or error messages
When submitting a feature request, please include:
- A clear and descriptive title
- A detailed description of the feature
- Any relevant use cases
- If possible, a sketch of how the feature might be implemented
How to Add a New Adapter¶
New adapters follow a consistent checklist. Use this as your guide when contributing an integration:
- Create the adapter package
archipy/adapters/<name>/
├── __init__.py
├── ports.py # Abstract interface (plain class with @abstractmethod)
├── adapters.py # Concrete implementation
└── mocks.py # In-memory test double
- Define the port (
ports.py)
Create a plain class with @abstractmethod methods that describes what the adapter can do. Your business logic and
repositories
must depend only on this interface.
- Implement the adapter (
adapters.py)
Implement the port against the real external service. Lazy-import the third-party library inside
methods (not at module level) to avoid ImportError when the optional extra is not installed.
- Write the mock (
mocks.py)
Implement the port using an in-memory data structure. The mock must behave consistently with the real adapter for all methods exercised in tests.
- Add the optional extra to
pyproject.toml
-
Write tests — BDD tests using the mock for fast scenarios, integration tests using
testcontainersfor real-service scenarios. -
Document the adapter — create both:
docs/tutorials/adapters/<name>.md— example guide (5 required sections)docs/api_reference/adapters/<name>.md— API reference with mkdocstrings
-
Update
mkdocs.yml— add both new pages under the appropriatenav:keys.
Note: Use the GitHub issue templates when reporting bugs, requesting features, or proposing new adapters.
Code of Conduct¶
Please note that ArchiPy has a code of conduct. By participating in this project, you agree to abide by its terms.
Thank You¶
Thank you for contributing to ArchiPy! Your efforts help make the project better for everyone.
Documentation Guidelines¶
This section outlines the standards and practices for ArchiPy documentation.
Documentation Structure¶
mkdocs.yml- Main configuration file for MkDocsdocs/- Markdown documentation filesindex.md- Get Started pageapi_reference/- API documentationtutorials/- Usage examplesassets/- Images and other static assets
Format and Style¶
- Use Markdown syntax for all documentation files
- Follow the Google Python style for code examples
- Include type hints in code samples (using Python 3.14 syntax)
- Include proper exception handling with
raise ... from epattern - Group related documentation in directories
- Link between documentation pages using relative links
Code Examples¶
When including code examples:
- Include proper type hints using Python 3.14 syntax (
x: list[str]notList[str]) - Demonstrate proper error handling with exception chaining
- Include docstrings with Args, Returns, and Raises sections
- Show realistic use cases that align with ArchiPy's patterns
- Keep examples concise but complete enough to understand usage
Admonitions¶
Use Material for MkDocs admonitions to highlight important information:
Building and Previewing Documentation¶
Preview the documentation locally:
Build the documentation:
Deploy to GitHub Pages:
Documentation Improvement Guidelines¶
When improving documentation:
- Ensure clarity and conciseness
- Include practical, runnable examples
- Explain "why" not just "how"
- Maintain logical navigation
- Use diagrams for complex concepts
- Validate that examples match the current API
- Test code examples to ensure they work correctly