This is an automated email from the ASF dual-hosted git repository.
kevinjqliu 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 d62b3602 infra: allow rerun `make install` without prompt (#2979)
d62b3602 is described below
commit d62b36024ab36fc3f86be50634cd8b32ce3fb9a1
Author: Kevin Liu <[email protected]>
AuthorDate: Fri Jan 30 16:32:13 2026 -0500
infra: allow rerun `make install` without prompt (#2979)
<!--
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
This PR lets `uv` manage the virtual env. uv will only setup a new venv
if it does not exist and sync dep only when necessary.
This should make the entire `make install` process a lot faster and
easier to work with
### Context
I noticed running `make install` when a `.venv` already existed would
show an interactive prompt:
```
➜ make install
uv is already installed.
uv venv
Using CPython 3.12.11 interpreter at:
/Users/kevinliu/.pyenv/versions/3.12.11/bin/python3
Creating virtual environment at: .venv
? A virtual environment already exists at `.venv`. Do you want to replace
it? [y/n] › yes
hint: Use the `--clear` flag or set `UV_VENV_CLEAR=1` to skip this prompt
```
We dont need this prompt. And more crucially, claude keeps on getting
stuck on this prompt 😞
## Are these changes tested?
Yes running `make install` repeatedly
## Are there any user-facing changes?
<!-- In the case of user-facing changes, please add the changelog label.
-->
---
.github/workflows/python-ci.yml | 2 +-
Makefile | 21 +++++++++++----------
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/.github/workflows/python-ci.yml b/.github/workflows/python-ci.yml
index be2ab642..eb3f7265 100644
--- a/.github/workflows/python-ci.yml
+++ b/.github/workflows/python-ci.yml
@@ -62,7 +62,7 @@ jobs:
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libkrb5-dev # for
kerberos
- name: Install
- run: make install-dependencies
+ run: make install
- name: Run linters
run: make lint
- name: Run unit tests with coverage
diff --git a/Makefile b/Makefile
index e0e120cb..e710835c 100644
--- a/Makefile
+++ b/Makefile
@@ -66,16 +66,17 @@ install-uv: ## Ensure uv is installed
echo "uv is already installed."; \
fi
-setup-venv: ## Create virtual environment
- uv venv $(PYTHON_ARG)
-
-install-dependencies: setup-venv ## Install all dependencies including extras
- uv sync $(PYTHON_ARG) --all-extras --reinstall
-
-install-hooks: ## Install pre-commit hooks (skipped outside git repo, e.g.
release tarballs)
- @if [ -d .git ]; then uv run $(PYTHON_ARG) prek install; fi
-
-install: install-uv install-dependencies install-hooks ## Install uv,
dependencies, and pre-commit hooks
+install: install-uv ## Install uv, dependencies, and pre-commit hooks
+ uv sync $(PYTHON_ARG) --all-extras
+ @# Reinstall pyiceberg if Cython extensions (.so) are missing after
`make clean` (see #2869)
+ @if ! find pyiceberg -name "*.so" 2>/dev/null | grep -q .; then \
+ echo "Cython extensions not found, reinstalling pyiceberg..."; \
+ uv sync $(PYTHON_ARG) --all-extras --reinstall-package
pyiceberg; \
+ fi
+ @# Install pre-commit hooks (skipped outside git repo, e.g. release
tarballs)
+ @if [ -d .git ]; then \
+ uv run $(PYTHON_ARG) prek install; \
+ fi
# ===============
# Code Validation