From b0d33477b09a016458df82c8566eab3184846e9d Mon Sep 17 00:00:00 2001 From: Konstantinos Stefanidis Vozikis Date: Thu, 13 Aug 2026 14:21:40 +0200 Subject: [PATCH] ci: test supported Iceberg dependency bounds --- .github/workflows/test-python.yml | 63 +++++++++++++++++++++++++++++++ pyproject.toml | 9 ++++- uv.lock | 6 +-- 3 files changed, 73 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test-python.yml b/.github/workflows/test-python.yml index f917c397..e319f23f 100644 --- a/.github/workflows/test-python.yml +++ b/.github/workflows/test-python.yml @@ -43,3 +43,66 @@ jobs: - name: Run tests run: uv run pytest tests + + iceberg-compatibility: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - bounds: minimum + pyarrow: "pyarrow==23.0.1" + pyiceberg: "pyiceberg[sql-sqlite]==0.11.1" + - bounds: latest + pyarrow: "pyarrow>=23.0.1,<26" + pyiceberg: "pyiceberg[sql-sqlite]>=0.11.1,<0.12" + + steps: + - uses: actions/checkout@v6 + + - name: Install the latest version of uv + uses: astral-sh/setup-uv@v6 + + - name: "Set up Python" + uses: actions/setup-python@v6 + with: + python-version-file: ".python-version" + + - name: Install the project + run: uv sync --locked --all-extras --dev + + - name: Resolve ${{ matrix.bounds }} supported Iceberg dependencies + run: >- + uv pip install + --python .venv/bin/python + --strict + --resolution highest + --upgrade-package pyarrow + --upgrade-package pyiceberg + '${{ matrix.pyarrow }}' + '${{ matrix.pyiceberg }}' + + - name: Assert resolved dependency versions + env: + BOUNDS: ${{ matrix.bounds }} + run: | + uv run --no-sync python - <<'PY' + import os + from importlib.metadata import version + + from packaging.version import Version + + pyarrow = Version(version("pyarrow")) + pyiceberg = Version(version("pyiceberg")) + + print(f"PyArrow {pyarrow}; PyIceberg {pyiceberg}") + assert Version("23.0.1") <= pyarrow < Version("26") + assert Version("0.11.1") <= pyiceberg < Version("0.12") + + if os.environ["BOUNDS"] == "minimum": + assert pyarrow == Version("23.0.1") + assert pyiceberg == Version("0.11.1") + PY + + - name: Run Iceberg compatibility tests + run: uv run --no-sync pytest tests/tower/test_tables.py tests/tower/test_storage.py diff --git a/pyproject.toml b/pyproject.toml index 8d84c009..d9c892d4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,12 @@ tower = "tower.cli:main" [project.optional-dependencies] ai = ["huggingface-hub>=0.34.3", "ollama>=0.5.3"] -iceberg = ["polars>=1.39.3", "pyarrow>=23.0.1", "pyiceberg>=0.11.1", "boto3>=1.35.0"] +iceberg = [ + "polars>=1.39.3", + "pyarrow>=23.0.1,<26", + "pyiceberg>=0.11.1,<0.12", + "boto3>=1.35.0", +] dbt = ["dbt-core>=1.9,<1.10"] # Can not use dbt 1.10+ due to dependency conflicts all = ["tower[ai,iceberg,dbt]"] @@ -102,5 +107,5 @@ dev = [ "mypy==1.13.0", "openapi-python-client==0.28.1", "pre-commit==4.0.1", - "pyiceberg[sql-sqlite]>=0.11.1", + "pyiceberg[sql-sqlite]>=0.11.1,<0.12", ] diff --git a/uv.lock b/uv.lock index 1403d801..fc112330 100644 --- a/uv.lock +++ b/uv.lock @@ -2334,10 +2334,10 @@ requires-dist = [ { name = "huggingface-hub", marker = "extra == 'ai'", specifier = ">=0.34.3" }, { name = "ollama", marker = "extra == 'ai'", specifier = ">=0.5.3" }, { name = "polars", marker = "extra == 'iceberg'", specifier = ">=1.39.3" }, - { name = "pyarrow", marker = "extra == 'iceberg'", specifier = ">=23.0.1" }, + { name = "pyarrow", marker = "extra == 'iceberg'", specifier = ">=23.0.1,<26" }, { name = "pydantic", specifier = ">=2.12.0,<3.0.0" }, { name = "pydantic-core", specifier = ">=2.27.0,<3.0.0" }, - { name = "pyiceberg", marker = "extra == 'iceberg'", specifier = ">=0.11.1" }, + { name = "pyiceberg", marker = "extra == 'iceberg'", specifier = ">=0.11.1,<0.12" }, { name = "python-dateutil", specifier = "==2.9.0.post0" }, { name = "tower", extras = ["ai", "iceberg", "dbt"], marker = "extra == 'all'", editable = "." }, ] @@ -2353,7 +2353,7 @@ dev = [ { name = "mypy", specifier = "==1.13.0" }, { name = "openapi-python-client", specifier = "==0.28.1" }, { name = "pre-commit", specifier = "==4.0.1" }, - { name = "pyiceberg", extras = ["sql-sqlite"], specifier = ">=0.11.1" }, + { name = "pyiceberg", extras = ["sql-sqlite"], specifier = ">=0.11.1,<0.12" }, { name = "pytest", specifier = "==8.3.5" }, { name = "pytest-env", specifier = ">=1.1.3" }, { name = "pytest-httpx", specifier = "==0.35.0" },