diff --git a/docs/docs/contributing.md b/docs/docs/contributing.md index 4b3b7d65d..33734586a 100644 --- a/docs/docs/contributing.md +++ b/docs/docs/contributing.md @@ -27,16 +27,25 @@ cd icechunk-python === "uv (Recommended)" - The easiest way to get started is with [uv](https://docs.astral.sh/uv/), which handles virtual environments, dependencies, and building automatically: + The easiest way to get started is with [uv](https://docs.astral.sh/uv/), which handles virtual environments and dependencies: ```bash # Install all development dependencies (includes test dependencies, mypy, ruff, maturin) uv sync - # Activate the virtual environment - source .venv/bin/activate + # Configure maturin-import-hook for fast incremental Rust compilation + uv run -m maturin_import_hook site install + + # Build the Rust extension + maturin develop --uv + ``` + + **Why these steps?** Icechunk is a mixed Python/Rust project. The `maturin-import-hook` enables incremental Rust compilation (7-20 seconds) instead of full rebuilds (5+ minutes) every time you run tests or import the module. This makes development significantly faster. - # Run tests + Now you can run tests and other commands: + + ```bash + # Run tests (Rust changes will automatically trigger incremental rebuild) uv run pytest # Run type checking @@ -45,6 +54,7 @@ cd icechunk-python # Run linting uv run ruff check python ``` + === "Venv" ```bash @@ -57,6 +67,7 @@ cd icechunk-python # Build the Rust extension maturin develop + ``` === "Conda / Mamba" diff --git a/icechunk-python/pyproject.toml b/icechunk-python/pyproject.toml index 59cf35081..638af876d 100644 --- a/icechunk-python/pyproject.toml +++ b/icechunk-python/pyproject.toml @@ -24,7 +24,13 @@ authors = [{ name = "Earthmover", email = "info@earthmover.io" }] dependencies = ["zarr>=3,!=3.0.3"] [dependency-groups] -dev = [{ include-group = "test" }, "mypy", "ruff", "maturin>=1.7,<2.0"] +dev = [ + { include-group = "test" }, + "mypy", + "ruff", + "maturin>=1.7,<2.0", + "maturin-import-hook>=0.3.0", +] test = [ "boto3", "coverage", @@ -97,14 +103,8 @@ python-source = "python" exclude = ["README.md"] [tool.uv] -# Rebuild package when any Rust files change -cache-keys = [ - { file = "pyproject.toml" }, - { file = "Cargo.toml" }, - { file = "src/**/*.rs" }, - { file = "../icechunk/Cargo.toml" }, - { file = "../icechunk/src/**/*.rs" }, -] +# Disable automatic package building - we use maturin-import-hook for faster dev cycles +package = false [tool.pytest.ini_options] asyncio_mode = "auto"