Skip to content

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

Open
slbotbm wants to merge 1 commit into
apache:masterfrom
slbotbm:python-resync
Open

fix(python): pin python version and add uv caching#3690
slbotbm wants to merge 1 commit 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
{ file = "pyproject.toml" },
{ file = "Cargo.toml" },
{ file = "Cargo.lock" },
{ file = "src/**/*.rs" },

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would it make sense to also include the workspace root manifest here?

{ file = "../../Cargo.toml" }

My understanding is that since foreign/python is excluded from the root workspace, but core/sdk inherits most of its dependency versions and features from [workspace.dependencies] in the root Cargo.toml, a version bump there could change the build without any of the current cache keys noticing — so uv sync might keep the previously built .so.

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.

2 participants