1818# Configuration Variables
1919# ========================
2020
21+ PYTHON ?= # Override with e.g. PYTHON=3.11 to use specific Python version
2122PYTEST_ARGS ?= -v -x # Override with e.g. PYTEST_ARGS="-vv --tb=short"
2223COVERAGE ?= 0 # Set COVERAGE=1 to enable coverage: make test COVERAGE=1
2324COVERAGE_FAIL_UNDER ?= 85 # Minimum coverage % to pass: make coverage-report COVERAGE_FAIL_UNDER=70
2425KEEP_COMPOSE ?= 0 # Set KEEP_COMPOSE=1 to keep containers after integration tests
2526
26- PIP = python -m pip
27-
28- POETRY_VERSION = 2.2.1
29- POETRY = python -m poetry
27+ # Set Python argument for uv commands if PYTHON is specified
28+ ifneq ($(PYTHON ) ,)
29+ PYTHON_ARG = --python $(PYTHON )
30+ else
31+ PYTHON_ARG =
32+ endif
3033
3134ifeq ($(COVERAGE ) ,1)
32- TEST_RUNNER = $( POETRY ) run coverage run --parallel-mode --source=pyiceberg -m
35+ TEST_RUNNER = uv run coverage run --parallel-mode --source=pyiceberg -m
3336else
34- TEST_RUNNER = $( POETRY ) run
37+ TEST_RUNNER = uv run
3538endif
3639
3740ifeq ($(KEEP_COMPOSE ) ,1)
@@ -55,24 +58,26 @@ help: ## Display this help message
5558
5659# #@ Setup
5760
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 ) ; \
61+ install-uv : # # Ensure uv is installed
62+ @if ! command -v uv & > /dev/null; then \
63+ echo " uv not found. Installing..." ; \
64+ curl -LsSf https://astral.sh/uv/install.sh | sh; \
65+ else \
66+ echo " uv is already installed." ; \
67+ fi
68+
69+ setup-venv : # # Create virtual environment
70+ @if [ ! -d .venv ]; then \
71+ echo " Creating virtual environment." ; \
72+ uv venv $(PYTHON_ARG ) ; \
6273 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 ; \
74+ echo " Virtual environment already exists." ; \
7075 fi
7176
72- install-dependencies : # # Install all dependencies including extras
73- $( POETRY ) install --all-extras
77+ install-dependencies : setup-venv # # Install all dependencies including extras
78+ uv sync --all-extras
7479
75- install : install-poetry install-dependencies # # Install Poetry and dependencies
80+ install : install-uv install-dependencies # # Install uv and dependencies
7681
7782# ===============
7883# Code Validation
@@ -84,7 +89,7 @@ check-license: ## Check license headers
8489 ./dev/check-license
8590
8691lint : # # Run code linters via prek (pre-commit hooks)
87- $( POETRY ) run prek run -a
92+ uv run prek run -a
8893
8994# ===============
9095# Testing Section
@@ -101,7 +106,7 @@ test-integration-setup: ## Start Docker services for integration tests
101106 docker compose -f dev/docker-compose-integration.yml kill
102107 docker compose -f dev/docker-compose-integration.yml rm -f
103108 docker compose -f dev/docker-compose-integration.yml up -d --wait
104- $( POETRY ) run python dev/provision.py
109+ uv run python dev/provision.py
105110
106111test-integration-exec : # # Run integration tests (excluding provision)
107112 $(TEST_RUNNER ) pytest tests/ -m integration $(PYTEST_ARGS )
@@ -133,25 +138,25 @@ test-coverage: COVERAGE=1
133138test-coverage : test test-integration test-s3 test-adls test-gcs coverage-report # # Run all tests with coverage and report
134139
135140coverage-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
141+ uv run coverage combine
142+ uv run coverage report -m --fail-under=$(COVERAGE_FAIL_UNDER )
143+ uv run coverage html
144+ uv run coverage xml
140145
141146# ================
142147# Documentation
143148# ================
144149
145150# #@ Documentation
146151
147- docs-install : # # Install docs dependencies
148- ${POETRY} install --with docs
152+ docs-install : # # Install docs dependencies (included in default groups)
153+ uv sync --group docs
149154
150155docs-serve : # # Serve local docs preview (hot reload)
151- ${POETRY} run mkdocs serve -f mkdocs/mkdocs.yml
156+ uv run mkdocs serve -f mkdocs/mkdocs.yml
152157
153158docs-build : # # Build the static documentation site
154- ${POETRY} run mkdocs build -f mkdocs/mkdocs.yml --strict
159+ uv run mkdocs build -f mkdocs/mkdocs.yml --strict
155160
156161# ===================
157162# Project Maintenance
@@ -161,7 +166,7 @@ docs-build: ## Build the static documentation site
161166
162167clean : # # Remove build artifacts and caches
163168 @echo " Cleaning up Cython and Python cached files..."
164- @rm -rf build dist * .egg-info
169+ @rm -rf build dist * .egg-info .venv
165170 @find . -name " *.so" -exec echo Deleting {} \; -delete
166171 @find . -name " *.pyc" -exec echo Deleting {} \; -delete
167172 @find . -name " __pycache__" -exec echo Deleting {} \; -exec rm -rf {} +
0 commit comments