Thank you for considering contributing to PyOutlineAPI! Whether you have suggestions, bug reports, or code improvements, your input is valuable.
If you encounter any issues or bugs, please follow these steps:
- Search for Existing Issues: Check the Issues section to see if your issue has already been reported.
- Create a New Issue: If you don't find an existing
issue, open a new issue with:
- A descriptive title
- Steps to reproduce the issue
- Expected and actual results
- Python version (3.10+) and PyOutlineAPI version
- Any relevant code snippets or error messages
- Environment details (OS, Outline server version)
For new feature or improvement suggestions:
- Check Existing Feature Requests: Review the Issues to see if similar features have been suggested.
- Open a New Feature Request: Submit a new feature request
with:
- A descriptive title
- Detailed description of the proposed feature
- Use cases and benefits
- Example code or API design if applicable
To contribute code:
-
Fork and Clone:
git clone https://github.com/orenlab/pyoutlineapi.git cd pyoutlineapi
-
Set Up Development Environment:
# Install Poetry if you haven't already curl -sSL https://install.python-poetry.org | python3 - # Install dependencies poetry install # Activate virtual environment poetry shell
-
Create a Feature Branch:
git checkout -b feature/your-feature-name # or git checkout -b fix/issue-description
-
Make Your Changes:
- Follow the existing code structure
- Use type hints consistently (Python 3.10+ typing features)
- Add docstrings with examples (see existing code)
- Update tests if needed
-
Test Your Changes:
# Run tests with coverage poetry run pytest # Type checking poetry run mypy pyoutlineapi # Code formatting poetry run black pyoutlineapi tests # Linting poetry run flake8 pyoutlineapi tests
-
Submit a Pull Request:
- Write a clear PR description
- Link related issues
- Include any necessary documentation updates
We follow strict coding standards to maintain consistency:
- Follow PEP 8 conventions
- Use modern type hints (Python 3.10+)
- Maximum line length: 88 characters (Black default)
- Use descriptive variable names
- Use Google-style docstrings with type information
- For non-private methods, include examples in docstrings (see existing code)
- Example:
async def create_access_key( self, *, name: Optional[str] = None, port: Optional[int] = None, ) -> Union[JsonDict, AccessKey]: """ Create a new access key. Args: name: Optional key name port: Optional port number (1-65535) Returns: New access key details Examples: >>> async with AsyncOutlineClient(...) as client: ... key = await client.create_access_key(name="User 1") ... print(f"Created key: {key.access_url}") """
- Write unit tests for new features
- Use pytest fixtures and parametrize when appropriate
- Mock external dependencies
- Maintain high test coverage (enforced by pytest-cov)
Follow the Conventional Commits specification:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat
: New featurefix
: Bug fixdocs
: Documentation changesstyle
: Code style/formatting changesrefactor
: Code refactoringtest
: Adding/updating testschore
: Maintenance tasks
Example:
feat(client): add support for custom encryption methods
- Added method parameter to create_access_key
- Updated documentation with examples
- Added unit tests for new functionality
Closes #123
-
Required Dependencies:
- Python 3.10 or higher
- Poetry for package management
- Outline server (for integration testing)
-
Development Tools: All development dependencies are managed by Poetry and include:
- pytest-cov for test coverage
- black for code formatting
- mypy for type checking
- flake8 for linting
-
Environment Variables for Testing:
OUTLINE_API_URL=https://your-server:port/secret OUTLINE_CERT_SHA256=your-cert-fingerprint
Key project settings are managed in pyproject.toml
, including:
- Python version requirement (3.10+)
- Dependencies:
- pydantic (^2.9.2)
- aiohttp (^3.11.11)
- Development dependencies for testing and code quality
- Pytest configuration with coverage reporting
- Issues: GitHub Issues
- Email:
pytelemonbot@mail.ru
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to PyOutlineAPI!