diff --git a/src/appenv.py b/src/appenv.py index 58974ef..bce7837 100755 --- a/src/appenv.py +++ b/src/appenv.py @@ -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") @@ -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(): diff --git a/tests/test_update_lockfile.py b/tests/test_update_lockfile.py index 9ea38a8..c618f4f 100644 --- a/tests/test_update_lockfile.py +++ b/tests/test_update_lockfile.py @@ -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(