You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
simplify upstream dependencies to avoid resolution errors (#1429)
* simplify upstream dependecies to avoid resolution errors
* move to use dependency groups - PEP 753
* more docs
* fix doc build
* fix docs build for real
* fix upstream not installing mypy
* upstream workflow will report failures to install
Copy file name to clipboardExpand all lines: docs/docs/contributing.md
+50-42Lines changed: 50 additions & 42 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,66 +23,53 @@ The Python code is developed in the `icechunk-python` subdirectory. To make chan
23
23
cd icechunk-python
24
24
```
25
25
26
-
Create / activate a virtual environment:
26
+
#### Setting up your development environment
27
27
28
-
=== "Venv"
28
+
=== "uv (Recommended)"
29
29
30
-
```bash
31
-
python3 -m venv .venv
32
-
source .venv/bin/activate
33
-
```
34
-
35
-
=== "Conda / Mamba"
36
-
37
-
```bash
38
-
mamba create -n icechunk python=3.12 rust zarr
39
-
mamba activate icechunk
40
-
```
41
-
42
-
=== "uv"
30
+
The easiest way to get started is with [uv](https://docs.astral.sh/uv/), which handles virtual environments, dependencies, and building automatically:
43
31
44
32
```bash
33
+
# Install all development dependencies (includes test dependencies, mypy, ruff, maturin)
45
34
uv sync
35
+
36
+
# Activate the virtual environment
46
37
source .venv/bin/activate
47
-
```
48
38
49
-
Install `maturin`:
39
+
# Run tests
40
+
uv run pytest
50
41
51
-
=== "Venv"
42
+
# Run type checking
43
+
uv run mypy python
52
44
53
-
```bash
54
-
pip install maturin
45
+
# Run linting
46
+
uv run ruff check python
55
47
```
56
-
57
-
Build the project in dev mode:
58
-
59
-
```bash
60
-
maturin develop
61
-
62
-
# or with the optional dependencies
63
-
maturin develop --extras=test,benchmark
64
-
```
65
-
66
-
or build the project in editable mode:
48
+
=== "Venv"
67
49
68
50
```bash
69
-
pip install -e .
70
-
```
51
+
python3 -m venv .venv
52
+
source .venv/bin/activate
71
53
72
-
=== "uv"
54
+
# Install maturin and dependencies
55
+
pip install maturin
56
+
pip install --group dev
73
57
74
-
uv manages rebuilding as needed, so it will run the Maturin build when using `uv run`.
58
+
# Build the Rust extension
59
+
maturin develop
75
60
76
-
To explicitly use Maturin, install it globally.
61
+
=== "Conda / Mamba"
77
62
78
63
```bash
79
-
uv tool install maturin
80
-
```
64
+
mamba create -n icechunk python=3.12 rust zarr
65
+
mamba activate icechunk
81
66
82
-
Maturin may need to know it should work with uv, so add `--uv` to the CLI.
67
+
# Install maturin and dependencies
68
+
pip install maturin
69
+
pip install --group dev
83
70
84
-
```bash
85
-
maturin develop --uv --extras=test,benchmark
71
+
# Build the Rust extension
72
+
maturin develop
86
73
```
87
74
88
75
#### Testing
@@ -96,6 +83,27 @@ They can be run from the root of the repo with `docker compose up` (`ctrl-c` the
96
83
```bash
97
84
uv run pytest
98
85
```
86
+
=== "Venv/Conda"
87
+
88
+
```bash
89
+
pytest
90
+
```
91
+
92
+
#### Testing with Upstream Dependencies
93
+
94
+
To test Icechunk against development versions of upstream packages (zarr, xarray, dask, distributed), use the nightly wheels from the scientific-python-nightly-wheels repository:
Copy file name to clipboardExpand all lines: icechunk-python/README.md
+30-12Lines changed: 30 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,32 +4,50 @@ Python library for Icechunk Zarr Stores
4
4
5
5
## Getting Started
6
6
7
-
Activate the virtual environment:
7
+
### For Development
8
+
9
+
The recommended way to set up for development is with [uv](https://docs.astral.sh/uv/):
8
10
9
11
```bash
10
-
python3 -m venv .venv
12
+
# Install all development dependencies (test, mypy, ruff, maturin)
13
+
uv sync
14
+
15
+
# Activate the virtual environment
11
16
source .venv/bin/activate
17
+
18
+
# Run tests
19
+
uv run pytest
20
+
21
+
# Run type checking
22
+
uv run mypy python
23
+
24
+
# Run linting
25
+
uv run ruff check python
12
26
```
13
27
14
-
Install `maturin`:
28
+
uv automatically rebuilds the Rust extension as needed when you run commands with `uv run`.
29
+
30
+
### Alternative: Manual Setup with pip
31
+
32
+
If not using uv:
15
33
16
34
```bash
35
+
python3 -m venv .venv
36
+
source .venv/bin/activate
37
+
38
+
# Install maturin
17
39
pip install maturin
18
-
```
19
40
20
-
Build the project in dev mode:
41
+
# Install dev dependencies (includes test, mypy, ruff)
42
+
pip install --group dev
21
43
22
-
```bash
44
+
# Build the Rust extension
23
45
maturin develop
24
46
```
25
47
26
-
or build the project in editable mode:
27
-
28
-
```bash
29
-
pip install -e .
30
-
```
48
+
Note: Modern pip (>=21.3) supports dependency groups. If you have an older pip, upgrade with `pip install --upgrade pip`. When the Rust code changes, re-run `maturin develop` to rebuild.
31
49
32
-
**Note**: This only makes the python source code editable, the rust will need to be recompiled when it changes
50
+
**Note**: When using editable mode, only the Python source code is editable; the Rust code will need to be recompiled when it changes.
33
51
34
52
Now you can create or open an icechunk store for use with `zarr-python`:
0 commit comments