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

Function _main

constructor/fcp.py:414–531  ·  view source on GitHub ↗
(
    name,
    version,
    download_dir,
    platform,
    channel_urls=(),
    channels_remap=(),
    specs=(),
    exclude=(),
    menu_packages=None,
    ignore_duplicate_files=True,
    environment=None,
    environment_file=None,
    verbose=True,
    dry_run=False,
    conda_exe="conda.exe",
    transmute_file_type="",
    extra_envs=None,
    check_path_spaces=True,
    input_dir="",
    base_needs_python=True,
)

Source from the content-addressed store, hash-verified

412
413
414def _main(
415 name,
416 version,
417 download_dir,
418 platform,
419 channel_urls=(),
420 channels_remap=(),
421 specs=(),
422 exclude=(),
423 menu_packages=None,
424 ignore_duplicate_files=True,
425 environment=None,
426 environment_file=None,
427 verbose=True,
428 dry_run=False,
429 conda_exe="conda.exe",
430 transmute_file_type="",
431 extra_envs=None,
432 check_path_spaces=True,
433 input_dir="",
434 base_needs_python=True,
435):
436 precs = _solve_precs(
437 name,
438 version,
439 download_dir,
440 platform,
441 channel_urls=channel_urls,
442 channels_remap=channels_remap,
443 specs=specs,
444 exclude=exclude,
445 menu_packages=menu_packages,
446 environment=environment,
447 environment_file=environment_file,
448 verbose=verbose,
449 conda_exe=conda_exe,
450 input_dir=input_dir,
451 base_needs_python=base_needs_python,
452 )
453 extra_envs = extra_envs or {}
454 conda_in_base: PackageCacheRecord = next((prec for prec in precs if prec.name == "conda"), None)
455 if conda_in_base:
456 if not check_path_spaces and platform.startswith(("linux-", "osx-")):
457 raise RuntimeError(
458 "'check_path_spaces=False' cannot be used on Linux and macOS installers "
459 "if 'conda' is present in the 'base' environment."
460 )
461 elif extra_envs:
462 raise RuntimeError(
463 "conda needs to be present in 'base' environment for 'extra_envs' to work"
464 )
465
466 extra_envs_precs = {}
467 for env_name, env_config in extra_envs.items():
468 logger.debug("Solving extra environment: %s", env_name)
469 extra_envs_precs[env_name] = _solve_precs(
470 f"{name}/envs/{env_name}",
471 version,

Callers 1

mainFunction · 0.85

Calls 4

_solve_precsFunction · 0.85
_fetch_precsFunction · 0.85
check_duplicates_filesFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected