From 75beb0812fd45edff4aca68d196c201afdc51318 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Thu, 8 Jan 2026 11:30:19 +0100 Subject: [PATCH 1/3] Use uv for managing python version --- .envrc | 6 ++++-- .python-version | 1 + devenv/config.ini | 16 ++++++++++++++++ devenv/sync.py | 20 ++++++++++++++++++++ project.toml | 3 +++ 5 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 .python-version create mode 100644 devenv/config.ini create mode 100644 devenv/sync.py create mode 100644 project.toml diff --git a/.envrc b/.envrc index 97b3f16c6f7..7488c246111 100644 --- a/.envrc +++ b/.envrc @@ -1,2 +1,4 @@ -export VIRTUAL_ENV=".venv" -layout python3 +export VIRTUAL_ENV="${PWD}/.venv" + +PATH_add "${PWD}/.venv/bin" + diff --git a/.python-version b/.python-version new file mode 100644 index 00000000000..2c20ac9bea3 --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.13.3 diff --git a/devenv/config.ini b/devenv/config.ini new file mode 100644 index 00000000000..b546b762c0c --- /dev/null +++ b/devenv/config.ini @@ -0,0 +1,16 @@ +[devenv] +minimum_version = 1.22.1 + +[uv] +darwin_arm64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-aarch64-apple-darwin.tar.gz +darwin_arm64_sha256 = 954d24634d5f37fa26c7af75eb79893d11623fc81b4de4b82d60d1ade4bfca22 +darwin_x86_64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-x86_64-apple-darwin.tar.gz +darwin_x86_64_sha256 = ae755df53c8c2c1f3dfbee6e3d2e00be0dfbc9c9b4bdffdb040b96f43678b7ce +linux_arm64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-aarch64-unknown-linux-gnu.tar.gz +linux_arm64_sha256 = 27da35ef54e9131c2e305de67dd59a07c19257882c6b1f3cf4d8d5fbb8eaf4ca +linux_x86_64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-x86_64-unknown-linux-gnu.tar.gz +linux_x86_64_sha256 = 6dcb28a541868a455aefb2e8d4a1283dd6bf888605a2db710f0530cec888b0ad +# used for autoupdate +# NOTE: if using uv-build as a build backend, you'll have to make sure the versions match +version = 0.8.2 + diff --git a/devenv/sync.py b/devenv/sync.py new file mode 100644 index 00000000000..9a5a4167b87 --- /dev/null +++ b/devenv/sync.py @@ -0,0 +1,20 @@ +from devenv import constants +from devenv.lib import config, proc, uv + +def main(context: dict[str, str]) -> int: + reporoot = context["reporoot"] + cfg = config.get_repo(reporoot) + + uv.install( + cfg["uv"]["version"], + cfg["uv"][constants.SYSTEM_MACHINE], + cfg["uv"][f"{constants.SYSTEM_MACHINE}_sha256"], + reporoot, + ) + + # reporoot/.venv is the default venv location + print(f"syncing .venv ...") + proc.run(("uv", "sync", "--frozen", "--quiet")) + + return 0 + diff --git a/project.toml b/project.toml new file mode 100644 index 00000000000..55509e3912b --- /dev/null +++ b/project.toml @@ -0,0 +1,3 @@ +[project] +name = "javasdk" +version = "0.0.0" From 924a40c2a57706df13c31aed6ecb5b1c6bec9e5f Mon Sep 17 00:00:00 2001 From: lcian <17258265+lcian@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:01:18 +0100 Subject: [PATCH 2/3] fix --- .envrc | 3 +-- .gitignore | 1 + project.toml => pyproject.toml | 0 uv.lock | 8 ++++++++ 4 files changed, 10 insertions(+), 2 deletions(-) rename project.toml => pyproject.toml (100%) create mode 100644 uv.lock diff --git a/.envrc b/.envrc index 7488c246111..f58a7cee600 100644 --- a/.envrc +++ b/.envrc @@ -1,4 +1,3 @@ export VIRTUAL_ENV="${PWD}/.venv" - +devenv sync PATH_add "${PWD}/.venv/bin" - diff --git a/.gitignore b/.gitignore index be4f11ce3d2..5f87fdbd5c5 100644 --- a/.gitignore +++ b/.gitignore @@ -27,3 +27,4 @@ spring-server.txt spy.log .kotlin **/tomcat.8080/webapps/ +**/__pycache__ diff --git a/project.toml b/pyproject.toml similarity index 100% rename from project.toml rename to pyproject.toml diff --git a/uv.lock b/uv.lock new file mode 100644 index 00000000000..84b75276602 --- /dev/null +++ b/uv.lock @@ -0,0 +1,8 @@ +version = 1 +revision = 2 +requires-python = ">=3.13" + +[[package]] +name = "javasdk" +version = "0.0.0" +source = { virtual = "." } From 53ea75b3befa2b127c101555492690dd120b6c5a Mon Sep 17 00:00:00 2001 From: lcian <17258265+lcian@users.noreply.github.com> Date: Thu, 8 Jan 2026 15:05:14 +0100 Subject: [PATCH 3/3] fix --- devenv/sync.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/devenv/sync.py b/devenv/sync.py index 9a5a4167b87..45e663cd99a 100644 --- a/devenv/sync.py +++ b/devenv/sync.py @@ -1,5 +1,6 @@ from devenv import constants from devenv.lib import config, proc, uv +import os def main(context: dict[str, str]) -> int: reporoot = context["reporoot"] @@ -14,6 +15,8 @@ def main(context: dict[str, str]) -> int: # reporoot/.venv is the default venv location print(f"syncing .venv ...") + if not os.path.exists(".venv"): + proc.run(("uv", "venv", "--seed")) proc.run(("uv", "sync", "--frozen", "--quiet")) return 0