From 0b78bd33bfec03a5bc58885f3ba8898344b79760 Mon Sep 17 00:00:00 2001 From: Eli Kogan-Wang Date: Thu, 20 Jun 2024 02:37:22 +0200 Subject: [PATCH] update appenv --- appenv.py | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/appenv.py b/appenv.py index d963cbd3..27887b3a 100755 --- a/appenv.py +++ b/appenv.py @@ -148,6 +148,10 @@ def ensure_venv(target): python(target, ["-m", "ensurepip", "--default-pip"]) pip(target, ["install", "--upgrade", "pip"]) + # backwards compatibilty: install setuptools if python >= 3.12 + if sys.version_info >= (3, 12): + pip(target, ["install", "--upgrade", "setuptools"]) + def ensure_minimal_python(): current_python = os.path.realpath(sys.executable) @@ -562,19 +566,7 @@ def update_lockfile(self, args=None, remaining=None): pip(tmpdir, ["install", "-r", "requirements.txt"]) extra_specs = [] - result = pip(tmpdir, ["freeze", "--all", "--exclude", "pip"]).decode( - "utf-8" - ) - # See https://pip.pypa.io/en/stable/cli/pip_freeze/ - # --all - # Do not skip these packages in the output: - # setuptools, wheel, distribute, pip - # --exclude - # Exclude specified package from the output. - # We need to include setuptools, since we do a --no-deps install - # of the requirements.lock file. - # We are already installing pip in ensure_venv, so we don't need it - # in the requirements.lock file. + result = pip(tmpdir, ["freeze"], merge_stderr=False).decode("ascii") pinned_versions = {} for line in result.splitlines(): if line.strip().startswith("-e "):