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

Function shortcuts_flags

constructor/utils.py:274–289  ·  view source on GitHub ↗
(info)

Source from the content-addressed store, hash-verified

272
273
274def shortcuts_flags(info) -> str:
275 menu_packages = info.get("menu_packages")
276 if menu_packages is None:
277 # not set: we create all shortcuts (default behaviour)
278 return ""
279 if menu_packages:
280 if info.get("_conda_exe_type") == StandaloneExe.MAMBA:
281 logger.warning(
282 "Micromamba does not support '--shortcuts-only'. Will install all shortcuts."
283 )
284 return ""
285 # set and populated: we only create shortcuts for some
286 # NOTE: This syntax requires conda 23.11 or above
287 return " ".join([f"--shortcuts-only={pkg.strip()}" for pkg in menu_packages])
288 # set but empty: disable all shortcuts
289 return "--no-shortcuts"
290
291
292def approx_size_kb(info, which="pkgs"):

Callers 6

setup_envs_commandsFunction · 0.85
write_shortcuts_txtFunction · 0.85
get_headerFunction · 0.85
move_scriptFunction · 0.85
_setup_envs_commandsFunction · 0.85
render_templatesMethod · 0.85

Calls 1

getMethod · 0.80

Tested by

no test coverage detected