We recommend using uv for managing Python versions and dependencies. Install uv:
curl -LsSf https://astral.sh/uv/install.sh | shOr using pip:
pip install uvPython >= 3.11
With uv, you can create a project with the correct Python version:
uv python install 3.11git clone https://github.com/elumobility/ocpi-python.gitcd ocpi-python# Install all dependencies including dev tools
uv sync --all-extras
# Or install specific extras
uv sync --extra dev --extra docsThis will:
- Create a virtual environment
- Install all dependencies from
pyproject.toml - Install development and documentation dependencies
With uv, you can run commands in the virtual environment:
uv run <command>Or activate the shell:
source .venv/bin/activate # On Unix/macOS
# or
.venv\Scripts\activate # On Windowsuv run pre-commit installTo run tests, use:
uv run pytestOr with coverage:
uv run pytest --cov=ocpi --cov-report=term-missingTo build documentation locally:
# Install docs dependencies first
uv sync --extra docs
# Build HTML documentation with MkDocs
uv run mkdocs build
# Serve documentation locally
uv run mkdocs serve- Create a feature branch
- Make your changes
- Run tests:
uv run pytest - Run linting:
uv run ruff check . - Run type checking:
uv run mypy ocpi - Commit your changes (pre-commit hooks will run automatically)
- Push and create a Pull Request