MCPcopy Create free account
hub / github.com/conda/constructor / ensure_transmuted_ext

Function ensure_transmuted_ext

constructor/utils.py:178–193  ·  view source on GitHub ↗

If transmuting, micromamba won't find the dist in the preconda tarball unless it has the (correct and transmuted) extension. Otherwise, the command `micromamba constructor --extract-tarballs` fails. Unfortunately this means the `urls` file might end up containing fake URLs, sinc

(info, url)

Source from the content-addressed store, hash-verified

176
177
178def ensure_transmuted_ext(info, url):
179 """
180 If transmuting, micromamba won't find the dist in the preconda tarball
181 unless it has the (correct and transmuted) extension. Otherwise, the command
182 `micromamba constructor --extract-tarballs` fails.
183 Unfortunately this means the `urls` file might end up containing
184 fake URLs, since those .conda archives might not really exist online,
185 and they were only created locally.
186 """
187 if (
188 info.get("transmute_file_type") == ".conda"
189 and info.get("_conda_exe_type") == StandaloneExe.MAMBA
190 ):
191 if url.lower().endswith(".tar.bz2"):
192 url = url[:-8] + ".conda"
193 return url
194
195
196def get_final_url(info, url):

Callers 2

write_filesFunction · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected