This is an automated email from the ASF dual-hosted git repository. fokko pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/iceberg-python.git
The following commit(s) were added to refs/heads/main by this push: new a56795f3 infra: let Makefile execute command from python (#2476) a56795f3 is described below commit a56795f3bf4d63a763861171ee3ec01df91301b6 Author: Kevin Liu <kevinjq...@users.noreply.github.com> AuthorDate: Wed Sep 17 00:07:04 2025 -0700 infra: let Makefile execute command from python (#2476) <!-- Thanks for opening a pull request! --> <!-- In the case this PR will resolve an issue, please replace ${GITHUB_ISSUE_ID} below with the actual Github issue id. --> <!-- Closes #${GITHUB_ISSUE_ID} --> # Rationale for this change On Windows, `poetry` is not automatically put in the PATH `pip` also might point to a different executable Source all commands from the same `python` ## Are these changes tested? ## Are there any user-facing changes? <!-- In the case of user-facing changes, please add the changelog label. --> --- .github/workflows/python-ci-docs.yml | 4 ++-- .github/workflows/python-ci.yml | 4 ++-- .github/workflows/python-release-docs.yml | 4 ++-- Makefile | 37 +++++++++++++++++-------------- 4 files changed, 26 insertions(+), 23 deletions(-) diff --git a/.github/workflows/python-ci-docs.yml b/.github/workflows/python-ci-docs.yml index 5517e032..a2c08bd3 100644 --- a/.github/workflows/python-ci-docs.yml +++ b/.github/workflows/python-ci-docs.yml @@ -36,11 +36,11 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Install poetry - run: make install-poetry - uses: actions/setup-python@v6 with: python-version: 3.12 + - name: Install poetry + run: make install-poetry - name: Install run: make docs-install - name: Build docs diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml index 86e1ce72..a79daa59 100644 --- a/.github/workflows/python-ci.yml +++ b/.github/workflows/python-ci.yml @@ -51,11 +51,11 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Install poetry - run: make install-poetry - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} + - name: Install poetry + run: make install-poetry - name: Install system dependencies run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for kerberos - name: Install diff --git a/.github/workflows/python-release-docs.yml b/.github/workflows/python-release-docs.yml index 6c372cdb..c76aeab2 100644 --- a/.github/workflows/python-release-docs.yml +++ b/.github/workflows/python-release-docs.yml @@ -31,11 +31,11 @@ jobs: steps: - uses: actions/checkout@v5 - - name: Install poetry - run: make install-poetry - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python }} + - name: Install poetry + run: make install-poetry - name: Install docs run: make docs-install - name: Build docs diff --git a/Makefile b/Makefile index fe080764..13a9185a 100644 --- a/Makefile +++ b/Makefile @@ -23,10 +23,15 @@ 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.1.4 +POETRY = python -m poetry + ifeq ($(COVERAGE),1) - TEST_RUNNER = poetry run coverage run --parallel-mode --source=pyiceberg -m + TEST_RUNNER = $(POETRY) run coverage run --parallel-mode --source=pyiceberg -m else - TEST_RUNNER = poetry run + TEST_RUNNER = $(POETRY) run endif ifeq ($(KEEP_COMPOSE),1) @@ -35,8 +40,6 @@ else CLEANUP_COMMAND = docker compose -f dev/docker-compose-integration.yml down -v --remove-orphans 2>/dev/null || true endif -POETRY_VERSION = 2.1.4 - # ============ # Help Section # ============ @@ -53,21 +56,21 @@ help: ## Display this help message ##@ Setup install-poetry: ## Ensure Poetry is installed at the specified version - @if ! command -v poetry &> /dev/null; then \ + @if ! command -v ${POETRY} &> /dev/null; then \ echo "Poetry not found. Installing..."; \ - pip install --user poetry==$(POETRY_VERSION); \ + ${PIP} install --user poetry==$(POETRY_VERSION); \ else \ - INSTALLED_VERSION=$$(pip show poetry | grep Version | awk '{print $$2}'); \ + 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 --user --upgrade poetry==$(POETRY_VERSION); \ + ${PIP} install --user --upgrade poetry==$(POETRY_VERSION); \ else \ echo "Poetry version $(POETRY_VERSION) already installed."; \ fi; \ fi install-dependencies: ## Install all dependencies including extras - poetry install --all-extras + $(POETRY) install --all-extras install: install-poetry install-dependencies ## Install Poetry and dependencies @@ -81,7 +84,7 @@ check-license: ## Check license headers ./dev/check-license lint: ## Run code linters via pre-commit - poetry run pre-commit run --all-files + $(POETRY) run pre-commit run --all-files # =============== # Testing Section @@ -132,10 +135,10 @@ 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 + ${POETRY} run coverage combine + ${POETRY} run coverage report -m --fail-under=$(COVERAGE_FAIL_UNDER) + ${POETRY} run coverage html + ${POETRY} run coverage xml # ================ # Documentation @@ -144,13 +147,13 @@ coverage-report: ## Combine and report coverage ##@ Documentation docs-install: ## Install docs dependencies - poetry install --with docs + ${POETRY} install --with docs docs-serve: ## Serve local docs preview (hot reload) - poetry run mkdocs serve -f mkdocs/mkdocs.yml + ${POETRY} run mkdocs serve -f mkdocs/mkdocs.yml docs-build: ## Build the static documentation site - poetry run mkdocs build -f mkdocs/mkdocs.yml --strict + ${POETRY} run mkdocs build -f mkdocs/mkdocs.yml --strict # =================== # Project Maintenance