Skip to content

Commit

Permalink
update appenv
Browse files Browse the repository at this point in the history
  • Loading branch information
elikoga committed Jun 20, 2024
1 parent f715a70 commit 0b78bd3
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions appenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 <package>
# 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 "):
Expand Down

0 comments on commit 0b78bd3

Please sign in to comment.