Contributing¶
We welcome contributions to the Incus Python SDK! This document provides guidelines for contributing to the project.
Getting Started¶
- Fork the repository on GitHub.
- Clone your fork locally:
git clone https://github.com/orbical-dev/incus_sdk.git
cd incus_sdk
- Create a virtual environment and install the development dependencies:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -e ".[dev]"
- Create a branch for your changes:
git checkout -b feature/your-feature-name
Development Guidelines¶
Code Style¶
We follow the PEP 8 style guide for Python code. You can use tools like flake8
and black
to ensure your code adheres to our style guidelines:
flake8 incus_sdk
black incus_sdk
Type Hints¶
We use type hints throughout the codebase. Please add appropriate type hints to your code:
def example_function(param1: str, param2: int) -> bool:
return True
Documentation¶
Please document your code using docstrings. We follow the Google style for docstrings:
def example_function(param1: str, param2: int) -> bool:
"""
Example function that demonstrates docstring style.
Args:
param1: Description of param1.
param2: Description of param2.
Returns:
Description of return value.
Raises:
ValueError: Description of when this error is raised.
"""
return True
Testing¶
Please add tests for your changes. We use pytest
for testing:
pytest tests/
Pull Request Process¶
- Update the documentation if necessary.
- Add or update tests as necessary.
- Ensure your code passes all tests and style checks.
- Submit a pull request to the main repository.
- The pull request will be reviewed by the maintainers.
- Once approved, your changes will be merged.
Code of Conduct¶
Please be respectful and considerate of others when contributing to the project. We strive to maintain a welcoming and inclusive community.