mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.78k stars 348 forks source link

`test_explicit_export_topologically_sorted[random_string-True]` fails #3376

Closed jjerphan closed 1 month ago

jjerphan commented 1 month ago

https://github.com/conda-forge/pip-feedstock/pull/121 released pip 24.1.2 a few hours ago:

diff --git 1/before 2/after
index 12c27c0..e041a48 100644
--- 1/before
+++ 2/after
@@ -111,7 +111,7 @@ openssl                               3.3.1         h4bc722e_2          conda-fo
 packaging                             24.1          pyhd8ed1ab_0        conda-forge
 passlib                               1.7.4         pyhd8ed1ab_1        conda-forge
 pep517                                0.13.0        pyhd8ed1ab_0        conda-forge
-pip                                   24.0          pyhd8ed1ab_0        conda-forge
+pip                                   24.1.2        pyhd8ed1ab_0        conda-forge
 pkg-config                            0.29.2        h4bc722e_1009       conda-forge
 platformdirs                          4.2.2         pyhd8ed1ab_0        conda-forge
 pluggy                                1.5.0         pyhd8ed1ab_0        conda-forge

since then, one test for topological sort fails:


=================================== FAILURES ===================================
________ test_explicit_export_topologically_sorted[random_string-True] _________

tmp_home = PosixPath('/tmp/pytest-of-runner/pytest-0/home0')
tmp_prefix = PosixPath('/tmp/pytest-of-runner/pytest-0/mamba0/envs/JYE54UB9P4')

    @pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
    def test_explicit_export_topologically_sorted(tmp_home, tmp_prefix):
        """Explicit export must have dependencies before dependent packages."""
        helpers.install("python=3.10", "pip", "jupyterlab")
        lines = helpers.run_env("export", "--explicit").splitlines()

        indices = {
            "libzlib": 0,
            "python": 0,
            "wheel": 0,
            "pip": 0,
            "jupyterlab": 0,
        }
        for i, line in enumerate(lines):
            for pkg in indices.keys():
                if pkg in line:
                    indices[pkg] = i

        assert indices["libzlib"] < indices["python"]
>       assert indices["python"] < indices["wheel"]
E       assert 122 < 0

First observed in https://github.com/mamba-org/mamba/pull/3375.

jjerphan commented 1 month ago

Based on 66b4ac4's runs, the failure seems unrelated to the latest release of pip.

jjerphan commented 1 month ago

I can reproduce the issue up to bdae0a14056a7280dcd5eb2b21cc8e880f78347d with pip 23.3.2. I stopped at this commit, and I have not continued, I suspect the error originates from something else (I would have been reported earlier if it was due to a regression in a previous commit, I think).