Development Guide¶
This guide provides information for developers working on the Google SecOps SDK for Python.
Development Environment Setup¶
Prerequisites¶
Python 3.7 or higher
pip (Python package installer)
Git
Setting Up Your Environment¶
Clone the repository:
git clone https://github.com/google/secops-wrapper.git cd secops-wrapper
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
Install development dependencies:
pip install -e ".[dev]"
Testing¶
Running Tests¶
We use pytest for testing. To run the tests:
pytest
To run tests with coverage:
pytest --cov=secops
Writing Tests¶
Place tests in the
tests/
directoryName test files with the prefix
test_
Use descriptive test names that explain what is being tested
Code Style¶
We follow the Google Python Style Guide. To check your code style:
# Run linting
flake8 src/ tests/
# Run type checking
mypy src/
Documentation¶
Building Documentation¶
To build the documentation locally:
cd docs
pip install -r requirements.txt
make html
The built documentation will be available in docs/_build/html/
.
To serve the documentation locally:
cd docs
make serve
Then open your browser to http://localhost:8000.
Writing Documentation¶
Use Markdown for documentation files
Follow the existing documentation structure
Include examples where appropriate
Document all public APIs with docstrings
Release Process¶
Update version in
pyproject.toml
Update
CHANGELOG.md
with the new version and changesCreate a new Git tag for the version
Build the distribution packages:
python -m build
Upload to PyPI:
python -m twine upload dist/*
Continuous Integration¶
We use GitHub Actions for continuous integration. The CI pipeline runs:
Linting
Type checking
Tests on multiple Python versions
Documentation building
All pull requests must pass CI checks before they can be merged.