First off, thank you for considering contributing to Apache OpenDAL! Your help is greatly appreciated. This guide will provide you with all the information you need to get started.
Before you begin, please ensure you have the following tools installed:
All development commands are managed through a justfile. Setting up your environment is as simple as running one command.
Clone the repository:
git clone git@github.com:apache/opendal.git cd opendal/bindings/python
Set up the virtual environment and install dependencies:
just setup
This command will create a Python virtual environment in the .venv directory and install all necessary development and runtime dependencies using uv.
The justfile provides recipes for common development tasks. You can see all available commands by running just --list.
You can build a development or release version of the library.
Install for development: This builds the package and installs it in the current virtual environment, allowing you to immediately use it for testing.
just install-dev
Build a distributable wheel: If you need to create a wheel file for distribution.
# Build a development wheel just build-dev # Build an optimized release wheel just build-release
The built wheel will be located in the dist/ directory.
We use pytest for testing. The test recipe runs all tests within the virtual environment.
# Run all tests just test # Pass arguments directly to pytest # For example, run tests for the 'fs' operator matching 'test_write' OPENDAL_TEST=fs OPENDAL_FS_ROOT=/tmp just test -vk test_write
We use ruff for Python linting/formatting and cargo fmt/clippy for Rust. just makes it easy to ensure your code meets our quality standards.
Format all code:
just fmt
Check for linting errors:
just lint
Automatically fix what can be fixed:
just fix
Important! Before committing your changes, please run the pre-commit checks to ensure everything is formatted and linted correctly.
just pre-commit
The API documentation is built using mkdocs. This is automatically handled when you build the project.
# Building the project also builds the docs just build-dev
If you need to start fresh, the clean command will remove all build artifacts, caches, and the virtual environment.
just clean
This command removes the .venv, build artifacts, and Python cache files.
Thank you again for your contribution!