Skip to content

fix(python): pin python version and add uv caching#3690

Open
slbotbm wants to merge 3 commits into
apache:masterfrom
slbotbm:python-resync
Open

fix(python): pin python version and add uv caching#3690
slbotbm wants to merge 3 commits into
apache:masterfrom
slbotbm:python-resync

Conversation

@slbotbm

@slbotbm slbotbm commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

While working on the python sdk, often uv sync --all-extras does not actually recreate the .so file using the latest changes and leaves the old version of the sdk, leading to difficulties in actually testing it on local. This change adds explicit cache keys for files. If the files are changed, the .so extension is automatically rebuilt on running uv sync --all-extras. (caveat: it will also be run when running other commands like uv run ruff format since there is a hidden sync step in these commands).

I also pin the python version to 3.10 explicitly. Previously, we only declare the python version to be >= 3.10, which led to uv downloading python according to the following hierarchy:

  1. Existing compatible uv-managed Python, preferring newer versions.
  2. First compatible system Python found—not necessarily newest.
  3. If none exists, downloads the latest compatible stable Python.

By pinning the version, we force uv to utilize 3.10.

@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jul 17, 2026
Comment thread foreign/python/pyproject.toml
@slbotbm

slbotbm commented Jul 19, 2026

Copy link
Copy Markdown
Contributor Author

/ready

@ryankert01 ryankert01 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add these 3 .python-version files to current sync check (sync-python-interpreter-version.sh) so precommit would detect version inconsistencies if we upgrade at somewhere.

@slbotbm

slbotbm commented Jul 20, 2026

Copy link
Copy Markdown
Contributor Author

@ryankert01 updated, thanks for the reminder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants