Contributing
Setup
git clone https://github.com/KimSoungRyoul/aerospike-py.git
cd aerospike-py
make install # uv sync --all-groups
make build # uv run maturin develop --release
Start Aerospike
make run-aerospike-ce # Aerospike CE on port 18710
Build
make build # Release build (recommended)
maturin develop # Debug build (faster compile)
maturin build --release # Build wheel
Test
make test-unit # No server needed
make test-integration # Server needed
make test-all # All tests
Lint & Format
make lint # ruff check + cargo clippy
make fmt # ruff format + cargo fmt
Pre-commit
pip install pre-commit
pre-commit install
Project Structure
aerospike-py/
├── rust/src/ # PyO3 Rust bindings
│ ├── client.rs # Sync Client
│ ├── async_client.rs # Async Client
│ ├── errors.rs # Error → Exception
│ ├── types/ # Type converters
│ └── policy/ # Policy parsers
├── src/aerospike_py/ # Python package
├── tests/ # unit/ integration/ concurrency/ compatibility/
├── docs/ # Docusaurus
└── benchmark/ # Benchmarks
Making Changes
- Rust (
rust/src/): Edit, thenmaturin developto rebuild - Python (
src/aerospike_py/): Changes apply immediately - Tests: Add to
tests/unit/ortests/integration/ - Docs: Edit
docs/docs/, preview withcd docs && npm start
Architecture Notes
- Sync Client: Global Tokio runtime,
py.allow_threads(|| RUNTIME.block_on(...))releases GIL - Async Client:
pyo3_async_runtimes::tokio::future_into_py()returns Python coroutines - Type conversion: Python ↔ Rust
Valueenum intypes/value.rs - Error mapping:
aerospike_core::Error→ Python exceptions inerrors.rs