Skip to content

Commit dd83029

Browse files
committed
Use uv for managing python version
1 parent 1eeaf9c commit dd83029

File tree

5 files changed

+44
-2
lines changed

5 files changed

+44
-2
lines changed

.envrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
export VIRTUAL_ENV=".venv"
2-
layout python3
1+
export VIRTUAL_ENV="${PWD}/.venv"
2+
3+
PATH_add "${PWD}/.venv/bin"
4+

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.13.3

devenv/config.ini

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[devenv]
2+
minimum_version = 1.22.1
3+
4+
[uv]
5+
darwin_arm64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-aarch64-apple-darwin.tar.gz
6+
darwin_arm64_sha256 = 954d24634d5f37fa26c7af75eb79893d11623fc81b4de4b82d60d1ade4bfca22
7+
darwin_x86_64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-x86_64-apple-darwin.tar.gz
8+
darwin_x86_64_sha256 = ae755df53c8c2c1f3dfbee6e3d2e00be0dfbc9c9b4bdffdb040b96f43678b7ce
9+
linux_arm64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-aarch64-unknown-linux-gnu.tar.gz
10+
linux_arm64_sha256 = 27da35ef54e9131c2e305de67dd59a07c19257882c6b1f3cf4d8d5fbb8eaf4ca
11+
linux_x86_64 = https://github.com/astral-sh/uv/releases/download/0.8.2/uv-x86_64-unknown-linux-gnu.tar.gz
12+
linux_x86_64_sha256 = 6dcb28a541868a455aefb2e8d4a1283dd6bf888605a2db710f0530cec888b0ad
13+
# used for autoupdate
14+
# NOTE: if using uv-build as a build backend, you'll have to make sure the versions match
15+
version = 0.8.2
16+

devenv/sync.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from devenv import constants
2+
from devenv.lib import config, proc, uv
3+
4+
def main(context: dict[str, str]) -> int:
5+
reporoot = context["reporoot"]
6+
cfg = config.get_repo(reporoot)
7+
8+
uv.install(
9+
cfg["uv"]["version"],
10+
cfg["uv"][constants.SYSTEM_MACHINE],
11+
cfg["uv"][f"{constants.SYSTEM_MACHINE}_sha256"],
12+
reporoot,
13+
)
14+
15+
# reporoot/.venv is the default venv location
16+
print(f"syncing .venv ...")
17+
proc.run(("uv", "sync", "--frozen", "--quiet"))
18+
19+
return 0
20+

project.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[project]
2+
name = "javasdk"
3+
version = "0.0.0"

0 commit comments

Comments
 (0)