Skip to content

Commit f47c266

Browse files
committed
Add support for UV dependency management
1 parent 7c6792e commit f47c266

13 files changed

+6242
-7277
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
version: 2
2121
updates:
22-
- package-ecosystem: "pip"
22+
- package-ecosystem: "uv"
2323
directory: "/"
2424
schedule:
2525
interval: "weekly"

.github/workflows/nightly-pypi-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ jobs:
3939
with:
4040
python-version: 3.12
4141

42-
- name: Install Poetry
43-
run: make install-poetry
42+
- name: Install UV
43+
run: make install-uv
4444

4545
- name: Set version
4646
id: set-version
4747
run: |
48-
CURRENT_VERSION=$(poetry version --short)
48+
CURRENT_VERSION=$(uv version --short)
4949
TIMESTAMP=$(date +%Y%m%d%H%M%S)
5050
echo "VERSION=${CURRENT_VERSION}.dev${TIMESTAMP}" >> "$GITHUB_OUTPUT"
5151

.github/workflows/pypi-build-artifacts.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ jobs:
4747
3.11
4848
3.12
4949
50-
- name: Install poetry
51-
run: make install-poetry
50+
- name: Install UV
51+
run: make install-uv
5252

5353
- name: Set version with RC
5454
env:
5555
VERSION: ${{ inputs.VERSION }}
56-
run: python -m poetry version "${{ env.VERSION }}"
56+
run: python -m uv version "${{ env.VERSION }}"
5757

5858
# Publish the source distribution with the version that's in
5959
# the repository, otherwise the tests will fail

.github/workflows/python-ci-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
- uses: actions/setup-python@v6
4040
with:
4141
python-version: 3.12
42-
- name: Install poetry
43-
run: make install-poetry
42+
- name: Install UV
43+
run: make install-uv
4444
- name: Install
4545
run: make docs-install
4646
- name: Build docs

.github/workflows/python-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ jobs:
5454
- uses: actions/setup-python@v6
5555
with:
5656
python-version: ${{ matrix.python }}
57-
- name: Install poetry
58-
run: make install-poetry
57+
- name: Install UV
58+
run: make install-uv
5959
- name: Install system dependencies
6060
run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos
6161
- name: Install

.github/workflows/python-release-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ jobs:
3434
- uses: actions/setup-python@v6
3535
with:
3636
python-version: ${{ matrix.python }}
37-
- name: Install poetry
38-
run: make install-poetry
37+
- name: Install UV
38+
run: make install-uv
3939
- name: Install docs
4040
run: make docs-install
4141
- name: Build docs

.github/workflows/python-release.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,20 @@ jobs:
9797
with:
9898
python-version: 3.12
9999

100-
- name: Install Poetry
101-
run: make install-poetry
100+
- name: Install UV
101+
run: make install-uv
102102

103103
- name: Validate current pyiceberg version
104104
env:
105105
VERSION: ${{ needs.validate-inputs.outputs.VERSION }}
106106
run: |
107-
# Extract the current version from Poetry
108-
current_pyiceberg_version=$(poetry version --short)
109-
echo "Detected Poetry version: $current_pyiceberg_version"
107+
# Extract the current version from UV
108+
current_pyiceberg_version=$(uv version --short)
109+
echo "Detected UV version: $current_pyiceberg_version"
110110
111-
# Compare the input version with the Poetry version
111+
# Compare the input version with the UV version
112112
if [[ "$VERSION" != "$current_pyiceberg_version" ]]; then
113-
echo "Error: Input version ($VERSION) does not match the Poetry version ($current_pyiceberg_version)"
113+
echo "Error: Input version ($VERSION) does not match the UV version ($current_pyiceberg_version)"
114114
exit 1
115115
fi
116116

.github/workflows/svn-build-artifacts.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,13 @@ jobs:
4747
3.11
4848
3.12
4949
50-
- name: Install poetry
51-
run: make install-poetry
50+
- name: Install UV
51+
run: make install-uv
5252

5353
# Publish the source distribution with the version that's in
5454
# the repository, otherwise the tests will fail
5555
- name: Compile source distribution
56-
run: python3 -m poetry build --format=sdist
56+
run: uv build --sdist --wheel
5757
if: startsWith(matrix.os, 'ubuntu')
5858

5959
- name: Build wheels

Makefile

Lines changed: 29 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,10 @@ COVERAGE ?= 0 # Set COVERAGE=1 to enable coverage: make test COVERAGE=1
2323
COVERAGE_FAIL_UNDER ?= 85 # Minimum coverage % to pass: make coverage-report COVERAGE_FAIL_UNDER=70
2424
KEEP_COMPOSE ?= 0 # Set KEEP_COMPOSE=1 to keep containers after integration tests
2525

26-
PIP = python -m pip
27-
28-
POETRY_VERSION = 2.2.1
29-
POETRY = python -m poetry
30-
3126
ifeq ($(COVERAGE),1)
32-
TEST_RUNNER = $(POETRY) run coverage run --parallel-mode --source=pyiceberg -m
27+
TEST_RUNNER = uv run coverage run --parallel-mode --source=pyiceberg -m
3328
else
34-
TEST_RUNNER = $(POETRY) run
29+
TEST_RUNNER = uv run
3530
endif
3631

