Skip to content

Commit 0d8b9c6

Browse files
committed
WIP on cohre/uv-impl
1 parent 8201d0b commit 0d8b9c6

16 files changed

Lines changed: 5424 additions & 418 deletions

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626

2727
jobs:
2828
set-version:
29-
if: github.repository == 'apache/iceberg-python' # Only run for apache repo
29+
# if: github.repository == 'apache/iceberg-python' # Only run for apache repo
3030
runs-on: ubuntu-latest
3131
outputs:
3232
VERSION: ${{ steps.set-version.outputs.VERSION }}
@@ -39,13 +39,14 @@ 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+
uv tool install 'pyproject-parser[cli]'
49+
CURRENT_VERSION=$(pyproject-info project.version)
4950
TIMESTAMP=$(date +%Y%m%d%H%M%S)
5051
echo "VERSION=${CURRENT_VERSION}.dev${TIMESTAMP}" >> "$GITHUB_OUTPUT"
5152

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,20 @@ 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: |
57+
# Update version in pyproject.toml
58+
sed -i 's/version = ".*"/version = "'$VERSION'"/' pyproject.toml
5759
5860
# Publish the source distribution with the version that's in
5961
# the repository, otherwise the tests will fail
6062
- name: Compile source distribution
61-
run: python3 -m poetry build --format=sdist
63+
run: uv build --sdist
6264
if: startsWith(matrix.os, 'ubuntu')
6365

6466
- name: Build wheels
@@ -70,6 +72,7 @@ jobs:
7072
# Ignore 32 bit architectures
7173
CIBW_ARCHS: "auto64"
7274
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.9,<3.13"
75+
CIBW_BUILD_FRONTEND: "build[uv]"
7376
CIBW_TEST_REQUIRES: "pytest==7.4.2 moto==5.0.1"
7477
CIBW_TEST_COMMAND: "pytest {project}/tests/avro/test_decoder.py"
7578
# Ignore tests for pypy since not all dependencies are compiled for it

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636

3737
steps:
3838
- uses: actions/checkout@v4
39-
- name: Install poetry
40-
run: make install-poetry
39+
- name: Install uv
40+
run: make install-uv
4141
- uses: actions/setup-python@v5
4242
with:
4343
python-version: 3.12

.github/workflows/python-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ jobs:
5151

5252
steps:
5353
- uses: actions/checkout@v4
54-
- name: Install poetry
55-
run: make install-poetry
54+
- name: Install uv
55+
run: make install-uv
5656
- uses: actions/setup-python@v5
5757
with:
5858
python-version: ${{ matrix.python }}
59-
cache: poetry
60-
cache-dependency-path: ./poetry.lock
59+
cache: pip
60+
cache-dependency-path: ./uv.lock
6161
- name: Install system dependencies
6262
run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos
6363
- name: Install

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ jobs:
3131

3232
steps:
3333
- uses: actions/checkout@v4
34-
- name: Install poetry
35-
run: make install-poetry
34+
- name: Install uv
35+
run: make install-uv
3636
- uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python }}

.github/workflows/python-release.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,20 +97,23 @@ 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
102+
103+
- name: Install pyproject-parser
104+
run: uv tool install 'pyproject-parser[cli]'
102105

103106
- name: Validate current pyiceberg version
104107
env:
105108
VERSION: ${{ needs.validate-inputs.outputs.VERSION }}
106109
run: |
107-
# Extract the current version from Poetry
108-
current_pyiceberg_version=$(poetry version --short)
109-
echo "Detected Poetry version: $current_pyiceberg_version"
110+
# Extract the current version from pyproject.toml
111+
current_pyiceberg_version=$(pyproject-info project.version)
112+
echo "Detected project version: $current_pyiceberg_version"
110113
111-
# Compare the input version with the Poetry version
114+
# Compare the input version with the project version
112115
if [[ "$VERSION" != "$current_pyiceberg_version" ]]; then
113-
echo "Error: Input version ($VERSION) does not match the Poetry version ($current_pyiceberg_version)"
116+
echo "Error: Input version ($VERSION) does not match the project version ($current_pyiceberg_version)"
114117
exit 1
115118
fi
116119

.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
5757
if: startsWith(matrix.os, 'ubuntu')
5858

5959
- name: Build wheels

LICENSE

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
Apache License
32
Version 2.0, January 2004
43
http://www.apache.org/licenses/

Makefile

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,38 @@
1919
help: ## Display this help
2020
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-20s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
2121

22-
POETRY_VERSION = 2.1.1
23-
install-poetry: ## Ensure Poetry is installed and the correct version is being used.
24-
@if ! command -v poetry &> /dev/null; then \
25-
echo "Poetry could not be found. Installing..."; \
26-
pip install --user poetry==$(POETRY_VERSION); \
22+
UV_VERSION = 0.6.16
23+
install-uv: ## Ensure uv is installed and the correct version is being used.
24+
@if ! command -v uv &> /dev/null; then \
25+
echo "uv could not be found. Installing..."; \
26+
pip install --user uv==$(UV_VERSION); \
2727
else \
28-
INSTALLED_VERSION=$$(pip show poetry | grep Version | awk '{print $$2}'); \
29-
if [ "$$INSTALLED_VERSION" != "$(POETRY_VERSION)" ]; then \
30-
echo "Poetry version $$INSTALLED_VERSION does not match required version $(POETRY_VERSION). Updating..."; \
31-
pip install --user --upgrade poetry==$(POETRY_VERSION); \
28+
INSTALLED_VERSION=$$(uv --version | awk '{print $$2}'); \
29+
if [ "$$INSTALLED_VERSION" != "$(UV_VERSION)" ]; then \
30+
echo "uv version $$INSTALLED_VERSION does not match required version $(UV_VERSION). Updating..."; \
31+
pip install --user --upgrade uv==$(UV_VERSION); \
3232
else \
33-
echo "Poetry version $$INSTALLED_VERSION is already installed."; \
33+
echo "uv version $$INSTALLED_VERSION is already installed."; \
3434
fi \
3535
fi
3636

