Skip to content

Commit 9178ee4

Browse files
authored
docs: update contributing.md with uv (#2733)
# Rationale for this change Update contributing documentation to reflect the migration from Poetry to uv for dependency management in #2601. https://docs.astral.sh/uv/ ## Are these changes tested? `make lint && make docs-serve` <img width="625" height="600" alt="image" src="https://github.com/user-attachments/assets/5ff10875-ac2c-432e-b34d-11833968656d" /> ## Are there any user-facing changes? doc changes
1 parent 75d78c1 commit 9178ee4

File tree

1 file changed

+42
-14
lines changed

1 file changed

+42
-14
lines changed

mkdocs/docs/contributing.md

Lines changed: 42 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,61 @@ For first-time contributors, feel free to check out our [good first issues](http
3434

3535
The PyIceberg Project is hosted on GitHub at <https://github.com/apache/iceberg-python>.
3636

37-
For the development, Poetry is used for packing and dependency management. You can install this using:
37+
For development, [uv](https://docs.astral.sh/uv/) is used for dependency management and packaging. uv is a Python package installer and resolver, written in Rust, that serves as a drop-in replacement for pip, and virtualenv.
38+
39+
### Getting Started
40+
41+
Install uv and set up the development environment:
3842

3943
```bash
40-
make install-poetry
44+
make install
4145
```
4246

43-
To get started, you can run `make install`, which installs all the dependencies of the Iceberg library. This also installs the development dependencies. If you don't want to install the development dependencies, you need to install using `poetry install --without dev` instead of `make install`.
47+
This will install uv if needed, create a virtual environment in `.venv`, and install all dependencies.
48+
49+
If you only want to just install uv:
50+
51+
```bash
52+
make install-uv
53+
```
4454

45-
If you want to install the library on the host, you can simply run `pip3 install -e .`. If you wish to use a virtual environment, you can run `poetry shell`. Poetry will open up a virtual environment with all the dependencies set.
55+
### Python Version Selection
4656

47-
> **Note:** If you want to use `poetry shell`, you need to install it using `pip install poetry-plugin-shell`. Alternatively, you can run commands directly with `poetry run`.
57+
You can specify which Python version to use when creating your virtual environment:
4858

49-
To set up IDEA with Poetry:
59+
```bash
60+
PYTHON=3.12 make install # Create environment with Python 3.12
61+
make test # Run tests against Python 3.12
62+
```
63+
64+
> **Tip:** `uv python list` shows available interpreters. `uv python install 3.12` can install one if needed.
65+
66+
### IDE Setup
67+
68+
After running `make install`, configure your IDE to use the Python interpreter at `.venv/bin/python`.
69+
70+
**To set up IDEA with uv:**
5071

5172
- Open up the Python project in IntelliJ
52-
- Make sure that you're on latest main (that includes Poetry)
73+
- Make sure that you're on latest main
5374
- Go to File -> Project Structure (⌘;)
5475
- Go to Platform Settings -> SDKs
55-
- Click the + sign -> Add Python SDK
56-
- Select Poetry Environment from the left hand side bar and hit OK
57-
- It can take some time to download all the dependencies based on your internet
58-
- Go to Project Settings -> Project
59-
- Select the Poetry SDK from the SDK dropdown, and click OK
76+
- Add Python SDK -> Virtualenv Environment -> Existing environment
77+
- Point to `.venv/bin/python`
78+
79+
**VS Code:**
80+
81+
- Press Cmd/Ctrl+Shift+P -> "Python: Select Interpreter"
82+
- Choose `.venv/bin/python`
83+
84+
### Advanced uv Usage
6085

61-
For IDEA ≤2021 you need to install the [Poetry integration as a plugin](https://plugins.jetbrains.com/plugin/14307-poetry/).
86+
For full control over your environment, you can use uv commands directly. See the [uv documentation](https://docs.astral.sh/uv/) to learn more about:
6287

63-
Now you're set using Poetry, and all the tests will run in Poetry, and you'll have syntax highlighting in the pyproject.toml to indicate stale dependencies.
88+
- Managing dependencies with `uv add` and `uv remove`
89+
- Python version management with `uv python`
90+
- Running commands with `uv run`
91+
- Lock file management with `uv.lock`
6492

6593
## Installation from source
6694

0 commit comments

Comments
 (0)