From d89edd01de0b0385623198e21a06a393623d8749 Mon Sep 17 00:00:00 2001 From: Orest Tokovenko Date: Wed, 25 Nov 2026 14:29:00 -0800 Subject: [PATCH 1/2] Build: Move type checking and test suites to tox --- .github/workflows/python-ci.yml | 69 ++++++--- .github/workflows/python-integration.yml | 31 ++-- .pre-commit-config.yaml | 11 -- AGENTS.md | 15 +- MANIFEST.in | 1 + Makefile | 87 +---------- dev/.rat-excludes | 1 + dev/release/verify_rc.sh | 4 +- mkdocs/docs/contributing.md | 47 +++--- mkdocs/docs/verify-release.md | 6 +- pyproject.toml | 22 ++- tox.toml | 163 ++++++++++++++++++++ uv.lock | 188 ++++++++++++++++++++++- 13 files changed, 474 insertions(+), 171 deletions(-) create mode 100644 tox.toml diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 1abd4c8600..b22552adc4 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -31,7 +31,43 @@ concurrency: cancel-in-progress: true jobs: - lint-and-unit-test: + lint: + runs-on: ubuntu-24.04 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.12' + - name: Install UV + uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 + with: + enable-cache: true + - name: Check uv.lock is up to date + run: uv lock --check + - name: Run linters + run: uv run --locked --only-group lint prek run -a + + typecheck: + runs-on: ubuntu-slim + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 + with: + python-version: '3.12' + - name: Install UV + uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 + with: + enable-cache: true + - name: Run mypy type checking + run: uv run --locked --only-group tox tox run -e typecheck + + unit-test: runs-on: ubuntu-24.04 timeout-minutes: 10 strategy: @@ -53,42 +89,29 @@ jobs: enable-cache: true - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos - - name: Check uv.lock is up to date - if: matrix.python == '3.11' - run: uv lock --check - - name: Install - run: make install - - name: Run linters - if: matrix.python == '3.11' - run: make lint - - name: Run unit tests with coverage - run: COVERAGE=1 make test - - name: Generate coverage report (85%) # Coverage threshold should only increase over time — never decrease it! - run: COVERAGE_FAIL_UNDER=85 make coverage-report + - name: Run unit tests with coverage (85%) # Coverage threshold should only increase over time — never decrease it! + env: + TOX_ENV: test-${{ matrix.python }} + COVERAGE: "1" + COVERAGE_FAIL_UNDER: "85" + run: uv run --locked --only-group tox tox run -e "$TOX_ENV,coverage" --skip-missing-interpreters=false windows-unit-test: runs-on: windows-latest timeout-minutes: 15 - strategy: - fail-fast: true - matrix: - python: ['3.12'] - steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: persist-credentials: false - uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 with: - python-version: ${{ matrix.python }} + python-version: '3.12' - name: Install UV uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 with: enable-cache: true - - name: Install - run: uv sync --all-extras --no-extra hive-kerberos - name: Run unit tests - run: uv run python -m pytest tests/ -m unit --ignore=tests/integration -v -x + run: uv run --locked --only-group tox tox run -e test-3.12 --skip-missing-interpreters=false cibw-dev-env-smoke-test: runs-on: ubuntu-slim @@ -117,7 +140,7 @@ jobs: python-ci-required: if: ${{ always() }} - needs: [lint-and-unit-test, windows-unit-test, cibw-dev-env-smoke-test] + needs: [lint, typecheck, unit-test, windows-unit-test, cibw-dev-env-smoke-test] runs-on: ubuntu-slim steps: - name: Verify Python CI jobs succeeded diff --git a/.github/workflows/python-integration.yml b/.github/workflows/python-integration.yml index 54ea5bdc59..74302cdbc7 100644 --- a/.github/workflows/python-integration.yml +++ b/.github/workflows/python-integration.yml @@ -47,10 +47,11 @@ jobs: enable-cache: true - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos - - name: Install - run: make install - name: Run integration tests with coverage - run: COVERAGE=1 make test-integration + env: + COVERAGE: "1" + KEEP_COMPOSE: "1" + run: uv run --locked --only-group tox tox run -e integration - name: Show debug logs if: ${{ failure() }} run: docker compose -f dev/docker-compose-integration.yml logs @@ -77,10 +78,10 @@ jobs: enable-cache: true - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos - - name: Install - run: make install - name: Run s3 integration tests with coverage - run: COVERAGE=1 make test-s3 + env: + COVERAGE: "1" + run: uv run --locked --only-group tox tox run -e s3 - name: Show debug logs if: ${{ failure() }} run: docker compose -f dev/docker-compose.yml logs @@ -107,10 +108,10 @@ jobs: enable-cache: true - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos - - name: Install - run: make install - name: Run adls integration tests with coverage - run: COVERAGE=1 make test-adls + env: + COVERAGE: "1" + run: uv run --locked --only-group tox tox run -e adls - name: Show debug logs if: ${{ failure() }} run: docker compose -f dev/docker-compose-azurite.yml logs @@ -137,10 +138,10 @@ jobs: enable-cache: true - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos - - name: Install - run: make install - name: Run gcs integration tests with coverage - run: COVERAGE=1 make test-gcs + env: + COVERAGE: "1" + run: uv run --locked --only-group tox tox run -e gcs - name: Show debug logs if: ${{ failure() }} run: docker compose -f dev/docker-compose-gcs-server.yml logs @@ -165,15 +166,15 @@ jobs: uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0 with: enable-cache: true - - name: Install dependencies - run: uv sync --group dev - name: Download all coverage artifacts uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: pattern: coverage-* merge-multiple: true - name: Generate coverage report (75%) # Coverage threshold should only increase over time — never decrease it! - run: COVERAGE_FAIL_UNDER=75 make coverage-report + env: + COVERAGE_FAIL_UNDER: "75" + run: uv run --locked --only-group tox tox run -e coverage python-integration-required: if: ${{ always() }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f0dedd0804..bfb0c4d85a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,17 +36,6 @@ repos: hooks: - id: nbqa-ruff args: [ --fix, --exit-non-zero-on-fix ] - - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.18.2 - hooks: - - id: mypy - args: - [--config=pyproject.toml] - additional_dependencies: - - types-cachetools - - types-pytest-lazy-fixture - - types-pytz - - types-requests - repo: https://github.com/igorshubovych/markdownlint-cli rev: v0.45.0 hooks: diff --git a/AGENTS.md b/AGENTS.md index 7493fdc6f2..9739c8468e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -83,14 +83,17 @@ lives under `pyiceberg/`, organized by concern rather than by engine: ## Commands - **Install / set up dev env:** `make install` (installs `uv`, syncs all extras, builds Cython, installs pre-commit hooks) -- **Run unit tests:** `make test` -- **Run a subset:** `make test PYTEST_ARGS="-v -k "` -- **Integration tests (Spark/Docker):** `make test-integration` (rebuild with `make test-integration-rebuild`) -- **Cloud storage suites:** `make test-s3` / `make test-adls` / `make test-gcs` +- **Run typecheck + unit tests across installed Pythons:** `uv run tox -p` +- **Run unit tests (current or specific Python):** `uv run tox -e unit` / `uv run tox -e test-3.12` +- **Run a subset:** `uv run tox -e unit -- -v -k ` +- **Typecheck (mypy):** `uv run tox -e typecheck` +- **Integration tests (Spark/Docker):** `uv run tox -e integration` (`KEEP_COMPOSE=1` to keep containers running) +- **Cloud storage & notebook suites:** `uv run tox -e s3` / `adls` / `gcs` / `notebook` +- **Coverage report:** `COVERAGE=1 uv run tox -e unit,coverage` - **Lint & format:** `make lint` - **Docs preview / build:** `make docs-serve` / `make docs-build` - **Clean build artifacts:** `make clean` -- **Use a specific Python:** prefix with `PYTHON=3.12`, e.g. `PYTHON=3.12 make install` +- **Use a specific Python with Make:** prefix with `PYTHON=3.12`, e.g. `PYTHON=3.12 make install` ## PR & Commit Conventions @@ -99,7 +102,7 @@ lives under `pyiceberg/`, organized by concern rather than by engine: - Keep the first version of a PR minimal; defer optimizations and edge cases to follow-ups. - Commit messages explain the *what* and *why*, not line-by-line implementation. Be as succinct as possible. - The Apache License header is required on every new source file (enforced by `./dev/check-license`). -- Run `make lint` and `make test` before pushing; CI runs both plus the lockfile check. +- Run `make lint` and `uv run tox -p` before pushing; CI runs both plus the lockfile check. ## GitHub Write Approval diff --git a/MANIFEST.in b/MANIFEST.in index 7215e0d6e3..e58eea84e4 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -26,6 +26,7 @@ recursive-include tests * # Include development files include Makefile +include tox.toml include uv.lock recursive-include dev * diff --git a/Makefile b/Makefile index 9f0282c65b..e2a6f6397a 100644 --- a/Makefile +++ b/Makefile @@ -15,8 +15,6 @@ # specific language governing permissions and limitations # under the License. .PHONY: help install install-uv check-license lint \ - test test-integration test-integration-setup test-integration-exec test-integration-cleanup test-integration-rebuild \ - test-s3 test-adls test-gcs test-coverage coverage-report test test-notebook\ docs-serve docs-build notebook notebook-infra \ clean @@ -26,10 +24,6 @@ # ======================== 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 # Set Python argument for uv commands if PYTHON is specified ifneq ($(PYTHON),) @@ -38,18 +32,6 @@ else PYTHON_ARG = endif -ifeq ($(COVERAGE),1) - TEST_RUNNER = uv run $(PYTHON_ARG) python -m coverage run --parallel-mode --source=pyiceberg -m -else - TEST_RUNNER = uv run $(PYTHON_ARG) python -m -endif - -ifeq ($(KEEP_COMPOSE),1) - CLEANUP_COMMAND = echo "Keeping containers running for debugging (KEEP_COMPOSE=1)" -else - CLEANUP_COMMAND = docker compose -f dev/docker-compose-integration.yml down -v --remove-orphans --timeout 0 2>/dev/null || true -endif - # ============ # Help Section # ============ @@ -97,67 +79,6 @@ check-license: ## Check license headers lint: ## Run code linters via prek (pre-commit hooks) uv run $(PYTHON_ARG) prek run -a -# =============== -# Testing Section -# =============== - -##@ Testing - -test: ## Run all unit tests (excluding integration) - $(TEST_RUNNER) pytest tests/ -m unit --ignore=tests/integration $(PYTEST_ARGS) - -test-integration: test-integration-setup test-integration-exec test-integration-cleanup ## Run integration tests - -test-integration-setup: install ## 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 --build --wait - uv run $(PYTHON_ARG) python dev/provision.py - -test-integration-exec: ## Run integration tests (excluding provision) - $(TEST_RUNNER) pytest tests/ -m integration $(PYTEST_ARGS) - -test-integration-cleanup: ## Clean up integration test environment - @if [ "${KEEP_COMPOSE}" != "1" ]; then \ - echo "Cleaning up Docker containers..."; \ - fi - $(CLEANUP_COMMAND) - -test-integration-rebuild: ## Rebuild integration Docker services from scratch - 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 build --no-cache - -test-s3: ## Run tests marked with @pytest.mark.s3 - sh ./dev/run-s3.sh - $(TEST_RUNNER) pytest tests/ -m s3 $(PYTEST_ARGS) - -test-adls: ## Run tests marked with @pytest.mark.adls - sh ./dev/run-azurite.sh - $(TEST_RUNNER) pytest tests/ -m adls $(PYTEST_ARGS) - -test-gcs: ## Run tests marked with @pytest.mark.gcs - sh ./dev/run-gcs-server.sh - # gcsfs 2026.6.0 sends HNS/Zonal bucket detection to endpoint_url. - # fake-gcs-server does not support that API, so repeated detection retries - # make GCS sanity tests take close to an hour. Disable it here. - # Workaround documented by gcsfs: - # https://github.com/fsspec/gcsfs/blob/2026.6.0/docs/source/hns_buckets.rst#L99-L101 - GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT=false $(TEST_RUNNER) pytest tests/ -m gcs $(PYTEST_ARGS) - -test-coverage: ## Run all tests with coverage and report - $(MAKE) COVERAGE=1 test test-integration test-s3 test-adls test-gcs - $(MAKE) coverage-report - -coverage-report: ## Combine and report coverage - uv run $(PYTHON_ARG) coverage combine - uv run $(PYTHON_ARG) coverage report -m --fail-under=$(COVERAGE_FAIL_UNDER) - uv run $(PYTHON_ARG) coverage html - uv run $(PYTHON_ARG) coverage xml - -test-notebook: ## Run notebook tests (pyiceberg_example and spark_integration_example) via papermill - $(TEST_RUNNER) pytest tests/notebooks/test_pyiceberg_example.py tests/notebooks/test_spark_integration_example.py -m notebook $(PYTEST_ARGS) - # ================ # Documentation # ================ @@ -179,7 +100,11 @@ docs-build: ## Build the static documentation site notebook: ## Launch notebook for experimentation uv run $(PYTHON_ARG) --all-extras --group notebook jupyter lab --notebook-dir=notebooks -notebook-infra: test-integration-setup ## Launch notebook with integration test infra (Spark, Iceberg Rest Catalog, object storage, etc.) +notebook-infra: install ## Launch notebook with integration test infra (Spark, Iceberg Rest Catalog, object storage, etc.) + 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 --build --wait + uv run $(PYTHON_ARG) python dev/provision.py uv run $(PYTHON_ARG) --all-extras --group notebook jupyter lab --notebook-dir=notebooks # =================== @@ -190,7 +115,7 @@ notebook-infra: test-integration-setup ## Launch notebook with integration test clean: ## Remove build artifacts and caches @echo "Cleaning up Cython and Python cached files..." - @rm -rf build dist *.egg-info .venv + @rm -rf build dist *.egg-info .venv .tox @find . -name "*.so" -exec echo Deleting {} \; -delete @find . -name "*.pyc" -exec echo Deleting {} \; -delete @find . -name "__pycache__" -exec echo Deleting {} \; -exec rm -rf {} + diff --git a/dev/.rat-excludes b/dev/.rat-excludes index 485579eff4..c3a554fd8d 100644 --- a/dev/.rat-excludes +++ b/dev/.rat-excludes @@ -4,5 +4,6 @@ uv.lock .ruff_cache/** .pytest_cache/** .mypy_cache/** +.tox/** mkdocs/** notebooks/** diff --git a/dev/release/verify_rc.sh b/dev/release/verify_rc.sh index 744f9d5a19..b25a8f278d 100755 --- a/dev/release/verify_rc.sh +++ b/dev/release/verify_rc.sh @@ -82,8 +82,8 @@ verify_license_documentation() { test_source_distribution() { echo "--- Installing and running the tests, this spins up Docker containers" - make install - make test-coverage + make install-uv + COVERAGE=1 uv run --locked --only-group tox tox run -e unit,integration,s3,adls,gcs,coverage } echo "Verifying pyiceberg-${PYICEBERG_VERSION} in ${PYICEBERG_VERIFICATION_DIR}" diff --git a/mkdocs/docs/contributing.md b/mkdocs/docs/contributing.md index 2e9cf126d1..7c0afe8377 100644 --- a/mkdocs/docs/contributing.md +++ b/mkdocs/docs/contributing.md @@ -58,7 +58,7 @@ You can specify which Python version to use when creating your virtual environme ```bash PYTHON=3.12 make install # Create environment with Python 3.12 -make test # Run tests against Python 3.12 +uv run tox -e test-3.12 # Run tests against Python 3.12 ``` > **Tip:** `uv python list` shows available interpreters. `uv python install 3.12` can install one if needed. @@ -135,7 +135,15 @@ make lint In addition to manually running `make lint`, you can install the pre-commit hooks in your local repo with `prek install`. By doing this, linting is run automatically every time you make a commit. -You can bump the integrations to the latest version using `prek auto-update`. This will check if there is a newer version of `{ruff,mypy,...}` and update the yaml. +You can bump the integrations to the latest version using `prek auto-update`. This will check if there is a newer version of `{ruff,codespell,...}` and update the yaml. + +### Type Checking + +`mypy` runs in an isolated `tox` environment configured in `tox.toml`: + +```bash +uv run tox -e typecheck +``` ## Cleaning @@ -149,57 +157,52 @@ Helps prevent build failures and unexpected behavior by removing outdated files, ## Testing -For Python, `pytest` is used a testing framework in combination with `coverage` to enforce 90%+ code coverage. +For Python, `pytest` is used as the testing framework via `tox`, in combination with `coverage`. ```bash -make test +uv run tox -e unit # Unit tests on the current Python +uv run tox -p # Typecheck + unit tests across installed Pythons (3.11–3.14) ``` -By default, S3 and ADLS tests are ignored because that require RustFS and azurite to be running. -To run the S3 suite: +By default, S3, ADLS, and GCS tests are ignored because they require local emulator containers. +To run the cloud storage suites: ```bash -make test-s3 +uv run tox -e s3 +uv run tox -e adls +uv run tox -e gcs ``` -To run the ADLS suite: - -```bash -make test-adls -``` - -To pass additional arguments to pytest, you can use `PYTEST_ARGS`. +To pass additional arguments to pytest, append them after `--`. ### Run pytest in verbose mode ```sh -make test PYTEST_ARGS="-v" +uv run tox -e unit -- -v ``` ### Run pytest with pdb enabled ```sh -make test PYTEST_ARGS="--pdb" +uv run tox -e unit -- --pdb ``` -To see all available pytest arguments, run `make test PYTEST_ARGS="--help"`. +To see all available pytest arguments, run `uv run tox -e unit -- --help`. ### Integration tests PyIceberg has integration tests with Apache Spark. Spark will create a new database and provision some tables that PyIceberg can query against. ```sh -make test-integration +uv run tox -e integration ``` -This will restart the containers, to get to a clean state, and then run the PyTest suite. In case something changed in the Dockerfile or the provision script, you can run: +This will restart the containers to get to a clean state, run the pytest suite, and tear them down afterward (set `KEEP_COMPOSE=1` to keep containers running). To rebuild the containers from scratch, run: ```sh -make test-integration-rebuild +docker compose -f dev/docker-compose-integration.yml build --no-cache ``` -To rebuild the containers from scratch. - #### Running Integration Tests against REST Catalogs !!! warning "Do not run against production catalogs" diff --git a/mkdocs/docs/verify-release.md b/mkdocs/docs/verify-release.md index 3726b39570..2c71dc27e0 100644 --- a/mkdocs/docs/verify-release.md +++ b/mkdocs/docs/verify-release.md @@ -112,16 +112,16 @@ This section explains how to run the tests of the source distribution. -First step is to install the package: +First step is to ensure `uv` is installed: ```sh -make install +make install-uv ``` To run the full test coverage, with both unit tests and integration tests: ```sh -make test-coverage +COVERAGE=1 uv run --locked --only-group tox tox run -e unit,integration,s3,adls,gcs,coverage ``` This will spin up Docker containers to facilitate running test coverage. diff --git a/pyproject.toml b/pyproject.toml index da86f7b199..43c0436ad8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,14 +103,32 @@ geoarrow = ["geoarrow-types>=0.3.0"] encryption = ["cryptography>=42.0.0"] [dependency-groups] +lint = [ + "prek>=0.2.1", +] +tox = [ + "tox>=4.61", + "tox-uv-bare>=1.28", +] +types = [ + "mypy==1.18.2", + "types-cachetools==7.0.0.20260713", + "types-pytest-lazy-fixture==0.6.3.20260518", + "types-pytz==2026.5.0.20261006", + "types-requests==2.33.0.20261006", +] +coverage = [ + "coverage[toml]>=7.4.2", +] dev = [ + { include-group = "lint" }, + { include-group = "tox" }, + { include-group = "coverage" }, "pytest==9.1.1", "pytest-checkdocs==2.14.0", "setuptools>=83.0.0", - "prek>=0.2.1", "pytest-lazy-fixtures==1.4.1", "fastavro==1.13.1", - "coverage[toml]>=7.4.2", "requests-mock==1.12.1", "moto[server]>=5.0.2", "typing-extensions==4.16.0", diff --git a/tox.toml b/tox.toml new file mode 100644 index 0000000000..8bebeeb0aa --- /dev/null +++ b/tox.toml @@ -0,0 +1,163 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +requires = ["tox>=4.61", "tox-uv-bare>=1.28"] + +env_list = [ + "typecheck", + { product = [["test"], { py = { prefix = "3.", start = 11, stop = 14 } }] }, +] + +skip_missing_interpreters = true + +[env_run_base] +description = "Run unit tests on Python {factor:py}" +runner = "uv-venv-lock-runner" +package = "editable" +uv_sync_flags = [ + "--all-extras", + { replace = "if", condition = "factor.win32", then = ["--no-extra", "hive-kerberos"], "else" = [], extend = true }, +] +pass_env = ["COVERAGE", "COVERAGE_FAIL_UNDER"] +commands = [ + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, + "pytest", + "-m", + "unit", + "--ignore=tests/integration", + { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, + ], +] + +[env.unit] +description = "Run unit tests on the current Python" + +[env.typecheck] +description = "Run mypy type checking" +package = "skip" +only_groups = ["types"] +uv_sync_flags = [] +commands = [ + ["mypy", "--config-file=pyproject.toml", "pyiceberg", "tests", "dev", "setup.py", "mkdocs"], +] + +[env.integration] +description = "Run Spark integration tests" +allowlist_externals = ["docker"] +pass_env = ["COVERAGE", "COVERAGE_FAIL_UNDER", "KEEP_COMPOSE"] +commands_pre = [ + ["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", "--build", "--wait"], + ["python", "dev/provision.py"], +] +commands = [ + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, + "pytest", + "-m", + "integration", + { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, + ], +] +commands_post = [ + { replace = "if", condition = "env.KEEP_COMPOSE != '1'", then = [["docker", "compose", "-f", "dev/docker-compose-integration.yml", "down", "-v", "--remove-orphans", "--timeout", "0"]], "else" = [], extend = true }, +] +interrupt_post_commands = true + +[env.s3] +description = "Run S3 integration tests" +allowlist_externals = ["sh"] +commands_pre = [["sh", "./dev/run-s3.sh"]] +commands = [ + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, + "pytest", + "-m", + "s3", + { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, + ], +] + +[env.adls] +description = "Run ADLS integration tests" +allowlist_externals = ["sh"] +commands_pre = [["sh", "./dev/run-azurite.sh"]] +commands = [ + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, + "pytest", + "-m", + "adls", + { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, + ], +] + +[env.gcs] +description = "Run GCS integration tests" +allowlist_externals = ["sh"] +# gcsfs 2026.6.0 sends HNS/Zonal bucket detection to endpoint_url, which fake-gcs-server +# does not support. Workaround: https://github.com/fsspec/gcsfs/blob/2026.6.0/docs/source/hns_buckets.rst#L99-L101 +set_env = { GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT = "false" } +commands_pre = [["sh", "./dev/run-gcs-server.sh"]] +commands = [ + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, + "pytest", + "-m", + "gcs", + { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, + ], +] + +[env.notebook] +description = "Run notebook tests via papermill" +commands = [ + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, + "pytest", + "-m", + "notebook", + { replace = "posargs", default = ["tests/notebooks/test_pyiceberg_example.py", "tests/notebooks/test_spark_integration_example.py", "-v", "-x"], extend = true }, + ], +] + +[env.coverage] +description = "Combine and report test coverage" +depends = ["test-3.*", "unit"] +package = "skip" +only_groups = ["coverage"] +uv_sync_flags = [] +commands = [ + ["coverage", "combine"], + ["coverage", "report", "-m", "--fail-under={env:COVERAGE_FAIL_UNDER:85}"], + ["coverage", "html"], + ["coverage", "xml"], +] diff --git a/uv.lock b/uv.lock index acf8bc92dc..9a67d6b746 100644 --- a/uv.lock +++ b/uv.lock @@ -3347,6 +3347,44 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/be/59/e26cb779be4c591d1a910f59d29aca9fba4de70349840a833beba2652371/multidict-6.9.1-py3-none-any.whl", hash = "sha256:7bf6478188f4e47bf5686e8a33da4ae28bf43b1b2528d9ee144d28492bfac60b", size = 19176, upload-time = "2026-09-21T17:59:03.501Z" }, ] +[[package]] +name = "mypy" +version = "1.18.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mypy-extensions" }, + { name = "pathspec" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c0/77/8f0d0001ffad290cef2f7f216f96c814866248a0b92a722365ed54648e7e/mypy-1.18.2.tar.gz", hash = "sha256:06a398102a5f203d7477b2923dda3634c36727fa5c237d8f859ef90c42a9924b", size = 3448846, upload-time = "2025-09-19T00:11:10.519Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/87/cafd3ae563f88f94eec33f35ff722d043e09832ea8530ef149ec1efbaf08/mypy-1.18.2-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:807d9315ab9d464125aa9fcf6d84fde6e1dc67da0b6f80e7405506b8ac72bc7f", size = 12731198, upload-time = "2025-09-19T00:09:44.857Z" }, + { url = "https://files.pythonhosted.org/packages/0f/e0/1e96c3d4266a06d4b0197ace5356d67d937d8358e2ee3ffac71faa843724/mypy-1.18.2-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:776bb00de1778caf4db739c6e83919c1d85a448f71979b6a0edd774ea8399341", size = 11817879, upload-time = "2025-09-19T00:09:47.131Z" }, + { url = "https://files.pythonhosted.org/packages/72/ef/0c9ba89eb03453e76bdac5a78b08260a848c7bfc5d6603634774d9cd9525/mypy-1.18.2-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1379451880512ffce14505493bd9fe469e0697543717298242574882cf8cdb8d", size = 12427292, upload-time = "2025-09-19T00:10:22.472Z" }, + { url = "https://files.pythonhosted.org/packages/1a/52/ec4a061dd599eb8179d5411d99775bec2a20542505988f40fc2fee781068/mypy-1.18.2-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:1331eb7fd110d60c24999893320967594ff84c38ac6d19e0a76c5fd809a84c86", size = 13163750, upload-time = "2025-09-19T00:09:51.472Z" }, + { url = "https://files.pythonhosted.org/packages/c4/5f/2cf2ceb3b36372d51568f2208c021870fe7834cf3186b653ac6446511839/mypy-1.18.2-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3ca30b50a51e7ba93b00422e486cbb124f1c56a535e20eff7b2d6ab72b3b2e37", size = 13351827, upload-time = "2025-09-19T00:09:58.311Z" }, + { url = "https://files.pythonhosted.org/packages/c8/7d/2697b930179e7277529eaaec1513f8de622818696857f689e4a5432e5e27/mypy-1.18.2-cp311-cp311-win_amd64.whl", hash = "sha256:664dc726e67fa54e14536f6e1224bcfce1d9e5ac02426d2326e2bb4e081d1ce8", size = 9757983, upload-time = "2025-09-19T00:10:09.071Z" }, + { url = "https://files.pythonhosted.org/packages/07/06/dfdd2bc60c66611dd8335f463818514733bc763e4760dee289dcc33df709/mypy-1.18.2-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:33eca32dd124b29400c31d7cf784e795b050ace0e1f91b8dc035672725617e34", size = 12908273, upload-time = "2025-09-19T00:10:58.321Z" }, + { url = "https://files.pythonhosted.org/packages/81/14/6a9de6d13a122d5608e1a04130724caf9170333ac5a924e10f670687d3eb/mypy-1.18.2-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a3c47adf30d65e89b2dcd2fa32f3aeb5e94ca970d2c15fcb25e297871c8e4764", size = 11920910, upload-time = "2025-09-19T00:10:20.043Z" }, + { url = "https://files.pythonhosted.org/packages/5f/a9/b29de53e42f18e8cc547e38daa9dfa132ffdc64f7250e353f5c8cdd44bee/mypy-1.18.2-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5d6c838e831a062f5f29d11c9057c6009f60cb294fea33a98422688181fe2893", size = 12465585, upload-time = "2025-09-19T00:10:33.005Z" }, + { url = "https://files.pythonhosted.org/packages/77/ae/6c3d2c7c61ff21f2bee938c917616c92ebf852f015fb55917fd6e2811db2/mypy-1.18.2-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:01199871b6110a2ce984bde85acd481232d17413868c9807e95c1b0739a58914", size = 13348562, upload-time = "2025-09-19T00:10:11.51Z" }, + { url = "https://files.pythonhosted.org/packages/4d/31/aec68ab3b4aebdf8f36d191b0685d99faa899ab990753ca0fee60fb99511/mypy-1.18.2-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a2afc0fa0b0e91b4599ddfe0f91e2c26c2b5a5ab263737e998d6817874c5f7c8", size = 13533296, upload-time = "2025-09-19T00:10:06.568Z" }, + { url = "https://files.pythonhosted.org/packages/9f/83/abcb3ad9478fca3ebeb6a5358bb0b22c95ea42b43b7789c7fb1297ca44f4/mypy-1.18.2-cp312-cp312-win_amd64.whl", hash = "sha256:d8068d0afe682c7c4897c0f7ce84ea77f6de953262b12d07038f4d296d547074", size = 9828828, upload-time = "2025-09-19T00:10:28.203Z" }, + { url = "https://files.pythonhosted.org/packages/5f/04/7f462e6fbba87a72bc8097b93f6842499c428a6ff0c81dd46948d175afe8/mypy-1.18.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:07b8b0f580ca6d289e69209ec9d3911b4a26e5abfde32228a288eb79df129fcc", size = 12898728, upload-time = "2025-09-19T00:10:01.33Z" }, + { url = "https://files.pythonhosted.org/packages/99/5b/61ed4efb64f1871b41fd0b82d29a64640f3516078f6c7905b68ab1ad8b13/mypy-1.18.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:ed4482847168439651d3feee5833ccedbf6657e964572706a2adb1f7fa4dfe2e", size = 11910758, upload-time = "2025-09-19T00:10:42.607Z" }, + { url = "https://files.pythonhosted.org/packages/3c/46/d297d4b683cc89a6e4108c4250a6a6b717f5fa96e1a30a7944a6da44da35/mypy-1.18.2-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:c3ad2afadd1e9fea5cf99a45a822346971ede8685cc581ed9cd4d42eaf940986", size = 12475342, upload-time = "2025-09-19T00:11:00.371Z" }, + { url = "https://files.pythonhosted.org/packages/83/45/4798f4d00df13eae3bfdf726c9244bcb495ab5bd588c0eed93a2f2dd67f3/mypy-1.18.2-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a431a6f1ef14cf8c144c6b14793a23ec4eae3db28277c358136e79d7d062f62d", size = 13338709, upload-time = "2025-09-19T00:11:03.358Z" }, + { url = "https://files.pythonhosted.org/packages/d7/09/479f7358d9625172521a87a9271ddd2441e1dab16a09708f056e97007207/mypy-1.18.2-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:7ab28cc197f1dd77a67e1c6f35cd1f8e8b73ed2217e4fc005f9e6a504e46e7ba", size = 13529806, upload-time = "2025-09-19T00:10:26.073Z" }, + { url = "https://files.pythonhosted.org/packages/71/cf/ac0f2c7e9d0ea3c75cd99dff7aec1c9df4a1376537cb90e4c882267ee7e9/mypy-1.18.2-cp313-cp313-win_amd64.whl", hash = "sha256:0e2785a84b34a72ba55fb5daf079a1003a34c05b22238da94fcae2bbe46f3544", size = 9833262, upload-time = "2025-09-19T00:10:40.035Z" }, + { url = "https://files.pythonhosted.org/packages/5a/0c/7d5300883da16f0063ae53996358758b2a2df2a09c72a5061fa79a1f5006/mypy-1.18.2-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:62f0e1e988ad41c2a110edde6c398383a889d95b36b3e60bcf155f5164c4fdce", size = 12893775, upload-time = "2025-09-19T00:10:03.814Z" }, + { url = "https://files.pythonhosted.org/packages/50/df/2cffbf25737bdb236f60c973edf62e3e7b4ee1c25b6878629e88e2cde967/mypy-1.18.2-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:8795a039bab805ff0c1dfdb8cd3344642c2b99b8e439d057aba30850b8d3423d", size = 11936852, upload-time = "2025-09-19T00:10:51.631Z" }, + { url = "https://files.pythonhosted.org/packages/be/50/34059de13dd269227fb4a03be1faee6e2a4b04a2051c82ac0a0b5a773c9a/mypy-1.18.2-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6ca1e64b24a700ab5ce10133f7ccd956a04715463d30498e64ea8715236f9c9c", size = 12480242, upload-time = "2025-09-19T00:11:07.955Z" }, + { url = "https://files.pythonhosted.org/packages/5b/11/040983fad5132d85914c874a2836252bbc57832065548885b5bb5b0d4359/mypy-1.18.2-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d924eef3795cc89fecf6bedc6ed32b33ac13e8321344f6ddbf8ee89f706c05cb", size = 13326683, upload-time = "2025-09-19T00:09:55.572Z" }, + { url = "https://files.pythonhosted.org/packages/e9/ba/89b2901dd77414dd7a8c8729985832a5735053be15b744c18e4586e506ef/mypy-1.18.2-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:20c02215a080e3a2be3aa50506c67242df1c151eaba0dcbc1e4e557922a26075", size = 13514749, upload-time = "2025-09-19T00:10:44.827Z" }, + { url = "https://files.pythonhosted.org/packages/25/bc/cc98767cffd6b2928ba680f3e5bc969c4152bf7c2d83f92f5a504b92b0eb/mypy-1.18.2-cp314-cp314-win_amd64.whl", hash = "sha256:749b5f83198f1ca64345603118a6f01a4e99ad4bf9d103ddc5a3200cc4614adf", size = 9982959, upload-time = "2025-09-19T00:10:37.344Z" }, + { url = "https://files.pythonhosted.org/packages/87/e3/be76d87158ebafa0309946c4a73831974d4d6ab4f4ef40c3b53a385a66fd/mypy-1.18.2-py3-none-any.whl", hash = "sha256:22a1748707dd62b58d2ae53562ffc4d7f8bcc727e8ac7cbc69c053ddc874d47e", size = 2352367, upload-time = "2025-09-19T00:10:15.489Z" }, +] + [[package]] name = "mypy-boto3-dynamodb" version = "1.43.116" @@ -3371,6 +3409,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/bf/40/e39ab4d98e70b76b3e93bb0c8e1e3500149b4eb8d0f47e3f60ae877c98ff/mypy_boto3_glue-1.43.118-py3-none-any.whl", hash = "sha256:90eae3e7b23649d6fe3f99d4f3b2f491608615b12eb8e8c8b0c0b9a926f85b8c", size = 158880, upload-time = "2026-10-22T19:26:23.01Z" }, ] +[[package]] +name = "mypy-extensions" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d0/6f/43edf3be2748d0e40974a5ee046a8bb4c9961a4bdd3e7d5c6dcbf32d1af6/mypy_extensions-1.2.0.tar.gz", hash = "sha256:c6e275a07f1c2fc096b62940452d0eaa3f3af7de45d704787866240a7c6d5a51", size = 6566, upload-time = "2026-11-03T16:26:33.692Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b5/99/7b1adac7e97ce7bbda34792dc6e9b2f5cc5cffd1875883f78a818b2a2687/mypy_extensions-1.2.0-py3-none-any.whl", hash = "sha256:993e7a20aa5671eb41a7132cf555af30062da99729601601b9a8382b11cae768", size = 5114, upload-time = "2026-11-03T16:26:32.731Z" }, +] + [[package]] name = "natsort" version = "8.4.0" @@ -3640,11 +3687,11 @@ wheels = [ [[package]] name = "packaging" -version = "26.2" +version = "26.4" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" } +sdist = { url = "https://files.pythonhosted.org/packages/c3/75/ffb1dc0ed12352139fb4ca0e3fde4325a23e3d0f3f40efe89717bc4f557b/packaging-26.4.tar.gz", hash = "sha256:c4b671c41ddb9bf26e543c37723610d28fb6bf7affc4da17cf048d419d2c062a", size = 355877, upload-time = "2026-11-23T21:44:11.152Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" }, + { url = "https://files.pythonhosted.org/packages/ba/7b/5504f91c9c2733f693d7759e50ede5d27119d4da7e5836c46d3b5ff81d56/packaging-26.4-py3-none-any.whl", hash = "sha256:81383611a09c1bc0b08b76e0fd5829d7c6824c65b27a6aee339da133f4233ea2", size = 140049, upload-time = "2026-11-23T21:44:09.531Z" }, ] [[package]] @@ -4535,6 +4582,9 @@ sql-sqlite = [ ] [package.dev-dependencies] +coverage = [ + { name = "coverage", extra = ["toml"] }, +] dev = [ { name = "coverage", extra = ["toml"] }, { name = "cython" }, @@ -4559,6 +4609,8 @@ dev = [ { name = "requests-mock" }, { name = "setuptools" }, { name = "sqlalchemy" }, + { name = "tox" }, + { name = "tox-uv-bare" }, { name = "ty" }, { name = "typing-extensions" }, ] @@ -4575,9 +4627,23 @@ docs = [ { name = "mkdocstrings" }, { name = "mkdocstrings-python" }, ] +lint = [ + { name = "prek" }, +] notebook = [ { name = "jupyterlab" }, ] +tox = [ + { name = "tox" }, + { name = "tox-uv-bare" }, +] +types = [ + { name = "mypy" }, + { name = "types-cachetools" }, + { name = "types-pytest-lazy-fixture" }, + { name = "types-pytz" }, + { name = "types-requests" }, +] [package.metadata] requires-dist = [ @@ -4630,6 +4696,7 @@ requires-dist = [ provides-extras = ["pyarrow", "pandas", "duckdb", "ray", "bodo", "daft", "polars", "snappy", "hive", "hive-kerberos", "s3fs", "glue", "adlfs", "dynamodb", "bigquery", "sql-postgres", "sql-sqlite", "gcsfs", "rest-sigv4", "hf", "pyiceberg-core", "datafusion", "gcp-auth", "entra-auth", "geoarrow", "encryption"] [package.metadata.requires-dev] +coverage = [{ name = "coverage", extras = ["toml"], specifier = ">=7.4.2" }] dev = [ { name = "coverage", extras = ["toml"], specifier = ">=7.4.2" }, { name = "cython", specifier = ">=3.0.0" }, @@ -4654,6 +4721,8 @@ dev = [ { name = "requests-mock", specifier = "==1.12.1" }, { name = "setuptools", specifier = ">=83.0.0" }, { name = "sqlalchemy", specifier = ">=2.0.18,<3" }, + { name = "tox", specifier = ">=4.61" }, + { name = "tox-uv-bare", specifier = ">=1.28" }, { name = "ty", specifier = "==0.0.92" }, { name = "typing-extensions", specifier = "==4.16.0" }, ] @@ -4670,7 +4739,19 @@ docs = [ { name = "mkdocstrings", specifier = "==1.0.8" }, { name = "mkdocstrings-python", specifier = "==2.0.9" }, ] +lint = [{ name = "prek", specifier = ">=0.2.1" }] notebook = [{ name = "jupyterlab", specifier = ">=4.0.0" }] +tox = [ + { name = "tox", specifier = ">=4.61" }, + { name = "tox-uv-bare", specifier = ">=1.28" }, +] +types = [ + { name = "mypy", specifier = "==1.18.2" }, + { name = "types-cachetools", specifier = "==7.0.0.20260713" }, + { name = "types-pytest-lazy-fixture", specifier = "==0.6.3.20260518" }, + { name = "types-pytz", specifier = "==2026.5.0.20261006" }, + { name = "types-requests", specifier = "==2.33.0.20261006" }, +] [[package]] name = "pyiceberg-core" @@ -4721,6 +4802,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/10/bd/c038d7cc38edc1aa5bf91ab8068b63d4308c66c4c8bb3cbba7dfbc049f9c/pyparsing-3.3.2-py3-none-any.whl", hash = "sha256:850ba148bd908d7e2411587e247a1e4f0327839c40e2e5e6d05a007ecc69911d", size = 122781, upload-time = "2026-01-21T03:57:55.912Z" }, ] +[[package]] +name = "pyproject-api" +version = "1.12.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/32/e4/a51838ca1b9c6135dc86eda7188e9681a023ecbf684c92e5df59f69deb2f/pyproject_api-1.12.6.tar.gz", hash = "sha256:422f037b711cebc650241102a83496aeee6eba088597ce84b58b473760740ad7", size = 73129, upload-time = "2026-11-18T00:29:47.917Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/91/af/e9c90a275b4662847b07708b5d2d1551ec5ec26d3f58f915eba764735907/pyproject_api-1.12.6-py3-none-any.whl", hash = "sha256:499d27d6ccc486c2f116b35322bbd4993f35f7b216a0b8fe718ac5ff2ce99d73", size = 67450, upload-time = "2026-11-18T00:29:46.638Z" }, +] + [[package]] name = "pyproject-hooks" version = "1.2.0" @@ -4909,14 +5002,14 @@ wheels = [ [[package]] name = "python-discovery" -version = "1.6.1" +version = "1.9.7" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "filelock" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/0c/57/250bd238b966cece44328235eb85290045d059265fdaf7527a3a958123db/python_discovery-1.6.1.tar.gz", hash = "sha256:cf87d3627dfb4412437fdd5b13eae402607722998d21567993aedbc59b23c15e", size = 84338, upload-time = "2026-09-18T01:31:53.971Z" } +sdist = { url = "https://files.pythonhosted.org/packages/0c/72/8e1d062fa1eed059b49a981394ab3ae26fffea6bbcffa4f7545aa2fb8c4f/python_discovery-1.9.7.tar.gz", hash = "sha256:cea89e8a8b86e19731c67f8393f34eb1a2f96c9f97f3e406929a99c646a2358d", size = 148580, upload-time = "2026-11-23T18:24:40.767Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/16/7d/e9ffbadfbf89c93848412d04594135c4ae8c1d37d9e053b9c3ed718fabc4/python_discovery-1.6.1-py3-none-any.whl", hash = "sha256:d43fcdef879fe795352bd13ccf8d185ba5a9f86f36cfcd00529f596e737442b3", size = 38664, upload-time = "2026-09-18T01:31:52.448Z" }, + { url = "https://files.pythonhosted.org/packages/6c/47/d4852249f59b263ff1bc66456c6ca13dfd5d67900ce72c0418389b33db5d/python_discovery-1.9.7-py3-none-any.whl", hash = "sha256:3add4a4dfc794f8e4a8c0fa0d9d6563172196d68709071a627e89fc36af39177", size = 99275, upload-time = "2026-11-23T18:24:39.415Z" }, ] [[package]] @@ -5941,6 +6034,15 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/7b/61/cceae43728b7de99d9b847560c262873a1f6c98202171fd5ed62640b494b/tomli-2.4.1-py3-none-any.whl", hash = "sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe", size = 14583, upload-time = "2026-03-25T20:22:03.012Z" }, ] +[[package]] +name = "tomli-w" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/19/75/241269d1da26b624c0d5e110e8149093c759b7a286138f4efd61a60e75fe/tomli_w-1.2.0.tar.gz", hash = "sha256:2dd14fac5a47c27be9cd4c976af5a12d87fb1f0b4512f81d69cce3b35ae25021", size = 7184, upload-time = "2025-01-15T12:07:24.262Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c7/18/c86eb8e0202e32dd3df50d43d7ff9854f8e0603945ff398974c1d91ac1ef/tomli_w-1.2.0-py3-none-any.whl", hash = "sha256:188306098d013b691fcadc011abd66727d3c414c571bb01b1a174ba8c983cf90", size = 6675, upload-time = "2025-01-15T12:07:22.074Z" }, +] + [[package]] name = "tornado" version = "6.6.1" @@ -5991,6 +6093,41 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/f8/62/8d0c0c42f3346f3f2455738d3bc689bbd8efba38abf7b90ab2b8294eae83/tornado-6.6.1-cp315-cp315t-win_arm64.whl", hash = "sha256:065bc741478b168df9baf754956a3010c04d1330bb45a84833d807c29e11b257", size = 535719, upload-time = "2026-11-09T21:09:21.317Z" }, ] +[[package]] +name = "tox" +version = "4.67.16" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cachetools" }, + { name = "colorama" }, + { name = "filelock" }, + { name = "packaging" }, + { name = "platformdirs" }, + { name = "pluggy" }, + { name = "pyproject-api" }, + { name = "python-discovery" }, + { name = "tomli-w" }, + { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "virtualenv" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ee/da/21b91a62f39b4a9f1a3dca15563d255143b1127416107c445ea9ebcc1289/tox-4.67.16.tar.gz", hash = "sha256:5aebaa21a648bb4c129724a2e7aeb4ce951f0d93a37f8709b630719fd5b78ab5", size = 479533, upload-time = "2026-11-23T21:05:28.349Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/72/98/b3c2fa23a231fed77f6257df4b39291333b4b3bc3d7864f8591057aa544f/tox-4.67.16-py3-none-any.whl", hash = "sha256:daae3d97a74096cc4f18399dc09dd2bb767470336e02a0de3232a4d7bb546baa", size = 381081, upload-time = "2026-11-23T21:05:26.855Z" }, +] + +[[package]] +name = "tox-uv-bare" +version = "1.37.9" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "packaging" }, + { name = "tox" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/8a/d3/43985230bef3a49720fd2591dd3fe72ef7ca9ff1dab538bce29af4e9223f/tox_uv_bare-1.37.9.tar.gz", hash = "sha256:ea95c452c8b6db9e1e1015aa5daea6c182e9dff67484436f2e66e7db0cbbfebc", size = 40996, upload-time = "2026-11-18T01:41:18.165Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/59/df40cf652996a048c2b93db816d754e7a5f94e34844143e0a14549f3eebc/tox_uv_bare-1.37.9-py3-none-any.whl", hash = "sha256:49fa9f73999b03f9b0baa3f484d1b03e8eef3ea2682a1927fb928c3a9f0aa468", size = 82843, upload-time = "2026-11-18T01:41:16.424Z" }, +] + [[package]] name = "tqdm" version = "4.67.3" @@ -6046,6 +6183,45 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/6e/70/8369564e77a7e896d37819570c27f52573fa356d1c225312bf16ee402524/ty-0.0.92-py3-none-win_arm64.whl", hash = "sha256:37eaf557f9a9723515bece5c4e8228eb0e2286184de6115c0071ce08d8a21267", size = 13411491, upload-time = "2026-10-26T03:13:56.15Z" }, ] +[[package]] +name = "types-cachetools" +version = "7.0.0.20260713" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/34/64/66d7efdb36ecf6826aca5415e59fe2df96e97d24157147e53acfbe8dda11/types_cachetools-7.0.0.20260713.tar.gz", hash = "sha256:f1acf079e9c66a81e096a897ef0b261a82117cf856834e37b4bd0c9a116a076a", size = 10199, upload-time = "2026-07-13T05:22:21.845Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0e/c7/d3525c9dbdc1be7786bad46655ef051b6e7993f656d304719ec40079c91c/types_cachetools-7.0.0.20260713-py3-none-any.whl", hash = "sha256:6db9bcc7a3840d39e91c04117d85a9d0937eacc9d14d12a873e2b01a2d24a71d", size = 9615, upload-time = "2026-07-13T05:22:20.76Z" }, +] + +[[package]] +name = "types-pytest-lazy-fixture" +version = "0.6.3.20260518" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/65/46/a79ab84cdace98870440968006c86eec5cab22b64f805e1770d8b19bf8d8/types_pytest_lazy_fixture-0.6.3.20260518.tar.gz", hash = "sha256:5e4c259c3c0eddbbf7719d81109050f4e9dcf9f650291a6ff3de42b964734acd", size = 7472, upload-time = "2026-05-18T06:05:45.222Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dd/3e/bfcb69336e4a1c69b87f634a3ddebeb6c77f55932631407d191d8b394128/types_pytest_lazy_fixture-0.6.3.20260518-py3-none-any.whl", hash = "sha256:5fc2bc417c2804145ddfcff91bd3f472c8cfbe79b84a2a3abae661ef45408ec1", size = 7599, upload-time = "2026-05-18T06:05:44.471Z" }, +] + +[[package]] +name = "types-pytz" +version = "2026.5.0.20261006" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ba/47/b493f47f2dd0971db06459439ebdeb114cf95029188268099b331bbc4727/types_pytz-2026.5.0.20261006.tar.gz", hash = "sha256:1a522c2ec03aad8d4baaf97105958019ad51704b1e471c882d1c6ccea3e5e64b", size = 11073, upload-time = "2026-10-06T08:15:12.87Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/77/38/e375026fb4ff74fed6bdb84d7d336571d0603b6b9675751579cec84cfc9b/types_pytz-2026.5.0.20261006-py3-none-any.whl", hash = "sha256:9e4a893b362a8eed4e10a348c80603ade65bdb3819419e589364afafe2ea08b1", size = 10168, upload-time = "2026-10-06T08:15:11.985Z" }, +] + +[[package]] +name = "types-requests" +version = "2.33.0.20261006" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "urllib3" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/57/15/9b7e2e2e7c87d01366185b198b3febc6bc0c973f2bf21a62da4ab7d3495e/types_requests-2.33.0.20261006.tar.gz", hash = "sha256:0652999e9306aea345f40732d58fa49a7f6cade6a0d74d92119c5c8d82eddaf0", size = 25316, upload-time = "2026-10-06T08:15:57.782Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4d/72/b82789207b3d360ce9f5a4372c790c52cc3dd928aeb7d4faeec652b651b2/types_requests-2.33.0.20261006-py3-none-any.whl", hash = "sha256:26cc8146505cab33cda9737991929e4144c559bebe05078ccc6998f27c4ca2c1", size = 21445, upload-time = "2026-10-06T08:15:56.658Z" }, +] + [[package]] name = "typing-extensions" version = "4.16.0" From 9c9f096be8133e13261a5b6db5fa03ff83668fb9 Mon Sep 17 00:00:00 2001 From: Orest Tokovenko Date: Wed, 25 Nov 2026 14:35:36 -0800 Subject: [PATCH 2/2] Format tox.toml with taplo --- tox.toml | 274 +++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 205 insertions(+), 69 deletions(-) diff --git a/tox.toml b/tox.toml index 8bebeeb0aa..2adbefa15d 100644 --- a/tox.toml +++ b/tox.toml @@ -18,8 +18,13 @@ requires = ["tox>=4.61", "tox-uv-bare>=1.28"] env_list = [ - "typecheck", - { product = [["test"], { py = { prefix = "3.", start = 11, stop = 14 } }] }, + "typecheck", + { product = [ + [ + "test", + ], + { py = { prefix = "3.", start = 11, stop = 14 } }, + ] }, ] skip_missing_interpreters = true @@ -29,21 +34,36 @@ description = "Run unit tests on Python {factor:py}" runner = "uv-venv-lock-runner" package = "editable" uv_sync_flags = [ - "--all-extras", - { replace = "if", condition = "factor.win32", then = ["--no-extra", "hive-kerberos"], "else" = [], extend = true }, + "--all-extras", + { replace = "if", condition = "factor.win32", then = [ + "--no-extra", + "hive-kerberos", + ], "else" = [ + ], extend = true }, ] pass_env = ["COVERAGE", "COVERAGE_FAIL_UNDER"] commands = [ - [ - "python", - "-m", - { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, - "pytest", - "-m", - "unit", - "--ignore=tests/integration", - { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, - ], + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = [ + "coverage", + "run", + "--parallel-mode", + "--source=pyiceberg", + "-m", + ], "else" = [ + ], extend = true }, + "pytest", + "-m", + "unit", + "--ignore=tests/integration", + { replace = "posargs", default = [ + "tests/", + "-v", + "-x", + ], extend = true }, + ], ] [env.unit] @@ -55,7 +75,15 @@ package = "skip" only_groups = ["types"] uv_sync_flags = [] commands = [ - ["mypy", "--config-file=pyproject.toml", "pyiceberg", "tests", "dev", "setup.py", "mkdocs"], + [ + "mypy", + "--config-file=pyproject.toml", + "pyiceberg", + "tests", + "dev", + "setup.py", + "mkdocs", + ], ] [env.integration] @@ -63,24 +91,73 @@ description = "Run Spark integration tests" allowlist_externals = ["docker"] pass_env = ["COVERAGE", "COVERAGE_FAIL_UNDER", "KEEP_COMPOSE"] commands_pre = [ - ["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", "--build", "--wait"], - ["python", "dev/provision.py"], + [ + "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", + "--build", + "--wait", + ], + [ + "python", + "dev/provision.py", + ], ] commands = [ - [ - "python", - "-m", - { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, - "pytest", - "-m", - "integration", - { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, - ], + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = [ + "coverage", + "run", + "--parallel-mode", + "--source=pyiceberg", + "-m", + ], "else" = [ + ], extend = true }, + "pytest", + "-m", + "integration", + { replace = "posargs", default = [ + "tests/", + "-v", + "-x", + ], extend = true }, + ], ] commands_post = [ - { replace = "if", condition = "env.KEEP_COMPOSE != '1'", then = [["docker", "compose", "-f", "dev/docker-compose-integration.yml", "down", "-v", "--remove-orphans", "--timeout", "0"]], "else" = [], extend = true }, + { replace = "if", condition = "env.KEEP_COMPOSE != '1'", then = [ + [ + "docker", + "compose", + "-f", + "dev/docker-compose-integration.yml", + "down", + "-v", + "--remove-orphans", + "--timeout", + "0", + ], + ], "else" = [ + ], extend = true }, ] interrupt_post_commands = true @@ -89,15 +166,26 @@ description = "Run S3 integration tests" allowlist_externals = ["sh"] commands_pre = [["sh", "./dev/run-s3.sh"]] commands = [ - [ - "python", - "-m", - { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, - "pytest", - "-m", - "s3", - { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, - ], + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = [ + "coverage", + "run", + "--parallel-mode", + "--source=pyiceberg", + "-m", + ], "else" = [ + ], extend = true }, + "pytest", + "-m", + "s3", + { replace = "posargs", default = [ + "tests/", + "-v", + "-x", + ], extend = true }, + ], ] [env.adls] @@ -105,15 +193,26 @@ description = "Run ADLS integration tests" allowlist_externals = ["sh"] commands_pre = [["sh", "./dev/run-azurite.sh"]] commands = [ - [ - "python", - "-m", - { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, - "pytest", - "-m", - "adls", - { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, - ], + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = [ + "coverage", + "run", + "--parallel-mode", + "--source=pyiceberg", + "-m", + ], "else" = [ + ], extend = true }, + "pytest", + "-m", + "adls", + { replace = "posargs", default = [ + "tests/", + "-v", + "-x", + ], extend = true }, + ], ] [env.gcs] @@ -124,29 +223,52 @@ allowlist_externals = ["sh"] set_env = { GCSFS_EXPERIMENTAL_ZB_HNS_SUPPORT = "false" } commands_pre = [["sh", "./dev/run-gcs-server.sh"]] commands = [ - [ - "python", - "-m", - { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, - "pytest", - "-m", - "gcs", - { replace = "posargs", default = ["tests/", "-v", "-x"], extend = true }, - ], + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = [ + "coverage", + "run", + "--parallel-mode", + "--source=pyiceberg", + "-m", + ], "else" = [ + ], extend = true }, + "pytest", + "-m", + "gcs", + { replace = "posargs", default = [ + "tests/", + "-v", + "-x", + ], extend = true }, + ], ] [env.notebook] description = "Run notebook tests via papermill" commands = [ - [ - "python", - "-m", - { replace = "if", condition = "env.COVERAGE == '1'", then = ["coverage", "run", "--parallel-mode", "--source=pyiceberg", "-m"], "else" = [], extend = true }, - "pytest", - "-m", - "notebook", - { replace = "posargs", default = ["tests/notebooks/test_pyiceberg_example.py", "tests/notebooks/test_spark_integration_example.py", "-v", "-x"], extend = true }, - ], + [ + "python", + "-m", + { replace = "if", condition = "env.COVERAGE == '1'", then = [ + "coverage", + "run", + "--parallel-mode", + "--source=pyiceberg", + "-m", + ], "else" = [ + ], extend = true }, + "pytest", + "-m", + "notebook", + { replace = "posargs", default = [ + "tests/notebooks/test_pyiceberg_example.py", + "tests/notebooks/test_spark_integration_example.py", + "-v", + "-x", + ], extend = true }, + ], ] [env.coverage] @@ -156,8 +278,22 @@ package = "skip" only_groups = ["coverage"] uv_sync_flags = [] commands = [ - ["coverage", "combine"], - ["coverage", "report", "-m", "--fail-under={env:COVERAGE_FAIL_UNDER:85}"], - ["coverage", "html"], - ["coverage", "xml"], + [ + "coverage", + "combine", + ], + [ + "coverage", + "report", + "-m", + "--fail-under={env:COVERAGE_FAIL_UNDER:85}", + ], + [ + "coverage", + "html", + ], + [ + "coverage", + "xml", + ], ]