3737
install-dependencies: ## Install dependencies including dev, docs, and all extras
38-
poetry install --all-extras
38+
uv sync --all-extras --dev
3939

40-
install: | install-poetry install-dependencies
40+
install: | install-uv install-dependencies
4141

4242
check-license: ## Check license headers
4343
./dev/check-license
4444

4545
lint: ## lint
46-
poetry run pre-commit run --all-files
46+
uv run pre-commit run --all-files
4747

4848
test: ## Run all unit tests, can add arguments with PYTEST_ARGS="-vv"
49-
poetry run pytest tests/ -m "(unmarked or parametrize) and not integration" ${PYTEST_ARGS}
49+
uv run pytest tests/ -m "(unmarked or parametrize) and not integration" ${PYTEST_ARGS}
5050

5151
test-s3: # Run tests marked with s3, can add arguments with PYTEST_ARGS="-vv"
5252
sh ./dev/run-minio.sh
53-
poetry run pytest tests/ -m s3 ${PYTEST_ARGS}
53+
uv run pytest tests/ -m s3 ${PYTEST_ARGS}
5454

5555
test-integration: | test-integration-setup test-integration-exec ## Run all integration tests, can add arguments with PYTEST_ARGS="-vv"
5656

@@ -63,7 +63,7 @@ test-integration-setup: # Prepare the environment for integration
6363
docker compose -f dev/docker-compose-integration.yml exec -T spark-iceberg ipython ./provision.py
6464

6565
test-integration-exec: # Execute integration tests, can add arguments with PYTEST_ARGS="-vv"
66-
poetry run pytest tests/ -v -m integration ${PYTEST_ARGS}
66+
uv run pytest tests/ -v -m integration ${PYTEST_ARGS}
6767

6868
test-integration-rebuild:
6969
docker compose -f dev/docker-compose-integration.yml kill
@@ -72,14 +72,14 @@ test-integration-rebuild:
7272

7373
test-adls: ## Run tests marked with adls, can add arguments with PYTEST_ARGS="-vv"
7474
sh ./dev/run-azurite.sh
75-
poetry run pytest tests/ -m adls ${PYTEST_ARGS}
75+
uv run pytest tests/ -m adls ${PYTEST_ARGS}
7676

7777
test-gcs: ## Run tests marked with gcs, can add arguments with PYTEST_ARGS="-vv"
7878
sh ./dev/run-gcs-server.sh
79-
poetry run pytest tests/ -m gcs ${PYTEST_ARGS}
79+
uv run pytest tests/ -m gcs ${PYTEST_ARGS}
8080

8181
test-coverage-unit: # Run test with coverage for unit tests, can add arguments with PYTEST_ARGS="-vv"
82-
poetry run coverage run --source=pyiceberg/ --data-file=.coverage.unit -m pytest tests/ -v -m "(unmarked or parametrize) and not integration" ${PYTEST_ARGS}
82+
uv run coverage run --source=pyiceberg/ --data-file=.coverage.unit -m pytest tests/ -v -m "(unmarked or parametrize) and not integration" ${PYTEST_ARGS}
8383

8484
test-coverage-integration: # Run test with coverage for integration tests, can add arguments with PYTEST_ARGS="-vv"
8585
docker compose -f dev/docker-compose-integration.yml kill
@@ -90,13 +90,13 @@ test-coverage-integration: # Run test with coverage for integration tests, can a
9090
sleep 10
9191
docker compose -f dev/docker-compose-integration.yml cp ./dev/provision.py spark-iceberg:/opt/spark/provision.py
9292
docker compose -f dev/docker-compose-integration.yml exec -T spark-iceberg ipython ./provision.py
93-
poetry run coverage run --source=pyiceberg/ --data-file=.coverage.integration -m pytest tests/ -v -m integration ${PYTEST_ARGS}
93+
uv run coverage run --source=pyiceberg/ --data-file=.coverage.integration -m pytest tests/ -v -m integration ${PYTEST_ARGS}
9494

9595
test-coverage: | test-coverage-unit test-coverage-integration ## Run all tests with coverage including unit and integration tests
96-
poetry run coverage combine .coverage.unit .coverage.integration
97-
poetry run coverage report -m --fail-under=90
98-
poetry run coverage html
99-
poetry run coverage xml
96+
uv run coverage combine .coverage.unit .coverage.integration
97+
uv run coverage report -m --fail-under=90
98+
uv run coverage html
99+
uv run coverage xml
100100

101101

102102
clean: ## Clean up the project Python working environment
@@ -110,10 +110,10 @@ clean: ## Clean up the project Python working environment
110110
@echo "Cleanup complete"
111111

112112
docs-install:
113-
poetry install --with docs
113+
uv sync --group docs
114114

115115
docs-serve:
116-
poetry run mkdocs serve -f mkdocs/mkdocs.yml
116+
uv run mkdocs serve -f mkdocs/mkdocs.yml
117117

118118
docs-build:
119-
poetry run mkdocs build -f mkdocs/mkdocs.yml --strict
119+
uv run mkdocs build -f mkdocs/mkdocs.yml --strict

dev/.rat-excludes

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

0 commit comments

Comments
 (0)