Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

version: 2
updates:
- package-ecosystem: "pip"
- package-ecosystem: "uv"
directory: "/"
schedule:
interval: "weekly"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/nightly-pypi-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ jobs:
with:
python-version: 3.12

- name: Install Poetry
run: make install-poetry
- name: Install UV
uses: astral-sh/setup-uv@v6

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

Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/pypi-build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ jobs:
3.11
3.12

- name: Install poetry
run: make install-poetry
- name: Install UV
uses: astral-sh/setup-uv@v6

- name: Set version with RC
env:
VERSION: ${{ inputs.VERSION }}
run: python -m poetry version "${{ env.VERSION }}"
run: uv version "${{ env.VERSION }}"

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

- name: Build wheels
Expand All @@ -70,13 +70,15 @@ jobs:
CIBW_ARCHS: "auto64"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.10"
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
CIBW_TEST_COMMAND: "PYTHON_GIL=1 pytest {project}/tests/avro/test_decoder.py"
CIBW_BUILD_VERBOSITY: 1
# Ignore tests for pypy since not all dependencies are compiled for it
# and would require a local rust build chain
CIBW_TEST_SKIP: "pp*"
# Skip free-threaded (PEP 703) builds until we evaluate decoder_fast support
CIBW_SKIP: "cp3*t-*"


