- Python 3.11+
- uv (package manager)
- Docker
# Clone the repository
git clone https://github.com/SAP/cloud-sdk-python.git
cd cloud-sdk-python
# Create a virtual environment
uv venv
# Activate the virtual environment
source .venv/bin/activate
# Install all development dependencies
uv sync --all-extras --group devActivation notes:
- macOS/Linux (bash/zsh):
source .venv/bin/activate - Windows (PowerShell):
.venv\Scripts\Activate.ps1 - Windows (cmd):
.venv\Scripts\activate.bat
Tip:
- After changing
pyproject.toml, runuv syncagain to update dependencies.
uv run ty check .Run all quality checks before committing:
# Lint
uv run ruff check .
# Format check
uv run ruff format --check .
# Type check
uv run ty check .Automatically run quality checks before each commit using pre-commit hooks.
-
Install pre-commit:
uv pip install pre-commit
-
Install the git hooks:
pre-commit install
-
Run on all files (one-time init):
pre-commit run --all-files
The .pre-commit-config.yaml file configures hooks to:
- Check YAML files
- Fix end-of-file issues
- Remove trailing whitespace
- Run
ruff format --check(code formatting) - Run
ruff check --fix(linting with auto-fix) - Run
ty check(type checking)
Hooks run automatically on git commit. If checks fail, the commit is blocked until issues are fixed.
Run hooks manually without committing:
# Run on all files
pre-commit run --all-files
# Run on staged files only
pre-commit run
# Run specific hook
pre-commit run ruff-checkuv build# All tests
uv run pytest -v
# Unit tests only (exclude integration)
uv run pytest -m "not integration" -q
# Integration tests (see INTEGRATION_TESTS.md)
uv run pytest -m integration -vSee Integration Tests for more details on integration testing.
# Basic coverage
uv run pytest --cov=srcSometimes we want to validate our changes in a real application before publishing them to PyPI. It's extremely important to test like that to ensure that there are no issues with our changes and we encourage contributors to do so.
For that, we can reference the package using the GitHub endpoint in the requirements.txt or pyproject.toml of the test application. This way, we can install the package directly from the branch, commit, or tag that contains our changes without needing to publish it to PyPI first.
Using requirements.txt:
# Other dependencies...
sap-cloud-sdk @ git+https://github.com/sap/cloud-sdk-python@<branch-or-commit-or-tag>
# You also could use your forked repository if you have one, for example:
sap-cloud-sdk @ git+https://github.com/your-username/cloud-sdk-python@<branch-or-commit-or-tag>Using pyproject.toml:
dependencies = [
# Other dependencies...
"sap-cloud-sdk @ git+https://github.com/sap/cloud-sdk-python@<branch-or-commit-or-tag>"
# You also could use your forked repository if you have one, for example:
"sap-cloud-sdk @ git+https://github.com/your-username/cloud-sdk-python@<branch-or-commit-or-tag>"
]See the pip official documentation for more details on installing packages from VCS like Git: VCS Support
For the end-to-end process to cut a release and publish artifacts, see the Release and Deployment Guide.
For guidance on contributing with new features, see the Contributing Guide.