Thank you for your interest in contributing to the OpenJobSpec Python SDK!
# Clone the repository
git clone https://github.com/openjobspec/ojs-python-sdk.git
cd ojs-python-sdk
# Create a virtual environment (Python 3.11+ required)
python3.12 -m venv .venv
source .venv/bin/activate
# Install with dev dependencies
pip install -e ".[dev]"# Run all checks (lint, typecheck, test)
make check
# Run individually
make lint # ruff check + ruff format --check
make format # auto-format with ruff
make typecheck # mypy src/
make test # pytest
make coverage # pytest with coverage report- Formatting: Ruff for linting and formatting (100-char line limit)
- Type hints: Complete type annotations on all public APIs;
mypy --strict - Docstrings: Google-style docstrings on public classes and methods
- Imports: Use
from __future__ import annotationsin all modules
- Fork the repository and create a feature branch from
main - Make your changes with clear, focused commits
- Ensure all checks pass:
make check - Update
CHANGELOG.mdunder[Unreleased]if the change is user-facing - Open a pull request with a clear description of the change
Follow Conventional Commits:
feat(client): add support for job priorities
fix(worker): prevent semaphore leak on fetch errors
docs: update README quick start example
test(retry): add edge case for max interval cap
chore: update ruff to 0.5
- Write tests for all new functionality
- Use
FakeTransportfromtests/conftest.pyfor client/worker tests - Use
pytest-httpxfor HTTP transport tests - Integration tests go in
tests/integration/and are gated behindOJS_INTEGRATION_TESTS=1
src/ojs/
├── __init__.py # Public API exports
├── _utils.py # Shared internal utilities
├── client.py # Client (producer) and SyncClient
├── errors.py # Exception hierarchy
├── events.py # Event types (CloudEvents-inspired)
├── job.py # Job, JobRequest, JobContext, JobState
├── middleware.py # Enqueue and execution middleware chains
├── otel.py # OpenTelemetry middleware (optional)
├── queue.py # Queue and QueueStats types
├── retry.py # RetryPolicy with ISO 8601 durations
├── testing.py # Fake mode and test assertions
├── transport/
│ ├── base.py # Abstract Transport interface
│ └── http.py # HTTPTransport (httpx-based)
├── worker.py # Worker (consumer) with structured concurrency
└── workflow.py # Workflow builders: chain(), group(), batch()
By contributing, you agree that your contributions will be licensed under the Apache 2.0 License.