3732
ifeq ($(KEEP_COMPOSE),1)
@@ -55,24 +50,26 @@ help: ## Display this help message
5550

5651
##@ Setup
5752

58-
install-poetry: ## Ensure Poetry is installed at the specified version
59-
@if ! command -v ${POETRY} &> /dev/null; then \
60-
echo "Poetry not found. Installing..."; \
61-
${PIP} install poetry==$(POETRY_VERSION); \
53+
install-uv: ## Ensure uv is installed
54+
@if ! command -v uv &> /dev/null; then \
55+
echo "uv not found. Installing..."; \
56+
curl -LsSf https://astral.sh/uv/install.sh | sh; \
57+
else \
58+
echo "uv is already installed."; \
59+
fi
60+
61+
setup-venv: ## Create virtual environment
62+
@if [ ! -d .venv ]; then \
63+
echo "Creating virtual environment."; \
64+
uv venv --python $(PYTHON_VERSION); \
6265
else \
63-
INSTALLED_VERSION=$$(${PIP} show poetry | grep Version | awk '{print $$2}'); \
64-
if [ "$$INSTALLED_VERSION" != "$(POETRY_VERSION)" ]; then \
65-
echo "Updating Poetry to version $(POETRY_VERSION)..."; \
66-
${PIP} install --upgrade poetry==$(POETRY_VERSION); \
67-
else \
68-
echo "Poetry version $(POETRY_VERSION) already installed."; \
69-
fi; \
66+
echo "Virtual environment already exists."; \
7067
fi
7168

72-
install-dependencies: ## Install all dependencies including extras
73-
$(POETRY) install --all-extras
69+
install-dependencies: setup-venv ## Install all dependencies including extras
70+
uv sync --all-extras
7471

75-
install: install-poetry install-dependencies ## Install Poetry and dependencies
72+
install: install-uv install-dependencies ## Install uv and dependencies
7673

7774
# ===============
7875
# Code Validation
@@ -84,7 +81,7 @@ check-license: ## Check license headers
8481
./dev/check-license
8582

8683
lint: ## Run code linters via prek (pre-commit hooks)
87-
$(POETRY) run prek run -a
84+
uv run prek run -a
8885

8986
# ===============
9087
# Testing Section
@@ -101,7 +98,7 @@ test-integration-setup: ## Start Docker services for integration tests
10198
docker compose -f dev/docker-compose-integration.yml kill
10299
docker compose -f dev/docker-compose-integration.yml rm -f
103100
docker compose -f dev/docker-compose-integration.yml up -d --wait
104-
$(POETRY) run python dev/provision.py
101+
uv run python dev/provision.py
105102

106103
test-integration-exec: ## Run integration tests (excluding provision)
107104
$(TEST_RUNNER) pytest tests/ -m integration $(PYTEST_ARGS)
@@ -133,25 +130,25 @@ test-coverage: COVERAGE=1
133130
test-coverage: test test-integration test-s3 test-adls test-gcs coverage-report ## Run all tests with coverage and report
134131

135132
coverage-report: ## Combine and report coverage
136-
${POETRY} run coverage combine
137-
${POETRY} run coverage report -m --fail-under=$(COVERAGE_FAIL_UNDER)
138-
${POETRY} run coverage html
139-
${POETRY} run coverage xml
133+
uv run coverage combine
134+
uv run coverage report -m --fail-under=$(COVERAGE_FAIL_UNDER)
135+
uv run coverage html
136+
uv run coverage xml
140137

141138
# ================
142139
# Documentation
143140
# ================
144141

145142
##@ Documentation
146143

147-
docs-install: ## Install docs dependencies
148-
${POETRY} install --with docs
144+
docs-install: ## Install docs dependencies (included in default groups)
145+
uv sync --group docs
149146

150147
docs-serve: ## Serve local docs preview (hot reload)
151-
${POETRY} run mkdocs serve -f mkdocs/mkdocs.yml
148+
uv run mkdocs serve -f mkdocs/mkdocs.yml
152149

153150
docs-build: ## Build the static documentation site
154-
${POETRY} run mkdocs build -f mkdocs/mkdocs.yml --strict
151+
uv run mkdocs build -f mkdocs/mkdocs.yml --strict
155152

156153
# ===================
157154
# Project Maintenance
@@ -161,7 +158,7 @@ docs-build: ## Build the static documentation site
161158

162159
clean: ## Remove build artifacts and caches
163160
@echo "Cleaning up Cython and Python cached files..."
164-
@rm -rf build dist *.egg-info
161+
@rm -rf build dist *.egg-info .venv
165162
@find . -name "*.so" -exec echo Deleting {} \; -delete
166163
@find . -name "*.pyc" -exec echo Deleting {} \; -delete
167164
@find . -name "__pycache__" -exec echo Deleting {} \; -exec rm -rf {} +

dev/.rat-excludes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
build
44
.git
55
.gitignore
6-
poetry.lock
6+
uv.lock
77
mkdocs/*

0 commit comments

Comments
 (0)