Welcome, and thank you for your interest in contributing to our project! Below, you'll find step-by-step instructions to prepare your development environment and guide you through submitting your contributions effectively.
Before starting, please make sure you have the following installed:
- Python 3.9 or higher: Check your Python version with
python --version
. - Poetry: For managing dependencies and packaging. Follow the installation instructions here.
-
Install pre-commit: This tool ensures your contributions meet our code quality standards.
pip install pre-commit pre-commit install
-
Install Project Dependencies: Navigate to the project directory and run:
make deps
-
Run Tests: Ensure your changes don't break anything:
make test
-
Check Code Style (Linting): To ensure your code complies with our style guide:
make lint
-
Format Code: Automatically format your code to match our project's coding standards:
make format
-
Build the Project
make build
- Regenerate Protobuf Code: If you modify
workload.proto
, regenerate the Python code:Then, amendmake compile-proto
workload_pb2_grpc.py
by adjusting the import line:from . import workload_pb2 as workload__pb2
- Fork the repository: Start by forking the repository to your GitHub account.
- Clone your fork: Clone the repository to your local machine.
git clone [email protected]:<your_github_account>/py-spiffe.git
- Create a feature branch: Make changes in a new branch.
git checkout -b feature/fooBar
- Make your changes: Add your contribution.
- Commit your changes: Use clear, concise commit messages.
git commit -am 'Add some fooBar' --signoff
- Push to your fork: Upload your branch to GitHub.
git push origin feature/fooBar
- Open a pull request: Submit your changes for review by opening a pull request to the upstream main branch.
- We follow the Google Python Style Guide (guide link).
- Docstrings are crucial for modules, classes, and functions. Include PEP 484 type annotations in function signatures rather than in docstrings.