Skip to content

Commit

Permalink
devenv: fix venv recreation for python 3.13 (#83321)
Browse files Browse the repository at this point in the history
sync is currently broken on venv recreation because this
check_minimum_version call happens after potential venv deletion

getsentry/getsentry#16115
  • Loading branch information
joshuarli authored Jan 14, 2025
1 parent e221530 commit 8aefacd
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions devenv/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ def main(context: dict[str, str]) -> int:

USE_NEW_DEVSERVICES = os.environ.get("USE_NEW_DEVSERVICES") == "1"

if constants.DARWIN and check_minimum_version("1.14.2"):
# `devenv update`ing to >=1.14.0 will install global colima
# so if it's there, uninstall the repo local stuff
if os.path.exists(f"{constants.root}/bin/colima"):
binroot = f"{reporoot}/.devenv/bin"
colima.uninstall(binroot)
limactl.uninstall(binroot)

from devenv.lib import node

node.install(
Expand All @@ -131,26 +139,18 @@ def main(context: dict[str, str]) -> int:
venv.ensure(venv_dir, python_version, url, sha256)

if constants.DARWIN:
if check_minimum_version("1.14.2"):
# `devenv update`ing to >=1.14.0 will install global colima
# so if it's there, uninstall the repo local stuff
if os.path.exists(f"{constants.root}/bin/colima"):
binroot = f"{reporoot}/.devenv/bin"
colima.uninstall(binroot)
limactl.uninstall(binroot)
else:
colima.install(
repo_config["colima"]["version"],
repo_config["colima"][constants.SYSTEM_MACHINE],
repo_config["colima"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)
limactl.install(
repo_config["lima"]["version"],
repo_config["lima"][constants.SYSTEM_MACHINE],
repo_config["lima"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)
colima.install(
repo_config["colima"]["version"],
repo_config["colima"][constants.SYSTEM_MACHINE],
repo_config["colima"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)
limactl.install(
repo_config["lima"]["version"],
repo_config["lima"][constants.SYSTEM_MACHINE],
repo_config["lima"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)

if not run_procs(
repo,
Expand Down

0 comments on commit 8aefacd

Please sign in to comment.