From e6e7eb104fec9a7d1acfca8f77d15cfea6ae6836 Mon Sep 17 00:00:00 2001 From: Riccardo Porreca Date: Sun, 9 Jul 2023 13:41:08 +0200 Subject: [PATCH] Include file name ("fn") in fake environment JSON files Should fix #452 with mamba>=1.4.6 --- conda_lock/conda_solver.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/conda_lock/conda_solver.py b/conda_lock/conda_solver.py index be65c888e..7a7fa8090 100644 --- a/conda_lock/conda_solver.py +++ b/conda_lock/conda_solver.py @@ -561,6 +561,7 @@ def fake_conda_environment( channel = urlunsplit( (url.scheme, url.hostname, str(path.parent), None, None) ) + file_name = path.name while path.suffix in {".tar", ".bz2", ".gz", ".conda"}: path = path.with_suffix("") build = path.name.split("-")[-1] @@ -577,6 +578,7 @@ def fake_conda_environment( "build_number": build_number, "version": dep.version, "subdir": path.parent.name, + "fn": file_name, "depends": [f"{k} {v}".strip() for k, v in dep.dependencies.items()], } # mamba requires these to be stringlike so null are not allowed here