- name: Add source distribution
if: startsWith(matrix.os, 'ubuntu')
run: ls -lah dist/* && cp dist/* wheelhouse/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: 3.12
- name: Install poetry
run: make install-poetry
- name: Install UV
uses: astral-sh/setup-uv@v6
- name: Install
run: make docs-install
- name: Build docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Install poetry
run: make install-poetry
- name: Install UV
uses: astral-sh/setup-uv@v6
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos
- name: Install
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/python-release-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
- uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python }}
- name: Install poetry
run: make install-poetry
- name: Install UV
uses: astral-sh/setup-uv@v6
- name: Install docs
run: make docs-install
- name: Build docs
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/python-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,20 +97,20 @@ jobs:
with:
python-version: 3.12

- name: Install Poetry
run: make install-poetry
- name: Install UV
uses: astral-sh/setup-uv@v6

- name: Validate current pyiceberg version
env:
VERSION: ${{ needs.validate-inputs.outputs.VERSION }}
run: |
# Extract the current version from Poetry
current_pyiceberg_version=$(poetry version --short)
echo "Detected Poetry version: $current_pyiceberg_version"
# Extract the current version from UV
current_pyiceberg_version=$(uv version --short)
echo "Detected UV version: $current_pyiceberg_version"

# Compare the input version with the Poetry version
# Compare the input version with the UV version
if [[ "$VERSION" != "$current_pyiceberg_version" ]]; then
echo "Error: Input version ($VERSION) does not match the Poetry version ($current_pyiceberg_version)"
echo "Error: Input version ($VERSION) does not match the UV version ($current_pyiceberg_version)"
exit 1
fi

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/svn-build-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ jobs:
3.11
3.12

- name: Install poetry
run: make install-poetry
- name: Install UV
uses: astral-sh/setup-uv@v6

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

- name: Build wheels
Expand Down
35 changes: 34 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,37 @@
# specific language governing permissions and limitations
# under the License.

graft src
# Include important project files
include README.md
include LICENSE
include NOTICE
include Makefile
include pyproject.toml
include setup.py
include uv.lock

# Cython source files
recursive-include pyiceberg *.pyx *.pyi

# vendor packages
recursive-include vendor *

# type stubs
include pyiceberg/py.typed

# Include test files in sdist
recursive-include tests *.py

# Include dev tools in sdist
recursive-include dev *

# Exclude build artifacts
global-exclude *.pyc
global-exclude *.pyo
global-exclude *.so
global-exclude *.pyd
global-exclude __pycache__
prune .venv
prune build
prune dist
prune *.egg-info
67 changes: 36 additions & 31 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,23 @@
# Configuration Variables
# ========================

PYTHON ?= # Override with e.g. PYTHON=3.11 to use specific Python version
PYTEST_ARGS ?= -v -x # Override with e.g. PYTEST_ARGS="-vv --tb=short"
COVERAGE ?= 0 # Set COVERAGE=1 to enable coverage: make test COVERAGE=1
COVERAGE_FAIL_UNDER ?= 85 # Minimum coverage % to pass: make coverage-report COVERAGE_FAIL_UNDER=70
KEEP_COMPOSE ?= 0 # Set KEEP_COMPOSE=1 to keep containers after integration tests

PIP = python -m pip

POETRY_VERSION = 2.2.1
POETRY = python -m poetry
# Set Python argument for uv commands if PYTHON is specified
ifneq ($(PYTHON),)
PYTHON_ARG = --python $(PYTHON)
else
PYTHON_ARG =
endif

ifeq ($(COVERAGE),1)
TEST_RUNNER = $(POETRY) run coverage run --parallel-mode --source=pyiceberg -m
TEST_RUNNER = uv run coverage run --parallel-mode --source=pyiceberg -m
else
TEST_RUNNER = $(POETRY) run
TEST_RUNNER = uv run
endif

ifeq ($(KEEP_COMPOSE),1)
Expand All @@ -55,24 +58,26 @@ help: ## Display this help message

##@ Setup

install-poetry: ## Ensure Poetry is installed at the specified version
@if ! command -v ${POETRY} &> /dev/null; then \
echo "Poetry not found. Installing..."; \
${PIP} install poetry==$(POETRY_VERSION); \
install-uv: ## Ensure uv is installed
@if ! command -v uv &> /dev/null; then \
echo "uv not found. Installing..."; \
curl -LsSf https://astral.sh/uv/install.sh | sh; \
else \
echo "uv is already installed."; \
fi

setup-venv: ## Create virtual environment
@if [ ! -d .venv ]; then \
echo "Creating virtual environment."; \
uv venv $(PYTHON_ARG); \
else \
INSTALLED_VERSION=$$(${PIP} show poetry | grep Version | awk '{print $$2}'); \
if [ "$$INSTALLED_VERSION" != "$(POETRY_VERSION)" ]; then \
echo "Updating Poetry to version $(POETRY_VERSION)..."; \
${PIP} install --upgrade poetry==$(POETRY_VERSION); \
else \
echo "Poetry version $(POETRY_VERSION) already installed."; \
fi; \
echo "Virtual environment already exists."; \
fi

install-dependencies: ## Install all dependencies including extras
$(POETRY) install --all-extras
install-dependencies: setup-venv ## Install all dependencies including extras
uv sync --all-extras

install: install-poetry install-dependencies ## Install Poetry and dependencies
install: install-uv install-dependencies ## Install uv and dependencies

# ===============
# Code Validation
Expand All @@ -84,7 +89,7 @@ check-license: ## Check license headers
./dev/check-license

lint: ## Run code linters via prek (pre-commit hooks)
$(POETRY) run prek run -a
uv run prek run -a

# ===============
# Testing Section
Expand All @@ -101,7 +106,7 @@ test-integration-setup: ## Start Docker services for integration tests
docker compose -f dev/docker-compose-integration.yml kill
docker compose -f dev/docker-compose-integration.yml rm -f
docker compose -f dev/docker-compose-integration.yml up -d --wait
$(POETRY) run python dev/provision.py
uv run python dev/provision.py

test-integration-exec: ## Run integration tests (excluding provision)
$(TEST_RUNNER) pytest tests/ -m integration $(PYTEST_ARGS)
Expand Down Expand Up @@ -133,25 +138,25 @@ test-coverage: COVERAGE=1
test-coverage: test test-integration test-s3 test-adls test-gcs coverage-report ## Run all tests with coverage and report

coverage-report: ## Combine and report coverage
${POETRY} run coverage combine
${POETRY} run coverage report -m --fail-under=$(COVERAGE_FAIL_UNDER)
${POETRY} run coverage html
${POETRY} run coverage xml
uv run coverage combine
uv run coverage report -m --fail-under=$(COVERAGE_FAIL_UNDER)
uv run coverage html
uv run coverage xml

# ================
# Documentation
# ================

##@ Documentation

docs-install: ## Install docs dependencies
${POETRY} install --with docs
docs-install: ## Install docs dependencies (included in default groups)
uv sync --group docs

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

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

# ===================
# Project Maintenance
Expand All @@ -161,7 +166,7 @@ docs-build: ## Build the static documentation site

clean: ## Remove build artifacts and caches
@echo "Cleaning up Cython and Python cached files..."
@rm -rf build dist *.egg-info
@rm -rf build dist *.egg-info .venv
@find . -name "*.so" -exec echo Deleting {} \; -delete
@find . -name "*.pyc" -exec echo Deleting {} \; -delete
@find . -name "__pycache__" -exec echo Deleting {} \; -exec rm -rf {} +
Expand Down
71 changes: 0 additions & 71 deletions build-module.py

This file was deleted.

2 changes: 1 addition & 1 deletion dev/.rat-excludes
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
build
.git
.gitignore
poetry.lock
uv.lock
mkdocs/*
Loading
Loading