Contributing to Apiary¶
Thank you for your interest in contributing to Apiary!
Quick Contribution Guide¶
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes following our code style
- Run tests:
pytest - Format code:
ruff format . - Lint code:
ruff check . - Type check:
ty check . - Commit and push your changes
- Open a Pull Request
Development Setup¶
git clone https://github.com/lancereinsmith/apiary.git
cd apiary
uv sync
uv run apiary init
uv run apiary serve --reload
Code Style¶
- Use type hints for all function parameters and return values
- Write docstrings for modules and functions
- Keep functions focused and single-purpose
- Maximum line length: 88 characters
- Follow existing code patterns
Testing¶
Write tests for all new features:
import pytest
from fastapi.testclient import TestClient
def test_endpoint_success(client: TestClient):
"""Test that the endpoint returns success for valid input."""
response = client.get("/api/endpoint")
assert response.status_code == 200
assert response.json()["status"] == "success"
Run tests with:
Pull Request Checklist¶
Before submitting:
- Tests pass locally
- Code is formatted with
ruff format . - No linting errors from
ruff check . - Type checking passes with
ty check . - Documentation updated (if needed)
- Commit messages are descriptive
Reporting Issues¶
When reporting bugs, include:
- Clear description of the issue
- Steps to reproduce
- Expected vs actual behavior
- Environment (Python version, OS, Apiary version)
- Relevant logs or error messages
Feature Requests¶
When requesting features, include:
- Clear description of the feature
- Use case and motivation
- Proposed implementation approach (if applicable)
- Any alternative solutions considered
Code of Conduct¶
- Be respectful
- Give constructive feedback
Questions?¶
- Check the documentation
- Search existing issues
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to Apiary!