Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freeze all packages regardless of version #55

Merged
merged 4 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions src/appenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,12 +516,6 @@ def reset(self, args=None, remaining=None):

def update_lockfile(self, args=None, remaining=None):
ensure_minimal_python()
preferences = parse_preferences()
python312_mixed_setuptools_workaround = False
if preferences is not None:
if any(f'3.{x}' in preferences for x in range(4, 12)):
if any(f'3.{x}' in preferences for x in range(12, 20)):
python312_mixed_setuptools_workaround = True
os.chdir(self.base)
print("Updating lockfile")
tmpdir = os.path.join(self.appenv_dir, "updatelock")
Expand All @@ -532,11 +526,9 @@ def update_lockfile(self, args=None, remaining=None):
pip(tmpdir, ["install", "-r", "requirements.txt"])

extra_specs = []
pip_freeze_args = ["freeze"]
if python312_mixed_setuptools_workaround:
pip_freeze_args.extend(["--all", "--exclude", "pip"])
result = pip(
tmpdir, pip_freeze_args, merge_stderr=False).decode('ascii')
tmpdir, ["freeze", "--all", "--exclude", "pip"],
merge_stderr=False).decode('ascii')
# They changed this behaviour in https://github.com/pypa/pip/pull/12032
pinned_versions = {}
for line in result.splitlines():
Expand Down
5 changes: 2 additions & 3 deletions tests/test_update_lockfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,9 @@ def test_init_and_create_lockfile(workdir, monkeypatch):
assert os.path.exists(lockfile)
with open(lockfile) as f:
lockfile_content = f.read()
assert (lockfile_content == """\
assert """\
# appenv-requirements-hash: ffa75c00de4879b41008d0e9f6b9953cf7d65bb5f5b85d1d049e783b2486614d
ducker==2.0.1
""") # noqa
ducker==2.0.1""" in lockfile_content # noqa


@pytest.mark.skipif(
Expand Down
Loading