Skip to content

Commit a76e738

Browse files
authored
ci: Migrate to uv for python (#1796)
## Which issue does this PR close? - Closes #1794 ## What changes are included in this PR? Migrate to uv ## Are these changes tested? --------- Signed-off-by: Xuanwo <[email protected]>
1 parent 4a6ea15 commit a76e738

File tree

5 files changed

+811
-28
lines changed

5 files changed

+811
-28
lines changed

.github/workflows/bindings_python_ci.yml

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,28 @@ jobs:
8080
- uses: actions/checkout@v5
8181
- uses: actions/setup-python@v6
8282
with:
83-
python-version: 3.9
83+
python-version: 3.12
8484
- uses: PyO3/maturin-action@v1
8585
with:
8686
working-directory: "bindings/python"
8787
command: build
8888
args: --out dist --sdist
89+
- name: Install uv
90+
shell: bash
91+
run: |
92+
python -m pip install uv==0.9.3
93+
- name: Sync dependencies
94+
working-directory: "bindings/python"
95+
shell: bash
96+
run: |
97+
uv sync --group dev --no-install-project
98+
- name: Install built wheel
99+
working-directory: "bindings/python"
100+
shell: bash
101+
run: |
102+
uv pip install --reinstall dist/pyiceberg_core-*.whl
89103
- name: Run tests
90104
working-directory: "bindings/python"
91105
shell: bash
92106
run: |
93-
set -e
94-
pip install hatch==1.14.2
95-
hatch run dev:pip install dist/pyiceberg_core-*.whl --force-reinstall
96-
hatch run dev:test
107+
uv run --group dev --no-sync pytest

.licenserc.yaml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,17 @@ header:
2121
copyright-owner: Apache Software Foundation
2222

2323
paths-ignore:
24-
- 'LICENSE'
25-
- 'NOTICE'
26-
- '.gitattributes'
27-
- '**/*.json'
24+
- "LICENSE"
25+
- "NOTICE"
26+
- ".gitattributes"
27+
- "**/*.json"
2828
# Generated content by mdbook
29-
- 'website/book'
29+
- "website/book"
3030
# Generated content by scripts
31-
- '**/DEPENDENCIES.*.tsv'
31+
- "**/DEPENDENCIES.*.tsv"
3232
# Release distributions
33-
- 'dist/*'
34-
- 'Cargo.lock'
35-
- '.github/PULL_REQUEST_TEMPLATE.md'
33+
- "dist/*"
34+
- "Cargo.lock"
35+
- "bindings/python/uv.lock"
36+
- ".github/PULL_REQUEST_TEMPLATE.md"
3637
comment: on-failure

bindings/python/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,26 @@ This project is used to build an Iceberg-rust powered core for [PyIceberg](https
2323

2424
## Setup
2525

26-
Install Hatch:
26+
Install [uv](https://docs.astral.sh/uv/getting-started/installation/):
2727

2828
```shell
29-
pip install hatch==1.12.0
29+
pip install uv==0.9.3
3030
```
3131

32-
Hatch uses [uv](https://docs.astral.sh/uv/) as a backend by default, so [make sure that it is installed](https://docs.astral.sh/uv/getting-started/installation/) as well.
32+
Set up the development environment:
33+
34+
```shell
35+
uv sync --group dev
36+
```
3337

3438
## Build
3539

3640
```shell
37-
hatch run dev:develop
41+
uv run --group dev maturin develop
3842
```
3943

4044
## Test
4145

4246
```shell
43-
hatch run dev:test
47+
uv run --group dev pytest
4448
```

bindings/python/pyproject.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,13 @@ classifiers = [
2525
"Intended Audience :: Developers",
2626
"License :: OSI Approved :: Apache Software License",
2727
"Operating System :: OS Independent",
28-
"Programming Language :: Python :: 3.9",
2928
"Programming Language :: Python :: 3.10",
3029
"Programming Language :: Python :: 3.11",
3130
"Programming Language :: Python :: 3.12",
3231
]
3332
name = "pyiceberg-core"
3433
readme = "project-description.md"
35-
requires-python = "~=3.9"
34+
requires-python = ">=3.10,<3.13"
3635
dynamic = ["version"]
3736
license = { file = "LICENSE" }
3837

@@ -48,10 +47,11 @@ include = [
4847
[tool.ruff.lint]
4948
ignore = ["F403", "F405"]
5049

51-
[tool.hatch.envs.dev]
52-
dependencies = ["maturin>=1.0,<2.0", "pytest>=8.3.2", "datafusion==50.*", "pyiceberg[sql-sqlite,pyarrow]>=0.10.0", "fastavro>=1.11.1"]
53-
54-
[tool.hatch.envs.dev.scripts]
55-
build = "maturin build --out dist --sdist"
56-
develop = "maturin develop"
57-
test = "pytest"
50+
[dependency-groups]
51+
dev = [
52+
"maturin>=1.0,<2.0",
53+
"pytest>=8.3.2",
54+
"datafusion==50.*",
55+
"pyiceberg[sql-sqlite,pyarrow] @ git+https://github.com/apache/iceberg-python.git@d3eb149fe99b14e714a06e727b69cd617c6c052d",
56+
"fastavro>=1.11.1",
57+
]

0 commit comments

Comments
 (0)