├── .clang-format ├── .cmake-format.json ├── .flake8 ├── .git-blame-ignore-revs ├── .github ├── ISSUE_TEMPLATE │ └── bug.yml ├── PULL_REQUEST_TEMPLATE │ └── pull_request_template.md ├── actions │ └── workspace │ │ └── action.yml ├── dependabot.yml └── workflows │ ├── bot_issue_template.md │ ├── brew.yml │ ├── coverage.yml │ ├── label_check.yml │ ├── linters.yml │ ├── set_pr_label.yml │ ├── static_build.yml │ ├── tests.yml │ ├── unix_impl.yml │ └── windows_impl.yml ├── .gitignore ├── .isort.cfg ├── .markdownlint.yaml ├── .pre-commit-config.yaml ├── .readthedocs.yml ├── CHANGELOG.md ├── CITATION.cff ├── CMakeLists.txt ├── CMakePresets.json ├── CONTRIBUTING.rst ├── LICENSE ├── README.md ├── SECURITY.md ├── _typos.toml ├── cmake ├── Checks.cmake ├── CompilerWarnings.cmake ├── LinkTimeOptimization.cmake └── modules │ └── FindLibsolv.cmake ├── codecov.yml ├── compare_stubs.py ├── dev ├── CMakePresetsMamba.json ├── CMakePresetsUnix.json ├── environment-dev-extra.yml ├── environment-dev.yml └── environment-micromamba-static.yml ├── docs ├── Doxyfile ├── Makefile ├── assets │ └── mamba_header.png ├── environment.yml ├── make.bat └── source │ ├── _static │ └── logo.png │ ├── advanced_usage │ ├── artifacts_verification.rst │ ├── detailed_operations.rst │ ├── hard_links.png │ ├── more_concepts.rst │ └── package_resolution.rst │ ├── api │ ├── solver.rst │ └── specs.rst │ ├── conf.py │ ├── developer_zone │ ├── changes-2.0.rst │ ├── contributing.rst │ ├── dev_environment.rst │ ├── internals.rst │ └── whatprovides.svg │ ├── index.rst │ ├── installation │ ├── mamba-installation.rst │ └── micromamba-installation.rst │ ├── tools │ ├── mermaid.css │ ├── mermaid.py │ └── mermaid_inheritance.py │ ├── usage │ ├── solver.rst │ └── specs.rst │ └── user_guide │ ├── concepts.rst │ ├── config_rc_srcs.svg │ ├── config_srcs.svg │ ├── configuration.rst │ ├── mamba.rst │ ├── micromamba.rst │ ├── prefix.png │ └── troubleshooting.rst ├── libmamba ├── CHANGELOG.md ├── CMakeLists.txt ├── LICENSE ├── data │ ├── Mamba.psm1 │ ├── _mamba_activate.bat │ ├── activate.bat │ ├── bin2header.py │ ├── compile_pyc.py │ ├── conda_exe.hpp │ ├── mamba.bat │ ├── mamba.csh │ ├── mamba.fish │ ├── mamba.sh │ ├── mamba.xsh │ ├── mamba_completion.posix │ ├── mamba_hook.bat │ └── mamba_hook.ps1 ├── ext │ └── solv-cpp │ │ ├── CMakeLists.txt │ │ ├── include │ │ └── solv-cpp │ │ │ ├── dependency.hpp │ │ │ ├── ids.hpp │ │ │ ├── pool.hpp │ │ │ ├── queue.hpp │ │ │ ├── repo.hpp │ │ │ ├── solvable.hpp │ │ │ ├── solver.hpp │ │ │ └── transaction.hpp │ │ ├── src │ │ ├── dependency.cpp │ │ ├── pool.cpp │ │ ├── queue.cpp │ │ ├── repo.cpp │ │ ├── solvable.cpp │ │ ├── solver.cpp │ │ └── transaction.cpp │ │ └── tests │ │ ├── CMakeLists.txt │ │ └── src │ │ ├── main.cpp │ │ ├── msvc_catch_string_view.cpp │ │ ├── pool_data.cpp │ │ ├── pool_data.hpp │ │ ├── test_pool.cpp │ │ ├── test_queue.cpp │ │ ├── test_repo.cpp │ │ ├── test_scenarios.cpp │ │ ├── test_solvable.cpp │ │ ├── test_solver.cpp │ │ └── test_transaction.cpp ├── include │ └── mamba │ │ ├── api │ │ ├── c_api.h │ │ ├── channel_loader.hpp │ │ ├── clean.hpp │ │ ├── config.hpp │ │ ├── configuration.hpp │ │ ├── configuration_impl.hpp │ │ ├── constants.hpp │ │ ├── create.hpp │ │ ├── env.hpp │ │ ├── info.hpp │ │ ├── install.hpp │ │ ├── list.hpp │ │ ├── remove.hpp │ │ ├── repoquery.hpp │ │ ├── shell.hpp │ │ └── update.hpp │ │ ├── core │ │ ├── activation.hpp │ │ ├── channel_context.hpp │ │ ├── common_types.hpp │ │ ├── context.hpp │ │ ├── context_params.hpp │ │ ├── download_progress_bar.hpp │ │ ├── env_lockfile.hpp │ │ ├── environments_manager.hpp │ │ ├── error_handling.hpp │ │ ├── execution.hpp │ │ ├── fsutil.hpp │ │ ├── history.hpp │ │ ├── invoke.hpp │ │ ├── menuinst.hpp │ │ ├── output.hpp │ │ ├── package_cache.hpp │ │ ├── package_database_loader.hpp │ │ ├── package_fetcher.hpp │ │ ├── package_handling.hpp │ │ ├── package_paths.hpp │ │ ├── palette.hpp │ │ ├── pinning.hpp │ │ ├── prefix_data.hpp │ │ ├── progress_bar.hpp │ │ ├── query.hpp │ │ ├── repo_checker_store.hpp │ │ ├── run.hpp │ │ ├── shell_init.hpp │ │ ├── subdir_index.hpp │ │ ├── subdir_parameters.hpp │ │ ├── tasksync.hpp │ │ ├── thread_utils.hpp │ │ ├── timeref.hpp │ │ ├── transaction.hpp │ │ ├── util.hpp │ │ ├── util_os.hpp │ │ ├── util_scope.hpp │ │ └── virtual_packages.hpp │ │ ├── download │ │ ├── downloader.hpp │ │ ├── mirror.hpp │ │ ├── mirror_map.hpp │ │ ├── parameters.hpp │ │ └── request.hpp │ │ ├── fs │ │ └── filesystem.hpp │ │ ├── solver │ │ ├── libsolv │ │ │ ├── database.hpp │ │ │ ├── parameters.hpp │ │ │ ├── repo_info.hpp │ │ │ ├── solver.hpp │ │ │ └── unsolvable.hpp │ │ ├── problems_graph.hpp │ │ ├── request.hpp │ │ └── solution.hpp │ │ ├── specs │ │ ├── archive.hpp │ │ ├── authentication_info.hpp │ │ ├── build_number_spec.hpp │ │ ├── channel.hpp │ │ ├── chimera_string_spec.hpp │ │ ├── conda_url.hpp │ │ ├── error.hpp │ │ ├── glob_spec.hpp │ │ ├── match_spec.hpp │ │ ├── package_info.hpp │ │ ├── platform.hpp │ │ ├── regex_spec.hpp │ │ ├── repo_data.hpp │ │ ├── unresolved_channel.hpp │ │ ├── version.hpp │ │ └── version_spec.hpp │ │ ├── util │ │ ├── build.hpp │ │ ├── cast.hpp │ │ ├── cfile.hpp │ │ ├── charconv.hpp │ │ ├── compare.hpp │ │ ├── conditional.hpp │ │ ├── cryptography.hpp │ │ ├── deprecation.hpp │ │ ├── encoding.hpp │ │ ├── environment.hpp │ │ ├── flat_binary_tree.hpp │ │ ├── flat_bool_expr_tree.hpp │ │ ├── flat_set.hpp │ │ ├── functional.hpp │ │ ├── graph.hpp │ │ ├── heap_optional.hpp │ │ ├── iterator.hpp │ │ ├── json.hpp │ │ ├── loop_control.hpp │ │ ├── os.hpp │ │ ├── os_linux.hpp │ │ ├── os_osx.hpp │ │ ├── os_unix.hpp │ │ ├── os_win.hpp │ │ ├── parsers.hpp │ │ ├── path_manip.hpp │ │ ├── random.hpp │ │ ├── string.hpp │ │ ├── tuple_hash.hpp │ │ ├── type_traits.hpp │ │ ├── url.hpp │ │ ├── url_manip.hpp │ │ ├── variant_cmp.hpp │ │ └── weakening_map.hpp │ │ ├── validation │ │ ├── errors.hpp │ │ ├── keys.hpp │ │ ├── repo_checker.hpp │ │ ├── tools.hpp │ │ ├── update_framework.hpp │ │ ├── update_framework_v0_6.hpp │ │ └── update_framework_v1.hpp │ │ ├── version.hpp │ │ └── version.hpp.tmpl ├── libmambaConfig.cmake.in ├── longpath.manifest ├── src │ ├── api │ │ ├── c_api.cpp │ │ ├── channel_loader.cpp │ │ ├── clean.cpp │ │ ├── config.cpp │ │ ├── configuration.cpp │ │ ├── create.cpp │ │ ├── env.cpp │ │ ├── info.cpp │ │ ├── install.cpp │ │ ├── list.cpp │ │ ├── remove.cpp │ │ ├── repoquery.cpp │ │ ├── shell.cpp │ │ ├── update.cpp │ │ ├── utils.cpp │ │ └── utils.hpp │ ├── core │ │ ├── activation.cpp │ │ ├── channel_context.cpp │ │ ├── context.cpp │ │ ├── download_progress_bar.cpp │ │ ├── env_lockfile.cpp │ │ ├── environments_manager.cpp │ │ ├── error_handling.cpp │ │ ├── execution.cpp │ │ ├── fsutil.cpp │ │ ├── history.cpp │ │ ├── link.cpp │ │ ├── link.hpp │ │ ├── menuinst.cpp │ │ ├── output.cpp │ │ ├── package_cache.cpp │ │ ├── package_database_loader.cpp │ │ ├── package_fetcher.cpp │ │ ├── package_handling.cpp │ │ ├── package_paths.cpp │ │ ├── pinning.cpp │ │ ├── prefix_data.cpp │ │ ├── progress_bar.cpp │ │ ├── progress_bar_impl.cpp │ │ ├── progress_bar_impl.hpp │ │ ├── query.cpp │ │ ├── repo_checker_store.cpp │ │ ├── run.cpp │ │ ├── shell_init.cpp │ │ ├── singletons.cpp │ │ ├── subdir_index.cpp │ │ ├── thread_utils.cpp │ │ ├── timeref.cpp │ │ ├── transaction.cpp │ │ ├── transaction_context.cpp │ │ ├── transaction_context.hpp │ │ ├── util.cpp │ │ ├── util_os.cpp │ │ └── virtual_packages.cpp │ ├── download │ │ ├── compression.cpp │ │ ├── compression.hpp │ │ ├── curl.cpp │ │ ├── curl.hpp │ │ ├── downloader.cpp │ │ ├── downloader_impl.hpp │ │ ├── mirror.cpp │ │ ├── mirror_impl.cpp │ │ ├── mirror_impl.hpp │ │ ├── mirror_map.cpp │ │ └── request.cpp │ ├── fs │ │ └── filesystem.cpp │ ├── solver │ │ ├── helpers.cpp │ │ ├── helpers.hpp │ │ ├── libsolv │ │ │ ├── database.cpp │ │ │ ├── helpers.cpp │ │ │ ├── helpers.hpp │ │ │ ├── matcher.cpp │ │ │ ├── matcher.hpp │ │ │ ├── parameters.cpp │ │ │ ├── repo_info.cpp │ │ │ ├── solver.cpp │ │ │ └── unsolvable.cpp │ │ └── problems_graph.cpp │ ├── specs │ │ ├── archive.cpp │ │ ├── authentication_info.cpp │ │ ├── build_number_spec.cpp │ │ ├── channel.cpp │ │ ├── chimera_string_spec.cpp │ │ ├── conda_url.cpp │ │ ├── glob_spec.cpp │ │ ├── match_spec.cpp │ │ ├── package_info.cpp │ │ ├── platform.cpp │ │ ├── regex_spec.cpp │ │ ├── repo_data.cpp │ │ ├── unresolved_channel.cpp │ │ ├── version.cpp │ │ ├── version_spec.cpp │ │ └── version_spec_impl.hpp │ ├── util │ │ ├── cfile.cpp │ │ ├── cryptography.cpp │ │ ├── encoding.cpp │ │ ├── environment.cpp │ │ ├── os_linux.cpp │ │ ├── os_osx.cpp │ │ ├── os_unix.cpp │ │ ├── os_win.cpp │ │ ├── parsers.cpp │ │ ├── path_manip.cpp │ │ ├── random.cpp │ │ ├── string.cpp │ │ ├── url.cpp │ │ └── url_manip.cpp │ ├── validation │ │ ├── errors.cpp │ │ ├── keys.cpp │ │ ├── repo_checker.cpp │ │ ├── tools.cpp │ │ ├── update_framework.cpp │ │ ├── update_framework_v0_6.cpp │ │ └── update_framework_v1.cpp │ └── version.cpp └── tests │ ├── CMakeLists.txt │ ├── data │ ├── config │ │ └── .condarc │ ├── env_file │ │ ├── env_1.yaml │ │ ├── env_2.yaml │ │ ├── env_3.yaml │ │ └── env_4.yaml │ ├── env_lockfile │ │ ├── bad_package-lock.yaml │ │ ├── bad_version-lock.yaml │ │ ├── good_multiple_categories-lock.yaml │ │ ├── good_multiple_packages-lock.yaml │ │ ├── good_no_package-lock.yaml │ │ ├── good_one_package-lock.yaml │ │ └── good_one_package_missing_category-lock.yaml │ ├── history │ │ ├── parse │ │ │ └── conda-meta │ │ │ │ ├── aux_file │ │ │ │ └── history │ │ ├── parse_metadata │ │ │ └── conda-meta │ │ │ │ └── history │ │ └── parse_segfault │ │ │ └── conda-meta │ │ │ └── history │ ├── repodata │ │ ├── conda-forge-numpy-linux-64.json │ │ ├── conda-forge-repodata-version-2-missing-base_url.json │ │ ├── conda-forge-repodata-version-2.json │ │ └── sudoku.json │ ├── repodata_json_cache │ │ ├── test_1.json │ │ ├── test_2.json │ │ ├── test_3.json │ │ ├── test_4.json │ │ ├── test_5.json │ │ ├── test_6.json │ │ ├── test_7.json │ │ └── test_7.state.json │ └── validation │ │ ├── 1.sv0.6.root.json │ │ ├── root copy.json │ │ └── root.json │ ├── include │ └── mambatests.hpp │ ├── libmamba_lock │ └── lock.cpp │ └── src │ ├── catch-utils │ ├── conda_url.hpp │ ├── msvc_catch_byte.cpp │ └── msvc_catch_string_view.cpp │ ├── core │ ├── test_activation.cpp │ ├── test_channel_context.cpp │ ├── test_configuration.cpp │ ├── test_cpp.cpp │ ├── test_env_file_reading.cpp │ ├── test_env_lockfile.cpp │ ├── test_environments_manager.cpp │ ├── test_execution.cpp │ ├── test_filesystem.cpp │ ├── test_history.cpp │ ├── test_invoke.cpp │ ├── test_lockfile.cpp │ ├── test_output.cpp │ ├── test_package_fetcher.cpp │ ├── test_pinning.cpp │ ├── test_progress_bar.cpp │ ├── test_shell_init.cpp │ ├── test_subdir_index.cpp │ ├── test_tasksync.cpp │ ├── test_thread_utils.cpp │ ├── test_transaction_context.cpp │ ├── test_util.cpp │ └── test_virtual_packages.cpp │ ├── download │ ├── test_downloader.cpp │ └── test_mirror.cpp │ ├── solver │ ├── libsolv │ │ ├── test_database.cpp │ │ └── test_solver.cpp │ ├── test_problems_graph.cpp │ ├── test_request.cpp │ └── test_solution.cpp │ ├── specs │ ├── test_archive.cpp │ ├── test_authentication_info.cpp │ ├── test_build_number_spec.cpp │ ├── test_channel.cpp │ ├── test_chimera_string_spec.cpp │ ├── test_conda_url.cpp │ ├── test_glob_spec.cpp │ ├── test_match_spec.cpp │ ├── test_package_info.cpp │ ├── test_platform.cpp │ ├── test_regex_spec.cpp │ ├── test_repo_data.cpp │ ├── test_unresolved_channel.cpp │ ├── test_version.cpp │ └── test_version_spec.cpp │ ├── test_main.cpp │ ├── util │ ├── test_cast.cpp │ ├── test_charconv.cpp │ ├── test_compare.cpp │ ├── test_cryptography.cpp │ ├── test_encoding.cpp │ ├── test_environment.cpp │ ├── test_flat_bool_expr_tree.cpp │ ├── test_flat_set.cpp │ ├── test_graph.cpp │ ├── test_heap_optional.cpp │ ├── test_iterator.cpp │ ├── test_os_linux.cpp │ ├── test_os_osx.cpp │ ├── test_os_unix.cpp │ ├── test_os_win.cpp │ ├── test_parsers.cpp │ ├── test_path_manip.cpp │ ├── test_random.cpp │ ├── test_string.cpp │ ├── test_tuple_hash.cpp │ ├── test_type_traits.cpp │ ├── test_url.cpp │ ├── test_url_manip.cpp │ └── test_weakening_map.cpp │ └── validation │ ├── test_tools.cpp │ ├── test_update_framework_v0_6.cpp │ └── test_update_framework_v1.cpp ├── libmambapy ├── .gitignore ├── CHANGELOG.md ├── CMakeLists.txt ├── LICENSE ├── MANIFEST.in ├── pyproject.toml ├── setup.py ├── src │ └── libmambapy │ │ ├── __init__.py │ │ ├── __init__.pyi │ │ ├── bindings │ │ ├── bind_utils.hpp │ │ ├── bindings.cpp │ │ ├── bindings.hpp │ │ ├── expected_caster.hpp │ │ ├── flat_set_caster.hpp │ │ ├── legacy.cpp │ │ ├── longpath.manifest │ │ ├── path_caster.hpp │ │ ├── solver.cpp │ │ ├── solver_libsolv.cpp │ │ ├── specs.cpp │ │ ├── utils.cpp │ │ └── weakening_map_bind.hpp │ │ ├── py.typed │ │ ├── solver │ │ ├── __init__.py │ │ └── libsolv.py │ │ ├── specs.py │ │ ├── utils.py │ │ ├── version.py │ │ └── version.py.tmpl └── tests │ ├── test_legacy.py │ ├── test_solver.py │ ├── test_solver_libsolv.py │ ├── test_specs.py │ ├── test_utils.py │ └── test_version.py ├── mamba_package ├── CMakeLists.txt └── src │ ├── main.cpp │ ├── package.cpp │ └── package.hpp ├── micromamba ├── CHANGELOG.md ├── CMakeLists.txt ├── LICENSE ├── etc │ └── profile.d │ │ └── mamba.sh.in ├── longpath.manifest ├── src │ ├── activate.cpp │ ├── clean.cpp │ ├── common_options.cpp │ ├── common_options.hpp │ ├── completer.cpp │ ├── config.cpp │ ├── constructor.cpp │ ├── constructor.hpp │ ├── create.cpp │ ├── env.cpp │ ├── info.cpp │ ├── install.cpp │ ├── list.cpp │ ├── login.cpp │ ├── main.cpp │ ├── package.cpp │ ├── remove.cpp │ ├── repoquery.cpp │ ├── run.cpp │ ├── shell.cpp │ ├── umamba.cpp │ ├── umamba.hpp │ ├── update.cpp │ ├── version.cpp │ ├── version.hpp │ └── version.hpp.tmpl ├── test-server │ ├── channel_a │ │ ├── linux-64 │ │ │ ├── repodata.json │ │ │ ├── repodata.tar.bz2 │ │ │ └── repodata.tpl │ │ ├── noarch │ │ │ ├── _r-mutex-1.0.1-anacondar_1.tar.bz2 │ │ │ └── repodata.json │ │ └── win-64 │ │ │ ├── repodata.json │ │ │ ├── repodata.tar.bz2 │ │ │ └── repodata.tpl │ ├── channel_b │ │ ├── linux-64 │ │ │ └── repodata.json │ │ ├── noarch │ │ │ └── repodata.json │ │ └── win-64 │ │ │ └── repodata.json │ ├── generate_gpg_keys.sh │ ├── repo │ │ ├── channeldata.json │ │ ├── index.html │ │ ├── noarch │ │ │ ├── current_repodata.json │ │ │ ├── current_repodata.json.bz2 │ │ │ ├── index.html │ │ │ ├── repodata.json │ │ │ ├── repodata.json.bz2 │ │ │ ├── repodata_from_packages.json │ │ │ ├── repodata_from_packages.json.bz2 │ │ │ └── test-package-0.1-0.tar.bz2 │ │ └── recipes │ │ │ └── test-package │ │ │ └── meta.yaml │ ├── reposerver.py │ ├── testserver.sh │ └── testserver_auth_pkg_signing.sh └── tests │ ├── __init__.py │ ├── channel_a │ ├── linux-64 │ │ ├── repodata.json │ │ ├── repodata.tar.bz2 │ │ └── repodata.tpl │ ├── noarch │ │ ├── _r-mutex-1.0.1-anacondar_1.tar.bz2 │ │ └── repodata.json │ └── win-64 │ │ ├── repodata.json │ │ ├── repodata.tar.bz2 │ │ └── repodata.tpl │ ├── channel_b │ ├── linux-64 │ │ └── repodata.json │ ├── noarch │ │ └── repodata.json │ └── win-64 │ │ └── repodata.json │ ├── conftest.py │ ├── data │ └── cph_test_data-0.0.1-0.tar.bz2 │ ├── dump_proxy_connections.py │ ├── env-create-export.yaml │ ├── env-extra-white-space.yaml │ ├── env-logging-overhead-regression.yaml │ ├── env-pypi-pkg-test.yaml │ ├── env-requires-pip-install-with-spaces.yaml │ ├── env-requires-pip-install.yaml │ ├── envlockfile-check-step-1-lock.yaml │ ├── envlockfile-check-step-2-lock.yaml │ ├── explicit_env_linux.txt │ ├── explicit_env_osx.txt │ ├── helpers.py │ ├── pre_commit_conda_hooks_repo │ ├── .pre-commit-hooks.yaml │ ├── README.md │ └── environment.yml │ ├── spec_file_1.txt │ ├── spec_file_2.txt │ ├── test-env-lock-pip-git-https.yaml │ ├── test-env-lock.yaml │ ├── test-env-pip-lock.yaml │ ├── test-server │ ├── channel_a │ │ ├── linux-64 │ │ │ ├── repodata.json │ │ │ ├── repodata.tar.bz2 │ │ │ └── repodata.tpl │ │ ├── noarch │ │ │ ├── _r-mutex-1.0.1-anacondar_1.tar.bz2 │ │ │ └── repodata.json │ │ └── win-64 │ │ │ ├── repodata.json │ │ │ ├── repodata.tar.bz2 │ │ │ └── repodata.tpl │ ├── channel_b │ │ ├── linux-64 │ │ │ └── repodata.json │ │ ├── noarch │ │ │ └── repodata.json │ │ └── win-64 │ │ │ └── repodata.json │ ├── repo │ │ ├── channeldata.json │ │ ├── index.html │ │ ├── noarch │ │ │ ├── current_repodata.json │ │ │ ├── current_repodata.json.bz2 │ │ │ ├── index.html │ │ │ ├── repodata.json │ │ │ ├── repodata.json.bz2 │ │ │ ├── repodata_from_packages.json │ │ │ ├── repodata_from_packages.json.bz2 │ │ │ └── test-package-0.1-0.tar.bz2 │ │ └── recipes │ │ │ └── test-package │ │ │ └── meta.yaml │ └── reposerver.py │ ├── test_activation.py │ ├── test_config.py │ ├── test_constructor.py │ ├── test_create.py │ ├── test_env.py │ ├── test_history.py │ ├── test_info.py │ ├── test_install.py │ ├── test_linking.py │ ├── test_list.py │ ├── test_login.py │ ├── test_menuinst.py │ ├── test_package.py │ ├── test_pkg_cache.py │ ├── test_proxy.py │ ├── test_remove.py │ ├── test_repoquery.py │ ├── test_run.py │ ├── test_run.sh │ ├── test_shell.py │ ├── test_update.py │ ├── test_virtual_pkgs.py │ └── yaml_env.yml ├── pyproject.toml ├── releaser.py ├── update_changelog.py ├── vcpkg.json └── version_scheme.py /.cmake-format.json: -------------------------------------------------------------------------------- 1 | { 2 | "encode": { 3 | "emit_byteorder_mark": false, 4 | "input_encoding": "utf-8", 5 | "output_encoding": "utf-8" 6 | }, 7 | "format": { 8 | "always_wrap": [], 9 | "autosort": false, 10 | "command_case": "lower", 11 | "dangle_align": "prefix", 12 | "dangle_parens": true, 13 | "enable_sort": true, 14 | "keyword_case": "upper", 15 | "layout_passes": {}, 16 | "line_ending": "unix", 17 | "line_width": 100, 18 | "max_lines_hwrap": 0, 19 | "max_pargs_hwrap": 6, 20 | "max_prefix_chars": 0, 21 | "max_rows_cmdline": 1, 22 | "max_subgroups_hwrap": 2, 23 | "min_prefix_chars": 0, 24 | "require_valid_layout": false, 25 | "separate_ctrl_name_with_space": false, 26 | "separate_fn_name_with_space": false, 27 | "tab_size": 4 28 | }, 29 | "misc": { 30 | "per_command": {} 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length=100 3 | extend-ignore=E203,D104,D100,I004 4 | exclude=*/tests/*,docs/source/tools/* 5 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Description 2 | 3 | 4 | 5 | ## Type of Change 6 | 7 | 8 | 9 | - [ ] Bugfix 10 | - [ ] Feature / enhancement 11 | - [ ] CI / Documentation 12 | - [ ] Maintenance 13 | 14 | ## Checklist 15 | 16 | - [ ] My code follows the general style and conventions of the codebase, ensuring consistency 17 | - [ ] I have performed a self-review of my code 18 | - [ ] I have commented my code, particularly in hard-to-understand areas 19 | - [ ] My changes generate no new warnings 20 | - [ ] I have run `pre-commit run --all` locally in the source folder and confirmed that there are no linter errors. 21 | - [ ] I have added tests that prove my fix is effective or that my feature works 22 | - [ ] New and existing tests pass locally with my changes 23 | -------------------------------------------------------------------------------- /.github/actions/workspace/action.yml: -------------------------------------------------------------------------------- 1 | name: workspace 2 | description: "A action to persist your workspace across different jobs" 3 | branding: 4 | icon: "box" 5 | color: "green" 6 | inputs: 7 | action: 8 | required: true 9 | options: 10 | - save 11 | - restore 12 | - delete 13 | path: 14 | required: true 15 | key_prefix: 16 | default: workspace 17 | key_base: 18 | required: true 19 | default: ${{ github.workflow }}-${{ github.run_id }}-${{ github.run_number }}-${{ github.sha }} 20 | key_suffix: 21 | default: "" 22 | token: 23 | required: false 24 | default: ${{ github.token }} 25 | 26 | runs: 27 | using: "composite" 28 | steps: 29 | - name: Create workspace 30 | if: ${{ inputs.action == 'save' }} 31 | uses: actions/cache/save@v4 32 | with: 33 | path: ${{ inputs.path }} 34 | key: ${{ inputs.key_prefix }}-${{ inputs.key_base }}-${{ inputs.key_suffix }} 35 | - name: Restore workspace 36 | if: ${{ inputs.action == 'restore' }} 37 | uses: actions/cache/restore@v4 38 | with: 39 | path: ${{ inputs.path }} 40 | key: ${{ inputs.key_prefix }}-${{ inputs.key_base }}-${{ inputs.key_suffix }} 41 | fail-on-cache-miss: true 42 | - name: Delete workspace 43 | if: ${{ inputs.action == 'delete' }} 44 | shell: bash 45 | env: 46 | GH_TOKEN: ${{ inputs.token }} 47 | run: | 48 | gh cache delete '${{ inputs.key_prefix }}-${{ inputs.key_base }}-${{ inputs.key_suffix }}' 49 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: github-actions 9 | directory: / 10 | schedule: 11 | interval: weekly 12 | - package-ecosystem: github-actions 13 | directory: .github/actions/workspace/ 14 | schedule: 15 | interval: weekly 16 | -------------------------------------------------------------------------------- /.github/workflows/bot_issue_template.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Bot failure 3 | --- 4 | 5 | There was a problem with the **{{ workflow }}** workflow, please investigate. 6 | -------------------------------------------------------------------------------- /.github/workflows/brew.yml: -------------------------------------------------------------------------------- 1 | name: Homebrew and Linuxbrew toolchains 2 | 3 | on: 4 | workflow_call: 5 | 6 | jobs: 7 | build_linuxbrew: 8 | name: Build on linuxbrew 9 | runs-on: ubuntu-latest 10 | container: 11 | image: homebrew/brew:latest 12 | 13 | steps: 14 | # v1 required due to permissions error 15 | - name: Checkout mamba repository 16 | uses: actions/checkout@v1 17 | 18 | - name: Correct the creation permissions 19 | run: sudo chown -R linuxbrew . 20 | 21 | - name: Install host and build dependencies 22 | run: brew install fmt libarchive libsolv lz4 openssl@3 reproc simdjson xz yaml-cpp zstd cmake cli11 nlohmann-json spdlog tl-expected curl pkgconfig python bzip2 krb5 zlib 23 | 24 | - name: Configure to build mamba 25 | run: cmake -S. -Bbuild -DBUILD_LIBMAMBA=ON -DBUILD_MAMBA=ON -DBUILD_SHARED=ON -DBUILD_STATIC=OFF 26 | 27 | - name: Build mamba 28 | run: cmake --build build -j4 29 | 30 | build_homebrew: 31 | name: Build on homebrew 32 | runs-on: macos-13 33 | 34 | steps: 35 | - name: Checkout mamba repository 36 | uses: actions/checkout@v4 37 | 38 | - name: Install host and build dependencies 39 | run: brew install fmt libarchive libsolv lz4 openssl@3 reproc simdjson xz yaml-cpp zstd cmake cli11 nlohmann-json spdlog tl-expected pkgconfig python 40 | 41 | - name: Configure to build mamba 42 | run: > 43 | cmake -S. -Bbuild -DBUILD_LIBMAMBA=ON -DBUILD_MAMBA=ON -DBUILD_SHARED=ON -DBUILD_STATIC=OFF 44 | -DLibArchive_ROOT=$(brew --prefix libarchive) 45 | 46 | - name: Build mamba 47 | run: cmake --build build -j4 48 | -------------------------------------------------------------------------------- /.github/workflows/label_check.yml: -------------------------------------------------------------------------------- 1 | name: Check release label 2 | 3 | on: 4 | pull_request: 5 | types: 6 | - synchronize 7 | - opened 8 | - reopened 9 | - labeled 10 | - unlabeled 11 | 12 | jobs: 13 | label_check: 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Checkout code 17 | uses: actions/checkout@v4 18 | 19 | - name: Check labels 20 | run: | 21 | NUMBER_OF_LABELS=$(jq '.pull_request.labels | length' "$GITHUB_EVENT_PATH") 22 | if [ $NUMBER_OF_LABELS -eq 0 ]; then 23 | echo "PR has no labels. Please add at least one label of release type." 24 | exit 1 25 | fi 26 | 27 | RELEASE_LABELS=("release::enhancements" "release::bug_fixes" "release::ci_docs" "release::maintenance") 28 | PR_LABELS=$(jq -r '.pull_request.labels[].name' "$GITHUB_EVENT_PATH") 29 | NB_RELEASE_LABELS=0 30 | 31 | for LABEL in $PR_LABELS; do 32 | if [[ " ${RELEASE_LABELS[@]} " =~ " ${LABEL} " ]]; then 33 | NB_RELEASE_LABELS=$((NB_RELEASE_LABELS+1)) 34 | fi 35 | done 36 | 37 | if [ $NB_RELEASE_LABELS -eq 0 ]; then 38 | echo "PR has no release labels. Please add a label of release type." 39 | exit 1 40 | elif [ $NB_RELEASE_LABELS -gt 1 ]; then 41 | echo "PR has multiple release labels. Please remove all but one label." 42 | exit 1 43 | fi 44 | -------------------------------------------------------------------------------- /.github/workflows/linters.yml: -------------------------------------------------------------------------------- 1 | name: Linters 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - feat/* 8 | pull_request: 9 | branches: 10 | - main 11 | - feat/* 12 | merge_group: 13 | types: [checks_requested] 14 | 15 | concurrency: 16 | group: ${{ github.workflow }}-${{ github.ref }} 17 | cancel-in-progress: true 18 | 19 | jobs: 20 | build: 21 | runs-on: ubuntu-latest 22 | env: 23 | PRE_COMMIT_USE_MICROMAMBA: 1 24 | steps: 25 | - uses: actions/checkout@v4 26 | - name: Install pre-commit 27 | uses: mamba-org/setup-micromamba@v2 28 | with: 29 | environment-name: linters 30 | create-args: pre-commit 31 | - name: Add micromamba to GITHUB_PATH 32 | run: echo "${HOME}/micromamba-bin" >> $GITHUB_PATH 33 | - name: Run all linters 34 | shell: micromamba-shell {0} 35 | run: | 36 | pre-commit run --all-files --verbose --show-diff-on-failure 37 | -------------------------------------------------------------------------------- /.github/workflows/tests.yml: -------------------------------------------------------------------------------- 1 | name: Mamba 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | - feat/* 8 | pull_request: 9 | branches: 10 | - main 11 | - feat/* 12 | paths-ignore: 13 | - "docs/**" 14 | - "**.md" 15 | merge_group: 16 | types: [checks_requested] 17 | 18 | concurrency: 19 | group: ${{ github.workflow }}-${{ github.ref }} 20 | cancel-in-progress: true 21 | 22 | jobs: 23 | unix_tests: 24 | name: Unix 25 | strategy: 26 | matrix: 27 | os: [ubuntu-latest, macos-latest] 28 | build_type: [release, debug] 29 | fail-fast: false 30 | uses: ./.github/workflows/unix_impl.yml 31 | with: 32 | os: ${{ matrix.os }} 33 | build_type: ${{ matrix.build_type }} 34 | 35 | win_tests: 36 | name: Windows 37 | strategy: 38 | matrix: 39 | os: [windows-2019] 40 | build_type: [release] 41 | fail-fast: true 42 | uses: ./.github/workflows/windows_impl.yml 43 | with: 44 | os: ${{ matrix.os }} 45 | build_type: ${{ matrix.build_type }} 46 | 47 | brew_tests: 48 | name: Homebrew and Linuxbrew toolchains 49 | uses: ./.github/workflows/brew.yml 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Git files 2 | *.orig 3 | 4 | # User Taskfile.yml 5 | Taskfile.yml 6 | Taskfile.yaml 7 | taskfile.yml 8 | taskfile.yaml 9 | 10 | # Mamba generated files 11 | include/mamba/core/version.hpp 12 | 13 | # OS files 14 | .DS_Store 15 | 16 | # Editor files 17 | .vscode 18 | .idea 19 | *.swap 20 | 21 | # CMake files 22 | **/build/ 23 | **/build-*/ 24 | CMakeUserPresets.json 25 | **/cmake-build-debug/ 26 | 27 | # CMake files that should not exists because they should be generated under a build folder 28 | CMakeLists.txt.user 29 | CMakeCache.txt 30 | CMakeFiles 31 | CMakeScripts 32 | Testing 33 | # There exist other Makefiles in /docs 34 | /Makefile 35 | cmake_install.cmake 36 | install_manifest.txt 37 | CTestTestfile.cmake 38 | _deps 39 | 40 | # Clang tools 41 | .cache/ 42 | compile_commands.json 43 | 44 | # Prerequisites 45 | *.d 46 | 47 | # Compiled Object files 48 | *.slo 49 | *.lo 50 | *.o 51 | *.obj 52 | 53 | # Precompiled Headers 54 | *.gch 55 | *.pch 56 | 57 | # Compiled Dynamic libraries 58 | *.so 59 | *.dylib 60 | *.dll 61 | 62 | # Fortran module files 63 | *.mod 64 | *.smod 65 | 66 | # Compiled Static libraries 67 | *.lai 68 | *.la 69 | *.a 70 | *.lib 71 | 72 | # Executables 73 | *.exe 74 | *.out 75 | *.app 76 | 77 | # Python caches 78 | *.pyc 79 | .ipynb_checkpoints/ 80 | .pytest_cache/ 81 | __pycache__ 82 | mamba.egg-info/ 83 | 84 | # Misc 85 | __cache__/ 86 | *.cppimporthash 87 | .rendered* 88 | installed.json 89 | tmp/ 90 | test_7.json.state 91 | _skbuild/ 92 | 93 | 94 | /vcpkg_installed/ 95 | -------------------------------------------------------------------------------- /.isort.cfg: -------------------------------------------------------------------------------- 1 | [settings] 2 | line_length=88 3 | known_third_party=pybind11,conda,conda_env 4 | multi_line_output=3 5 | include_trailing_comma=True 6 | force_grid_wrap=0 7 | use_parentheses=True 8 | profile=black 9 | -------------------------------------------------------------------------------- /.markdownlint.yaml: -------------------------------------------------------------------------------- 1 | # Default state for all rules 2 | default: true 3 | 4 | # MD013/line-length - Line length 5 | MD013: 6 | # Number of characters 7 | line_length: 200 8 | 9 | no-duplicate-heading: false 10 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | 3 | sphinx: 4 | # Path to Sphinx configuration file 5 | configuration: docs/source/conf.py 6 | 7 | build: 8 | os: "ubuntu-22.04" 9 | tools: 10 | python: "mambaforge-22.9" 11 | jobs: 12 | pre_build: 13 | - | 14 | ( 15 | cat docs/Doxyfile; 16 | echo "INPUT=libmamba/include"; 17 | echo "XML_OUTPUT=docs/xml" 18 | ) | doxygen - 19 | 20 | conda: 21 | environment: docs/environment.yml 22 | -------------------------------------------------------------------------------- /CITATION.cff: -------------------------------------------------------------------------------- 1 | cff-version: 1.2.0 2 | message: "If you use this software, please cite it as below." 3 | type: "software" 4 | title: "mamba" 5 | date-released: "2019-03" 6 | authors: 7 | - family-names: "QuantStack and Mamba Contributors" 8 | given-names: "" 9 | website: "https://github.com/mamba-org/mamba" 10 | repository-code: "https://github.com/mamba-org/mamba" 11 | url: "https://mamba.readthedocs.io/" 12 | abstract: "Mamba is a fast, robust, and cross-platform package manager for the Conda ecosystem." 13 | license: "BSD-3-Clause" 14 | keywords: 15 | - "package manager" 16 | - "conda" 17 | - "python" 18 | - "dependency resolution" 19 | - "cross-platform" 20 | -------------------------------------------------------------------------------- /CMakePresets.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurePresets": [ 3 | { 4 | "displayName": "Mamba Unix Shared Debug", 5 | "inherits": ["conda-unix", "libmamba-all", "mamba-shared", "mamba-debug"], 6 | "name": "mamba-unix-shared-debug" 7 | }, 8 | { 9 | "displayName": "Mamba Unix Shared Release", 10 | "inherits": [ 11 | "conda-unix", 12 | "libmamba-all", 13 | "mamba-shared", 14 | "mamba-release" 15 | ], 16 | "name": "mamba-unix-shared-release" 17 | }, 18 | { 19 | "displayName": "Mamba Unix Shared Debug Dev", 20 | "inherits": ["mamba-unix-shared-debug", "mamba-dev"], 21 | "name": "mamba-unix-shared-debug-dev" 22 | }, 23 | { 24 | "displayName": "Mamba Win Shared Release", 25 | "inherits": ["libmamba-all", "mamba-shared", "mamba-release"], 26 | "name": "mamba-win-shared-release" 27 | } 28 | ], 29 | "include": ["dev/CMakePresetsUnix.json", "dev/CMakePresetsMamba.json"], 30 | "version": 4 31 | } 32 | -------------------------------------------------------------------------------- /CONTRIBUTING.rst: -------------------------------------------------------------------------------- 1 | ============== 2 | Contributing 3 | ============== 4 | 5 | The mamba repository is hosted at https://github.com/mamba-org/mamba. 6 | The general developer documentation is hosted at https://mamba.readthedocs.io/en/latest/developer_zone/contributing.html. 7 | See also https://mamba.readthedocs.io/en/latest/developer_zone/dev_environment.html for setting up 8 | a development environment. 9 | 10 | When contributing to this repository, it is always a good idea to first 11 | discuss the change you wish to make via issue, email, or any other method with 12 | the owners of this repository before making a change. 13 | 14 | We welcome all kinds of contribution -- code or non-code -- and value them 15 | highly. We pledge to treat everyones contribution fairly and with respect and 16 | we are here to help awesome pull requests over the finish line. 17 | 18 | Please note we have a code of conduct, and follow it in all your interactions with the project. 19 | 20 | We follow the `NumFOCUS code of conduct `_. 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2019 QuantStack and the Mamba contributors. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security issues 2 | 3 | If you find a security issue and want to responsibly disclose it, please contact the following email addresses: 4 | 5 | Wolf Vollprecht 6 | QuantStack 7 | 8 | Thanks! 9 | -------------------------------------------------------------------------------- /_typos.toml: -------------------------------------------------------------------------------- 1 | [default.extend-words] 2 | # False positives to ignore 3 | eit = "eit" 4 | pn = "pn" 5 | Ome = "Ome" 6 | haa = "haa" 7 | "fo" = "fo" 8 | -------------------------------------------------------------------------------- /cmake/Checks.cmake: -------------------------------------------------------------------------------- 1 | # Module to make checks/assertions 2 | 3 | # Check that the target has the proper type. 4 | # 5 | # This is useful for targets that can be either static or dynamic but have the same name. 6 | function(mamba_target_check_type target expected_type log_level) 7 | get_target_property(actual_type ${target} TYPE) 8 | if(NOT actual_type STREQUAL expected_type) 9 | message( 10 | ${log_level} 11 | "Expected type \"${expected_type}\" for target \"${target}\"" 12 | " but found \"${actual_type}\"" 13 | ) 14 | endif() 15 | endfunction() 16 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | github_checks: 2 | annotations: false 3 | -------------------------------------------------------------------------------- /compare_stubs.py: -------------------------------------------------------------------------------- 1 | import ast 2 | import sys 3 | from itertools import zip_longest 4 | 5 | 6 | # https://stackoverflow.com/a/66733795 7 | # original autho Seanny123, CC BY-SA 4.0 8 | def compare_ast(node1, node2) -> bool: 9 | if type(node1) is not type(node2): 10 | return False 11 | 12 | if isinstance(node1, ast.AST): 13 | for k, v in vars(node1).items(): 14 | if k in {"lineno", "end_lineno", "col_offset", "end_col_offset", "ctx"}: 15 | continue 16 | if not compare_ast(v, getattr(node2, k)): 17 | return False 18 | return True 19 | 20 | elif isinstance(node1, list) and isinstance(node2, list): 21 | return all(compare_ast(n1, n2) for n1, n2 in zip_longest(node1, node2)) 22 | else: 23 | return node1 == node2 24 | 25 | 26 | if __name__ == "__main__": 27 | print(sys.argv) 28 | 29 | f1, f2 = sys.argv[1:3] 30 | 31 | with open(f1) as fi: 32 | a1 = ast.parse(fi.read()) 33 | 34 | with open(f2) as fi: 35 | a2 = ast.parse(fi.read()) 36 | 37 | if not compare_ast(a1, a2): 38 | print("Stubs are different! Please rerun pybind11-stubgen") 39 | print("CI has these: \n\n") 40 | with open(f2) as fi: 41 | print(fi.read()) 42 | sys.exit(1) 43 | -------------------------------------------------------------------------------- /dev/environment-dev-extra.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | dependencies: 4 | # Compiler cache 5 | - ccache 6 | # C++ LSP tools and related packages 7 | - clang-tools 8 | - clang 9 | - clangxx 10 | - lld 11 | - cmake-format 12 | # C++ Debugging 13 | - sel(linux): gdb 14 | - sel(osx): lldb 15 | - sel(linux): valgrind # Out of date on MacOS 16 | # Python LSP support 17 | - ruff 18 | - python-lsp-server-base 19 | - ruff-lsp 20 | # Interactive Python tools 21 | - jupyterlab 22 | - ipython 23 | # Python Debugging 24 | - ipdb 25 | # Github CLI tool 26 | - gh 27 | -------------------------------------------------------------------------------- /dev/environment-dev.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | dependencies: 4 | # libmamba build dependencies 5 | - cxx-compiler 6 | - cmake >=3.16 7 | - pkg-config # Used by some CMake dependencies 8 | - ninja 9 | - make # not always present 10 | # libmamba dependencies 11 | - cpp-expected 12 | - fmt 13 | - libarchive 14 | - libcurl >=7.86 15 | - libsodium 16 | - libsolv >=0.7.18 17 | - nlohmann_json 18 | - reproc-cpp >=14.2.4.post0 19 | - simdjson >=3.3.0 20 | - spdlog 21 | - yaml-cpp >=0.8.0 22 | - sel(win): winreg 23 | # libmamba test dependencies 24 | - catch2 25 | # micromamba dependencies 26 | - cli11 >=2.2 27 | # micromamba test dependencies 28 | - python 29 | - mitmproxy 30 | - pytest >=7.3.0 31 | - pytest-asyncio 32 | - pytest-timeout 33 | - pytest-xprocess 34 | - pytest-rerunfailures 35 | - pytest-cov 36 | - memory_profiler 37 | - requests 38 | - sel(win): pywin32 39 | - sel(win): menuinst 40 | - conda-content-trust 41 | - conda-package-handling 42 | - cryptography 43 | - securesystemslib 44 | # libmambapy build dependencies 45 | - scikit-build 46 | - pybind11-stubgen <1.0 47 | # libmambapy dependencies 48 | - python 49 | - pybind11 50 | # dev dependencies 51 | - pre-commit 52 | # Documentation dependencies 53 | - doxygen 54 | - breathe 55 | - sphinx 56 | - sphinx-book-theme 57 | - myst-parser 58 | -------------------------------------------------------------------------------- /dev/environment-micromamba-static.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | dependencies: 4 | - python >=3.12 5 | # libmamba build dependencies 6 | - cxx-compiler 7 | - cmake >=3.16 8 | - pkg-config # Used by some CMake dependencies 9 | - ninja 10 | # libmamba dependencies 11 | - cpp-expected 12 | - nlohmann_json 13 | - simdjson-static >=3.3.0 14 | - spdlog 15 | - fmt 16 | - libsolv-static >=0.7.24 17 | - yaml-cpp-static >=0.8.0 18 | - reproc-static >=14.2.4.post0 19 | - reproc-cpp-static >=14.2.4.post0 20 | - libcurl >=8.4.0 21 | - libcurl-static >=8.4.0 22 | - xz-static 23 | - libssh2-static 24 | - libarchive-minimal-static 25 | - krb5-static 26 | - openssl 27 | - libopenssl-static 28 | - zstd-static 29 | - zlib 30 | - libnghttp2-static 31 | - lz4-c-static 32 | # libmamba test dependencies 33 | - catch2 34 | # micromamba dependencies 35 | - cli11 >=2.2,<3 36 | -------------------------------------------------------------------------------- /docs/Doxyfile: -------------------------------------------------------------------------------- 1 | PROJECT_NAME = "libmamba" 2 | INPUT = "../libmamba/include" 3 | 4 | CASE_SENSE_NAMES = NO 5 | EXCLUDE_SYMBOLS = detail 6 | GENERATE_HTML = NO 7 | GENERATE_LATEX = NO 8 | GENERATE_MAN = NO 9 | GENERATE_RTF = NO 10 | GENERATE_TREEVIEW = YES 11 | GENERATE_XML = YES 12 | JAVADOC_AUTOBRIEF = YES 13 | MACRO_EXPANSION = YES 14 | PREDEFINED = IN_DOXYGEN 15 | QUIET = YES 16 | RECURSIVE = YES 17 | SOURCE_BROWSER = YES 18 | WARN_IF_UNDOCUMENTED = NO 19 | XML_OUTPUT = xml 20 | -------------------------------------------------------------------------------- /docs/Makefile: -------------------------------------------------------------------------------- 1 | # Minimal makefile for Sphinx documentation 2 | # 3 | 4 | # You can set these variables from the command line, and also 5 | # from the environment for the first two. 6 | SPHINXOPTS ?= 7 | SPHINXBUILD ?= sphinx-build 8 | SOURCEDIR = source 9 | BUILDDIR = build 10 | 11 | # Put it first so that "make" without argument is like "make help". 12 | help: 13 | @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 14 | 15 | .PHONY: help Makefile 16 | 17 | # Catch-all target: route all unknown targets to Sphinx using the new 18 | # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). 19 | %: Makefile 20 | @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) 21 | -------------------------------------------------------------------------------- /docs/assets/mamba_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/docs/assets/mamba_header.png -------------------------------------------------------------------------------- /docs/environment.yml: -------------------------------------------------------------------------------- 1 | name: docs 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - myst-parser 6 | - six 7 | - sphinx=6.* 8 | - sphinx-book-theme 9 | - doxygen 10 | - breathe 11 | -------------------------------------------------------------------------------- /docs/make.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | 3 | pushd %~dp0 4 | 5 | REM Command file for Sphinx documentation 6 | 7 | if "%SPHINXBUILD%" == "" ( 8 | set SPHINXBUILD=sphinx-build 9 | ) 10 | set SOURCEDIR=source 11 | set BUILDDIR=build 12 | 13 | if "%1" == "" goto help 14 | 15 | %SPHINXBUILD% >NUL 2>NUL 16 | if errorlevel 9009 ( 17 | echo. 18 | echo.The 'sphinx-build' command was not found. Make sure you have Sphinx 19 | echo.installed, then set the SPHINXBUILD environment variable to point 20 | echo.to the full path of the 'sphinx-build' executable. Alternatively you 21 | echo.may add the Sphinx directory to PATH. 22 | echo. 23 | echo.If you don't have Sphinx installed, grab it from 24 | echo.http://sphinx-doc.org/ 25 | exit /b 1 26 | ) 27 | 28 | %SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 29 | goto end 30 | 31 | :help 32 | %SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% 33 | 34 | :end 35 | popd 36 | -------------------------------------------------------------------------------- /docs/source/_static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/docs/source/_static/logo.png -------------------------------------------------------------------------------- /docs/source/advanced_usage/hard_links.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/docs/source/advanced_usage/hard_links.png -------------------------------------------------------------------------------- /docs/source/api/solver.rst: -------------------------------------------------------------------------------- 1 | ``mamba::solver`` 2 | ================= 3 | 4 | The ``mamba::solver`` namespace contains the packages solver and related objects. 5 | This particular namespace is a generic common interface, while the subnamespace 6 | ``mamba::solver::libsolv`` contains `LibSolv `_ 7 | specific implementations. 8 | 9 | .. doxygennamespace:: mamba::solver 10 | -------------------------------------------------------------------------------- /docs/source/api/specs.rst: -------------------------------------------------------------------------------- 1 | ``mamba::specs`` 2 | ================ 3 | 4 | The ``mamba::specs`` namespace contains object to *describe* abstraction in the Conda ecosystem. 5 | They are purely functional and do not have any observable impact on the user system. 6 | 7 | .. doxygennamespace:: mamba::specs 8 | -------------------------------------------------------------------------------- /docs/source/developer_zone/contributing.rst: -------------------------------------------------------------------------------- 1 | .. include:: ../../../CONTRIBUTING.rst 2 | -------------------------------------------------------------------------------- /docs/source/installation/mamba-installation.rst: -------------------------------------------------------------------------------- 1 | .. _mamba-install: 2 | 3 | ================== 4 | Mamba Installation 5 | ================== 6 | 7 | Fresh install (recommended) 8 | *************************** 9 | 10 | We recommend that you start with the `Miniforge distribution `_ >= ``Miniforge3-23.3.1-0``. 11 | If you need an older version of Mamba, please use the Mambaforge distribution. 12 | Miniforge comes with the popular ``conda-forge`` channel preconfigured, but you can modify the configuration to use any channel you like. 13 | 14 | After successful installation, you can use the mamba commands as described in :ref:`mamba user guide`. 15 | 16 | .. note:: 17 | 18 | 1. After installation, please :ref:`make sure ` that you do not have the Anaconda default channels configured. 19 | 2. Do not install anything into the ``base`` environment as this might break your installation. See :ref:`here ` for details. 20 | 21 | Docker images 22 | ************* 23 | 24 | In addition to the Miniforge standalone distribution (see above), there are also the 25 | `condaforge/miniforge3 `_ docker 26 | images: 27 | 28 | .. code-block:: bash 29 | 30 | docker run -it --rm condaforge/miniforge3:latest mamba info 31 | 32 | 33 | Conda libmamba solver 34 | ********************* 35 | 36 | For a totally conda-compatible experience with the fast Mamba solver, 37 | `conda-libmamba-solver `_ now ships by default with 38 | Conda. 39 | Just use an up to date version of Conda to enjoy the speed improvememts. 40 | -------------------------------------------------------------------------------- /docs/source/tools/mermaid.css: -------------------------------------------------------------------------------- 1 | .mermaid svg { 2 | max-width: 800px; 3 | } 4 | -------------------------------------------------------------------------------- /docs/source/user_guide/micromamba.rst: -------------------------------------------------------------------------------- 1 | .. _micromamba: 2 | 3 | ===================== 4 | Micromamba User Guide 5 | ===================== 6 | 7 | ``micromamba`` is a tiny version of the ``mamba`` package manager. 8 | It is a statically linked C++ executable with a separate command line interface. 9 | It does not need a ``base`` environment and does not come with a default version of Python. 10 | 11 | .. note:: 12 | 13 | ``mamba`` and ``micromamba`` are the same code base, only build options vary. 14 | 15 | In combinations with subcommands like ``micromamba shell`` and ``micromamba run``, it is extremely 16 | convenient in CI and Docker environments where running shell activatio hooks is complicated. 17 | 18 | I can be used with a drop-in installation without further steps: 19 | 20 | .. code-block:: shell 21 | 22 | /path/to/micromamba create -p /tmp/env 'pytest>=8.0' 23 | /path/to/micromamba run -p /tmp/env pytest myproject/tests 24 | -------------------------------------------------------------------------------- /docs/source/user_guide/prefix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/docs/source/user_guide/prefix.png -------------------------------------------------------------------------------- /libmamba/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2019 QuantStack and the Mamba contributors. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /libmamba/data/activate.bat: -------------------------------------------------------------------------------- 1 | @REM Copyright (C) 2021 QuantStack 2 | @REM SPDX-License-Identifier: BSD-3-Clause 3 | 4 | @CALL "%~dp0..\condabin\__MAMBA_INSERT_HOOK_BAT_NAME__" 5 | __MAMBA_INSERT_EXE_NAME__ activate %* 6 | -------------------------------------------------------------------------------- /libmamba/data/compile_pyc.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | from compileall import compile_file 4 | from concurrent.futures import ProcessPoolExecutor 5 | 6 | 7 | def main(): 8 | max_workers = int(os.environ.get("MAMBA_EXTRACT_THREADS", "0")) 9 | if max_workers <= 0: 10 | max_workers = None 11 | 12 | results = [] 13 | with sys.stdin: 14 | with ProcessPoolExecutor(max_workers=max_workers) as executor: 15 | while True: 16 | name = sys.stdin.readline().strip() 17 | if not name: 18 | break 19 | results.append(executor.submit(compile_file, name, quiet=1)) 20 | success = all(r.result() for r in results) 21 | return success 22 | 23 | 24 | if __name__ == "__main__": 25 | success = main() 26 | sys.exit(int(not success)) 27 | -------------------------------------------------------------------------------- /libmamba/data/mamba.bat: -------------------------------------------------------------------------------- 1 | @REM Copyright (C) 2012 Anaconda, Inc 2 | @REM SPDX-License-Identifier: BSD-3-Clause 3 | 4 | @REM Replaced by mamba executable with the MAMBA_EXE and MAMBA_ROOT_PREFIX variable pointing 5 | @REM to the correct locations. 6 | __MAMBA_DEFINE_MAMBA_EXE__ 7 | __MAMBA_DEFINE_ROOT_PREFIX__ 8 | 9 | @IF [%1]==[activate] "%~dp0__MAMBA_INSERT_ACTIVATE_BAT_NAME__" %* 10 | @IF [%1]==[deactivate] "%~dp0__MAMBA_INSERT_ACTIVATE_BAT_NAME__" %* 11 | 12 | @CALL "%MAMBA_EXE%" %* 13 | 14 | @IF %errorlevel% NEQ 0 EXIT /B %errorlevel% 15 | 16 | @IF [%1]==[install] "%~dp0__MAMBA_INSERT_ACTIVATE_BAT_NAME__" reactivate 17 | @IF [%1]==[update] "%~dp0__MAMBA_INSERT_ACTIVATE_BAT_NAME__" reactivate 18 | @IF [%1]==[upgrade] "%~dp0__MAMBA_INSERT_ACTIVATE_BAT_NAME__" reactivate 19 | @IF [%1]==[remove] "%~dp0__MAMBA_INSERT_ACTIVATE_BAT_NAME__" reactivate 20 | @IF [%1]==[uninstall] "%~dp0__MAMBA_INSERT_ACTIVATE_BAT_NAME__" reactivate 21 | @IF [%1]==[self-update] @CALL DEL /f %MAMBA_EXE%.bkup 22 | 23 | @EXIT /B %errorlevel% 24 | -------------------------------------------------------------------------------- /libmamba/data/mamba_completion.posix: -------------------------------------------------------------------------------- 1 | if [ -n "${ZSH_VERSION:+x}" ]; then 2 | if ! command -v compinit > /dev/null; then 3 | autoload -U +X compinit && if [[ "${ZSH_DISABLE_COMPFIX-}" = true ]]; then 4 | compinit -u 5 | else 6 | compinit 7 | fi 8 | fi 9 | autoload -U +X bashcompinit && bashcompinit 10 | 11 | _umamba_zsh_completions() 12 | { 13 | COMPREPLY=($(__mamba_exe completer "${(@s: :)${(@s: :)COMP_LINE}:1}")) 14 | } 15 | 16 | complete -o default -F _umamba_zsh_completions micromamba 17 | fi 18 | if [ -n "${BASH_VERSION:+x}" ]; then 19 | _umamba_bash_completions() 20 | { 21 | COMPREPLY=($(__mamba_exe completer "${COMP_WORDS[@]:1}")) 22 | } 23 | complete -o default -F _umamba_bash_completions micromamba 24 | fi 25 | -------------------------------------------------------------------------------- /libmamba/data/mamba_hook.bat: -------------------------------------------------------------------------------- 1 | @REM Copyright (C) 2021 QuantStack 2 | @REM SPDX-License-Identifier: BSD-3-Clause 3 | @REM This file is derived from conda_hook.bat 4 | 5 | @IF DEFINED CONDA_SHLVL GOTO :EOF 6 | 7 | @FOR %%F in ("%~dp0") do @SET "__mambabin_dir=%%~dpF" 8 | @SET "__mambabin_dir=%__mambabin_dir:~0,-1%" 9 | @SET "PATH=%__mambabin_dir%;%PATH%" 10 | @SET "MAMBA_BAT=%__mambabin_dir%\__MAMBA_INSERT_BAT_NAME__" 11 | @FOR %%F in ("%__mambabin_dir%") do @SET "__mamba_root=%%~dpF" 12 | __MAMBA_DEFINE_MAMBA_EXE__ 13 | @SET __mambabin_dir= 14 | @SET __mamba_root= 15 | 16 | @REM @DOSKEY does not work with delayed evaluation 17 | @REM @DOSKEY after the first usage of a macro whose name is defined with a variable 18 | @REM Therefore no magic here, just grep and replace when generating the final file 19 | @DOSKEY __MAMBA_INSERT_EXE_NAME__="%MAMBA_BAT%" $* 20 | 21 | @SET CONDA_SHLVL=0 22 | -------------------------------------------------------------------------------- /libmamba/data/mamba_hook.ps1: -------------------------------------------------------------------------------- 1 | Import-Module "$Env:MAMBA_ROOT_PREFIX\condabin\Mamba.psm1" -ArgumentList $MambaModuleArgs 2 | -------------------------------------------------------------------------------- /libmamba/ext/solv-cpp/include/solv-cpp/dependency.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_SOLV_DEPENDENCY_HPP 8 | #define MAMBA_SOLV_DEPENDENCY_HPP 9 | 10 | #include 11 | 12 | #include "solv-cpp/ids.hpp" 13 | 14 | namespace solv 15 | { 16 | class ObjDependencyViewConst 17 | { 18 | public: 19 | 20 | explicit ObjDependencyViewConst(const ::Reldep& reldep) noexcept; 21 | ~ObjDependencyViewConst() noexcept; 22 | 23 | [[nodiscard]] auto raw() const -> const ::Reldep*; 24 | 25 | /** 26 | * The name field of the dependency. 27 | * 28 | * Can be a string id for simple dependencies, or another dependency id for 29 | * complex depndencies with boolean expressions. 30 | */ 31 | [[nodiscard]] auto name() const -> StringId /* OR DependencyId */; 32 | 33 | /** 34 | * The version range field of the dependency. 35 | * 36 | * Can be a string id for simple dependencies, or another dependency id for 37 | * complex depndencies with boolean expressions. 38 | */ 39 | [[nodiscard]] auto version_range() const -> StringId /* OR DependencyId */; 40 | 41 | /** The flags of the dependency, such as types. */ 42 | [[nodiscard]] auto flags() const -> RelationFlag; 43 | 44 | private: 45 | 46 | const ::Reldep* m_reldep = nullptr; 47 | }; 48 | } 49 | #endif 50 | -------------------------------------------------------------------------------- /libmamba/ext/solv-cpp/include/solv-cpp/ids.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_SOLV_IDS_HPP 8 | #define MAMBA_SOLV_IDS_HPP 9 | 10 | #include 11 | 12 | namespace solv 13 | { 14 | using StringId = ::Id; 15 | using DependencyId = ::Id; 16 | using RepoId = ::Id; 17 | using SolvableId = ::Id; 18 | using OffsetId = ::Id; 19 | using RuleId = ::Id; 20 | using ProblemId = ::Id; 21 | using DependencyMarker = ::Id; 22 | using KeyNameId = ::Id; 23 | 24 | using RelationFlag = int; 25 | using DistType = int; 26 | using SolverFlag = int; 27 | using TransactionOrderFlag = int; 28 | using TransactionStepType = int; 29 | using TransactionMode = int; 30 | 31 | enum struct LoopControl 32 | { 33 | Continue, 34 | Break 35 | }; 36 | } 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /libmamba/ext/solv-cpp/src/dependency.cpp: -------------------------------------------------------------------------------- 1 | #include "solv-cpp/dependency.hpp" 2 | 3 | namespace solv 4 | { 5 | ObjDependencyViewConst::ObjDependencyViewConst(const ::Reldep& reldep) noexcept 6 | : m_reldep(&reldep) 7 | { 8 | } 9 | 10 | ObjDependencyViewConst::~ObjDependencyViewConst() noexcept 11 | { 12 | m_reldep = nullptr; 13 | } 14 | 15 | auto ObjDependencyViewConst::raw() const -> const ::Reldep* 16 | { 17 | return m_reldep; 18 | } 19 | 20 | auto ObjDependencyViewConst::name() const -> StringId 21 | { 22 | return m_reldep->name; 23 | } 24 | 25 | auto ObjDependencyViewConst::version_range() const -> StringId 26 | { 27 | return m_reldep->evr; 28 | } 29 | 30 | auto ObjDependencyViewConst::flags() const -> RelationFlag 31 | { 32 | return m_reldep->flags; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /libmamba/ext/solv-cpp/tests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024, QuantStack and Mamba Contributors 2 | # 3 | # Distributed under the terms of the BSD 3-Clause License. 4 | # 5 | # The full license is in the file LICENSE, distributed with this software. 6 | 7 | cmake_minimum_required(VERSION 3.16) 8 | 9 | add_executable( 10 | test_solv_cpp 11 | src/main.cpp 12 | src/msvc_catch_string_view.cpp 13 | src/pool_data.cpp 14 | src/pool_data.hpp 15 | src/test_pool.cpp 16 | src/test_queue.cpp 17 | src/test_repo.cpp 18 | src/test_scenarios.cpp 19 | src/test_solvable.cpp 20 | src/test_solver.cpp 21 | src/test_transaction.cpp 22 | ) 23 | target_include_directories(test_solv_cpp PRIVATE src/) 24 | find_package(Catch2 REQUIRED) 25 | target_link_libraries(test_solv_cpp PRIVATE Catch2::Catch2WithMain solv::cpp) 26 | set_target_properties( 27 | test_solv_cpp PROPERTIES COMPILE_DEFINITIONS CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS 28 | ) 29 | -------------------------------------------------------------------------------- /libmamba/ext/solv-cpp/tests/src/main.cpp: -------------------------------------------------------------------------------- 1 | #define CATCH_CONFIG_MAIN 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /libmamba/ext/solv-cpp/tests/src/msvc_catch_string_view.cpp: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | 3 | // Catch compiled on `conda-forge` for MSVC doesn't support outputting `string_view`. 4 | // So we have to define StringMaker for it ourselves. 5 | // The declaration is present though, so this only causes link errors. 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | namespace Catch 13 | { 14 | 15 | std::string StringMaker::convert(std::string_view str) 16 | { 17 | return std::string(str); 18 | } 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/channel_loader.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_CHANNEL_LOADER_HPP 8 | #define MAMBA_API_CHANNEL_LOADER_HPP 9 | 10 | #include "mamba/core/error_handling.hpp" 11 | 12 | namespace mamba 13 | { 14 | namespace solver::libsolv 15 | { 16 | class Database; 17 | } 18 | class Context; 19 | class ChannelContext; 20 | class MultiPackageCache; 21 | 22 | /* Brief Creates channels and mirrors objects 23 | * and loads channels. 24 | * 25 | * Creates and stores channels in the ChannelContext, 26 | * and mirrors objects in the Context object. Then 27 | * loads channels, i.e. download repodata.json files 28 | * if they are not cached locally. 29 | */ 30 | auto load_channels( 31 | Context& ctx, 32 | ChannelContext& channel_context, 33 | solver::libsolv::Database& database, 34 | MultiPackageCache& package_caches 35 | ) -> expected_t; 36 | 37 | /* Brief Creates channels and mirrors objects, 38 | * but does not load channels. 39 | * 40 | * Creates and stores channels in the ChannelContext, 41 | * and mirrors objects in the Context object. 42 | */ 43 | void init_channels(Context& context, ChannelContext& channel_context); 44 | void init_channels_from_package_urls( 45 | Context& context, 46 | ChannelContext& channel_context, 47 | const std::vector& specs 48 | ); 49 | } 50 | #endif 51 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/clean.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_CLEAN_HPP 8 | #define MAMBA_API_CLEAN_HPP 9 | 10 | namespace mamba 11 | { 12 | const int MAMBA_CLEAN_ALL = 1 << 0; 13 | const int MAMBA_CLEAN_INDEX = 1 << 1; 14 | const int MAMBA_CLEAN_PKGS = 1 << 2; 15 | const int MAMBA_CLEAN_TARBALLS = 1 << 3; 16 | const int MAMBA_CLEAN_LOCKS = 1 << 4; 17 | const int MAMBA_CLEAN_TRASH = 1 << 5; 18 | const int MAMBA_CLEAN_FORCE_PKGS_DIRS = 1 << 6; 19 | 20 | class Configuration; 21 | void clean(Configuration& config, int options); 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/config.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_CONFIG_HPP 8 | #define MAMBA_API_CONFIG_HPP 9 | 10 | namespace mamba 11 | { 12 | class Configuration; 13 | 14 | void config_describe(Configuration& config); 15 | 16 | void config_list(Configuration& config); 17 | 18 | void config_sources(Configuration& config); 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/constants.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MAMBA_API_CONSTANTS_HPP 2 | #define MAMBA_API_CONSTANTS_HPP 3 | 4 | namespace mamba 5 | { 6 | const int MAMBA_NO_PREFIX_CHECK = 1 << 0; 7 | const int MAMBA_ALLOW_EXISTING_PREFIX = 1 << 1; 8 | const int MAMBA_ALLOW_MISSING_PREFIX = 1 << 2; 9 | const int MAMBA_ALLOW_NOT_ENV_PREFIX = 1 << 3; 10 | const int MAMBA_EXPECT_EXISTING_PREFIX = 1 << 4; 11 | 12 | const int MAMBA_NOT_ALLOW_EXISTING_PREFIX = 0; 13 | const int MAMBA_NOT_ALLOW_MISSING_PREFIX = 0; 14 | const int MAMBA_NOT_ALLOW_NOT_ENV_PREFIX = 0; 15 | const int MAMBA_NOT_EXPECT_EXISTING_PREFIX = 0; 16 | 17 | const int MAMBA_CONF_FORCE_COMPUTE = 1 << 0; 18 | const int MAMBA_CONF_DISABLE_HOOK = 1 << 1; 19 | 20 | const int MAMBA_FORCE = 1 << 0; 21 | const int MAMBA_REMOVE_FORCE = MAMBA_FORCE; 22 | const int MAMBA_REMOVE_PRUNE = 1 << 1; 23 | const int MAMBA_REMOVE_ALL = 1 << 2; 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/create.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_CREATE_HPP 8 | #define MAMBA_API_CREATE_HPP 9 | 10 | #include 11 | 12 | #include "mamba/fs/filesystem.hpp" 13 | 14 | namespace mamba 15 | { 16 | class Configuration; 17 | 18 | void create(Configuration& config); 19 | 20 | namespace detail 21 | { 22 | void store_platform_config( 23 | const fs::u8path& prefix, 24 | const std::string& platform, 25 | bool& remove_prefix_on_failure 26 | ); 27 | } 28 | } 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/env.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_ENV_HPP 8 | #define MAMBA_API_ENV_HPP 9 | 10 | #include "mamba/api/configuration.hpp" 11 | 12 | namespace mamba 13 | { 14 | class ChannelContext; 15 | class Configuration; 16 | class Context; 17 | 18 | void print_envs(Configuration& config); 19 | 20 | namespace detail 21 | { 22 | std::string get_env_name(const Context& ctx, const mamba::fs::u8path& px); 23 | void print_envs_impl(const Configuration& config); 24 | } 25 | } 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/info.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_INFO_HPP 8 | #define MAMBA_API_INFO_HPP 9 | 10 | #include 11 | 12 | namespace mamba 13 | { 14 | class ChannelContext; 15 | class Configuration; 16 | class Context; 17 | 18 | void info(Configuration& config); 19 | 20 | std::string version(); 21 | 22 | namespace detail 23 | { 24 | void print_info(Context& ctx, ChannelContext& channel_context, const Configuration& config); 25 | } 26 | } 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/list.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_LIST_HPP 8 | #define MAMBA_API_LIST_HPP 9 | 10 | #include 11 | 12 | namespace mamba 13 | { 14 | class ChannelContext; 15 | class Configuration; 16 | class Context; 17 | 18 | void list(Configuration& config, const std::string& regex); 19 | } 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/remove.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_REMOVE_HPP 8 | #define MAMBA_API_REMOVE_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include "mamba/api/constants.hpp" 14 | 15 | namespace mamba 16 | { 17 | class Context; 18 | class ChannelContext; 19 | class Configuration; 20 | 21 | enum class RemoveResult : int 22 | { 23 | YES = 0, 24 | NO = 1, 25 | EMPTY = 2, 26 | }; 27 | 28 | RemoveResult remove(Configuration& config, int flags = MAMBA_REMOVE_PRUNE); 29 | 30 | namespace detail 31 | { 32 | bool remove_specs( 33 | Context& ctx, 34 | ChannelContext& channel_context, 35 | const std::vector& specs, 36 | bool prune, 37 | bool force 38 | ); 39 | } 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/repoquery.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | #include "mamba/api/configuration.hpp" 12 | #include "mamba/core/query.hpp" 13 | 14 | namespace mamba 15 | { 16 | enum class QueryResultFormat 17 | { 18 | Json = 0, 19 | Tree = 1, 20 | Table = 2, 21 | Pretty = 3, 22 | RecursiveTable = 4, 23 | }; 24 | 25 | [[nodiscard]] auto make_repoquery( 26 | solver::libsolv::Database& database, 27 | QueryType type, 28 | QueryResultFormat format, 29 | const std::vector& queries, 30 | bool show_all_builds, 31 | const Context::GraphicsParams& graphics_params, 32 | std::ostream& out 33 | ) -> bool; 34 | 35 | [[nodiscard]] auto repoquery( 36 | Configuration& config, 37 | QueryType type, 38 | QueryResultFormat format, 39 | bool use_local, 40 | const std::vector& query 41 | ) -> bool; 42 | } 43 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/shell.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_SHELL_HPP 8 | #define MAMBA_API_SHELL_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include "mamba/core/palette.hpp" 14 | #include "mamba/fs/filesystem.hpp" 15 | 16 | namespace mamba 17 | { 18 | class Context; 19 | 20 | void shell_init(Context& ctx, const std::string& shell_type, const fs::u8path& prefix); 21 | void shell_deinit(Context& ctx, const std::string& shell_type, const fs::u8path& prefix); 22 | void shell_reinit(Context& ctx, const fs::u8path& prefix); 23 | void shell_hook(Context& ctx, const std::string& shell_type); 24 | void 25 | shell_activate(Context& ctx, const fs::u8path& prefix, const std::string& shell_type, bool stack); 26 | void shell_reactivate(Context& ctx, const std::string& shell_type); 27 | void shell_deactivate(Context& ctx, const std::string& shell_type); 28 | void shell_enable_long_path_support(Palette palette = Palette::no_color()); 29 | } 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /libmamba/include/mamba/api/update.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_API_UPDATE_HPP 8 | #define MAMBA_API_UPDATE_HPP 9 | 10 | namespace mamba 11 | { 12 | class Configuration; 13 | 14 | enum class UpdateAll : bool 15 | { 16 | No = false, 17 | Yes = true, 18 | }; 19 | 20 | enum class PruneDeps : bool 21 | { 22 | No = false, 23 | Yes = true, 24 | }; 25 | 26 | enum class EnvUpdate : bool // Specific to `env update` command 27 | { 28 | No = false, 29 | Yes = true, 30 | }; 31 | 32 | enum class RemoveNotSpecified : bool // Specific to `env update` command 33 | { 34 | No = false, 35 | Yes = true, 36 | }; 37 | 38 | struct UpdateParams 39 | { 40 | UpdateAll update_all = UpdateAll::No; 41 | PruneDeps prune_deps = PruneDeps::No; 42 | EnvUpdate env_update = EnvUpdate::No; 43 | RemoveNotSpecified remove_not_specified = RemoveNotSpecified::No; 44 | }; 45 | 46 | void update(Configuration& config, const UpdateParams& update_params = {}); 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/common_types.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_CORE_COMMON_TYPES_HPP 8 | #define MAMBA_CORE_COMMON_TYPES_HPP 9 | 10 | namespace mamba 11 | { 12 | enum class log_level 13 | { 14 | trace, 15 | debug, 16 | info, 17 | warn, 18 | err, 19 | critical, 20 | off 21 | }; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/environments_manager.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_CORE_ENVIRONMENT_MANAGER 8 | #define MAMBA_CORE_ENVIRONMENT_MANAGER 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "fsutil.hpp" 15 | 16 | namespace mamba 17 | { 18 | class Context; 19 | 20 | const char PREFIX_MAGIC_FILE[] = "conda-meta/history"; 21 | 22 | bool is_conda_environment(const fs::u8path& prefix); 23 | 24 | std::string env_name( 25 | const std::vector& envs_dirs, 26 | const fs::u8path& root_prefix, 27 | const fs::u8path& prefix 28 | ); 29 | 30 | class EnvironmentsManager 31 | { 32 | public: 33 | 34 | explicit EnvironmentsManager(const Context& context); 35 | 36 | void register_env(const fs::u8path& location); 37 | void unregister_env(const fs::u8path& location); 38 | std::set list_all_known_prefixes(); 39 | 40 | private: 41 | 42 | const Context& m_context; 43 | std::set 44 | clean_environments_txt(const fs::u8path& env_txt_file, const fs::u8path& location); 45 | std::string remove_trailing_slash(std::string p); 46 | fs::u8path get_environments_txt_file(const fs::u8path& home) const; 47 | }; 48 | } // namespace mamba 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/invoke.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MAMBA_INVOKE_HPP 2 | #define MAMBA_INVOKE_HPP 3 | 4 | #include 5 | 6 | #include "mamba/core/error_handling.hpp" 7 | 8 | namespace mamba 9 | { 10 | 11 | template 12 | auto safe_invoke(Func&& func, Args&&... args) 13 | -> tl::expected(func), std::forward(args)...)), mamba_error> 14 | { 15 | try 16 | { 17 | // If the callable is passed by being moved-in (r-value reference/temporary etc.) 18 | // we make sure that the lifetime of that callable doesnt go beyond this block. 19 | auto call = [&, callable = std::forward(func)] 20 | { return std::invoke(callable, std::forward(args)...); }; 21 | using Result = decltype(call()); 22 | 23 | if constexpr (std::is_void::value) 24 | { 25 | call(); 26 | return {}; 27 | } 28 | else 29 | { 30 | return call(); 31 | } 32 | } 33 | catch (const std::runtime_error& err) 34 | { 35 | return make_unexpected( 36 | std::string("callback invocation failed : ") + err.what(), 37 | mamba_error_code::unknown 38 | ); 39 | } 40 | catch (...) 41 | { 42 | return make_unexpected( 43 | "callback invocation failed : unknown error", 44 | mamba_error_code::unknown 45 | ); 46 | } 47 | } 48 | 49 | } 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/menuinst.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | namespace mamba 8 | { 9 | class TransactionContext; 10 | 11 | namespace fs 12 | { 13 | class u8path; 14 | } 15 | 16 | void 17 | remove_menu_from_json(const fs::u8path& json_file, const TransactionContext& transaction_context); 18 | void 19 | create_menu_from_json(const fs::u8path& json_file, const TransactionContext& transaction_context); 20 | } 21 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/package_database_loader.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_CORE_PACKAGE_DATABASE_LOADER_HPP 8 | #define MAMBA_CORE_PACKAGE_DATABASE_LOADER_HPP 9 | 10 | #include "mamba/core/error_handling.hpp" 11 | #include "mamba/solver/libsolv/repo_info.hpp" 12 | #include "mamba/specs/channel.hpp" 13 | 14 | namespace mamba 15 | { 16 | class Context; 17 | class PrefixData; 18 | class SubdirIndexLoader; 19 | 20 | namespace solver::libsolv 21 | { 22 | class Database; 23 | } 24 | 25 | void add_spdlog_logger_to_database(solver::libsolv::Database& database); 26 | 27 | auto load_subdir_in_database( // 28 | const Context& ctx, 29 | solver::libsolv::Database& database, 30 | const SubdirIndexLoader& subdir 31 | ) -> expected_t; 32 | 33 | auto load_installed_packages_in_database( 34 | const Context& ctx, 35 | solver::libsolv::Database& database, 36 | const PrefixData& prefix 37 | ) -> solver::libsolv::RepoInfo; 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/pinning.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_CORE_PINNING_HPP 8 | #define MAMBA_CORE_PINNING_HPP 9 | 10 | #include 11 | #include 12 | 13 | namespace mamba 14 | { 15 | class Context; 16 | class ChannelContext; 17 | class PrefixData; 18 | 19 | namespace fs 20 | { 21 | class u8path; 22 | } 23 | 24 | std::string python_pin(PrefixData& prefix_data, const std::vector& specs); 25 | 26 | std::vector file_pins(const fs::u8path& file); 27 | } 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/repo_checker_store.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_CORE_REPO_CHECKER_STORE_HPP 8 | #define MAMBA_CORE_REPO_CHECKER_STORE_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include "mamba/specs/channel.hpp" 14 | #include "mamba/validation/repo_checker.hpp" 15 | 16 | namespace mamba 17 | { 18 | class Context; 19 | class ChannelContext; 20 | class MultiPackageCache; 21 | 22 | class RepoCheckerStore 23 | { 24 | public: 25 | 26 | using Channel = specs::Channel; 27 | using RepoChecker = validation::RepoChecker; 28 | using repo_checker_list = std::vector>; 29 | 30 | [[nodiscard]] static auto 31 | make(const Context& ctx, ChannelContext& cc, MultiPackageCache& caches) -> RepoCheckerStore; 32 | 33 | explicit RepoCheckerStore(repo_checker_list checkers); 34 | 35 | [[nodiscard]] auto find_checker(const Channel& chan) -> RepoChecker*; 36 | 37 | [[nodiscard]] auto contains_checker(const Channel& chan) -> bool; 38 | 39 | [[nodiscard]] auto at_checker(const Channel& chan) -> RepoChecker&; 40 | 41 | private: 42 | 43 | repo_checker_list m_repo_checkers = {}; 44 | }; 45 | } 46 | #endif 47 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/subdir_parameters.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2025, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_CORE_SUBDIR_PARAMETERS_HPP 8 | #define MAMBA_CORE_SUBDIR_PARAMETERS_HPP 9 | 10 | #include 11 | 12 | namespace mamba 13 | { 14 | struct SubdirParams 15 | { 16 | /** 17 | * Repodata cache time to live in seconds. 18 | * 19 | * If not specified, then it is read from server headers. 20 | */ 21 | std::optional local_repodata_ttl_s = std::nullopt; 22 | bool offline = false; 23 | /** Force the use of zst for this subdir without checking. */ 24 | bool repodata_force_use_zst = false; 25 | }; 26 | 27 | struct SubdirDownloadParams 28 | { 29 | bool offline = false; 30 | /** Make a request to check the use of zst compression format. */ 31 | bool repodata_check_zst = true; 32 | }; 33 | } 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/timeref.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MAMBA_CORE_TIMEREF_HPP 2 | #define MAMBA_CORE_TIMEREF_HPP 3 | 4 | #include 5 | #include 6 | 7 | namespace mamba::validation 8 | { 9 | 10 | /** Define a time reference. 11 | * TUF 5.1 'Record fixed update start time' 12 | * https://theupdateframework.github.io/specification/latest/#fix-time 13 | */ 14 | class TimeRef 15 | { 16 | public: 17 | 18 | void set(const std::time_t& time); 19 | void set_now(); 20 | std::string timestamp() const; 21 | 22 | TimeRef(const std::time_t& time); 23 | TimeRef(); 24 | ~TimeRef() = default; 25 | 26 | private: 27 | 28 | std::time_t m_time_ref; 29 | }; 30 | 31 | } 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/util_os.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019-2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_CORE_UTIL_OS_HPP 8 | #define MAMBA_CORE_UTIL_OS_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include "mamba/core/fsutil.hpp" 14 | #include "mamba/core/palette.hpp" 15 | 16 | namespace mamba 17 | { 18 | #ifdef _WIN32 19 | // Intention is to avoid including `Windows.h`, while still using the basic Windows API types. 20 | using DWORD = unsigned long; 21 | #endif 22 | 23 | bool is_admin(); 24 | fs::u8path get_self_exe_path(); 25 | fs::u8path get_libmamba_path(); 26 | 27 | using PID = 28 | #ifdef _WIN32 29 | DWORD 30 | #else 31 | int 32 | #endif 33 | ; 34 | 35 | std::string get_process_name_by_pid(const PID pid); 36 | #ifdef _WIN32 37 | PID getppid(); 38 | #endif 39 | 40 | void run_as_admin(const std::string& args); 41 | bool enable_long_paths_support(bool force, Palette palette = Palette::no_color()); 42 | 43 | void init_console(); 44 | void reset_console(); 45 | 46 | /* Test whether a given `std::ostream` object refers to a terminal. */ 47 | bool is_atty(const std::ostream& stream); 48 | 49 | struct ConsoleFeatures 50 | { 51 | bool virtual_terminal_processing, true_colors; 52 | }; 53 | 54 | ConsoleFeatures get_console_features(); 55 | int get_console_width(); 56 | int get_console_height(); 57 | 58 | void codesign(const fs::u8path& path, bool verbose = false); 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/util_scope.hpp: -------------------------------------------------------------------------------- 1 | 2 | #ifndef MAMBA_CORE_UTIL_SCOPE_HPP 3 | #define MAMBA_CORE_UTIL_SCOPE_HPP 4 | 5 | #include 6 | 7 | #include "mamba/core/output.hpp" 8 | 9 | #include "spdlog/spdlog.h" 10 | 11 | namespace mamba 12 | { 13 | 14 | template 15 | struct on_scope_exit 16 | { 17 | F func; 18 | 19 | explicit on_scope_exit(F&& f) 20 | : func(std::forward(f)) 21 | { 22 | } 23 | 24 | ~on_scope_exit() 25 | { 26 | try 27 | { 28 | func(); 29 | } 30 | catch (const std::exception& ex) 31 | { 32 | LOG_ERROR << fmt::format("Scope exit error (caught and ignored): {}", ex.what()); 33 | } 34 | catch (...) 35 | { 36 | LOG_ERROR << "Scope exit unknown error (caught and ignored)"; 37 | } 38 | } 39 | 40 | // Deactivate copy & move until we implement moves 41 | on_scope_exit(const on_scope_exit&) = delete; 42 | on_scope_exit& operator=(const on_scope_exit&) = delete; 43 | on_scope_exit(on_scope_exit&&) = delete; 44 | on_scope_exit& operator=(on_scope_exit&&) = delete; 45 | }; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /libmamba/include/mamba/core/virtual_packages.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_CORE_VIRTUAL_PACKAGES_HPP 8 | #define MAMBA_CORE_VIRTUAL_PACKAGES_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include "mamba/specs/package_info.hpp" 14 | 15 | namespace mamba 16 | { 17 | class Context; 18 | 19 | std::vector get_virtual_packages(const std::string& platform); 20 | 21 | namespace detail 22 | { 23 | std::string cuda_version(); 24 | 25 | auto make_virtual_package( 26 | std::string name, 27 | std::string subdir, 28 | std::string version = "", 29 | std::string build_string = "" 30 | ) -> specs::PackageInfo; 31 | 32 | std::vector dist_packages(const std::string& platform); 33 | } 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /libmamba/include/mamba/download/parameters.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_DOWNLOAD_PARAMETERS_HPP 8 | #define MAMBA_DOWNLOAD_PARAMETERS_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | namespace mamba::download 16 | { 17 | struct RemoteFetchParams 18 | { 19 | // ssl_verify can be either an empty string (regular SSL verification), 20 | // the string "" to indicate no SSL verification, or a path to 21 | // a directory with cert files, or a cert file. 22 | std::string ssl_verify = ""; 23 | bool ssl_no_revoke = false; 24 | bool curl_initialized = false; // non configurable, used in fetch only 25 | 26 | std::string user_agent = ""; 27 | 28 | double connect_timeout_secs = 10.; 29 | // int read_timeout_secs { 60 }; 30 | int retry_timeout = 2; // seconds 31 | int retry_backoff = 3; // retry_timeout * retry_backoff 32 | int max_retries = 3; // max number of retries 33 | 34 | std::map proxy_servers; 35 | }; 36 | 37 | struct Options 38 | { 39 | using termination_function = std::optional>; 40 | 41 | std::size_t download_threads = 1; 42 | bool fail_fast = false; 43 | bool sort = true; 44 | bool verbose = false; 45 | termination_function on_unexpected_termination = std::nullopt; 46 | }; 47 | 48 | } 49 | #endif 50 | -------------------------------------------------------------------------------- /libmamba/include/mamba/solver/libsolv/solver.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_SOLVER_LIBSOLV_SOLVER_HPP 8 | #define MAMBA_SOLVER_LIBSOLV_SOLVER_HPP 9 | 10 | #include "mamba/core/error_handling.hpp" 11 | #include "mamba/solver/libsolv/parameters.hpp" 12 | #include "mamba/solver/libsolv/unsolvable.hpp" 13 | #include "mamba/solver/request.hpp" 14 | #include "mamba/solver/solution.hpp" 15 | 16 | namespace mamba::solver::libsolv 17 | { 18 | class Database; 19 | 20 | class Solver 21 | { 22 | public: 23 | 24 | using Outcome = std::variant; 25 | 26 | [[nodiscard]] auto 27 | solve(Database& database, Request&& request, MatchSpecParser ms_parser = MatchSpecParser::Mixed) 28 | -> expected_t; 29 | 30 | [[nodiscard]] auto 31 | solve(Database& database, const Request& request, MatchSpecParser ms_parser = MatchSpecParser::Mixed) 32 | -> expected_t; 33 | 34 | private: 35 | 36 | auto solve_impl(Database& database, const Request& request, MatchSpecParser ms_parser) 37 | -> expected_t; 38 | }; 39 | } 40 | #endif 41 | -------------------------------------------------------------------------------- /libmamba/include/mamba/specs/error.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_SPECS_ERROR_HPP 8 | #define MAMBA_SPECS_ERROR_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | namespace mamba::specs 16 | { 17 | 18 | struct ParseError final : std::invalid_argument 19 | { 20 | using std::invalid_argument::invalid_argument; 21 | }; 22 | 23 | template 24 | using expected_parse_t = tl::expected; 25 | 26 | template 27 | [[nodiscard]] auto make_unexpected_parse(T&& err) -> tl::unexpected; 28 | 29 | /******************** 30 | * Implementation * 31 | ********************/ 32 | 33 | template 34 | auto make_unexpected_parse(T&& err) -> tl::unexpected 35 | { 36 | return tl::make_unexpected(ParseError(std::forward(err))); 37 | } 38 | } 39 | #endif 40 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/build.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_BUILD_HPP 8 | #define MAMBA_UTIL_BUILD_HPP 9 | 10 | namespace mamba::util 11 | { 12 | #if __APPLE__ || __MACH__ 13 | inline static constexpr bool on_win = false; 14 | inline static constexpr bool on_linux = false; 15 | inline static constexpr bool on_mac = true; 16 | #elif __linux__ 17 | inline static constexpr bool on_win = false; 18 | inline static constexpr bool on_linux = true; 19 | inline static constexpr bool on_mac = false; 20 | #elif _WIN32 21 | inline static constexpr bool on_win = true; 22 | inline static constexpr bool on_linux = false; 23 | inline static constexpr bool on_mac = false; 24 | #else 25 | #error "no supported OS detected" 26 | #endif 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/conditional.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_CONDITIONAL_HPP 8 | #define MAMBA_UTIL_CONDITIONAL_HPP 9 | 10 | #include 11 | 12 | namespace mamba::util 13 | { 14 | 15 | template 16 | [[nodiscard]] auto if_else(bool condition, Int true_val, Int false_val) noexcept -> Int; 17 | 18 | /******************** 19 | * Implementation * 20 | ********************/ 21 | 22 | template 23 | auto if_else(bool condition, Int true_val, Int false_val) noexcept -> Int 24 | { 25 | if constexpr (std::is_enum_v) 26 | { 27 | using int_t = std::underlying_type_t; 28 | return static_cast( 29 | if_else(condition, static_cast(true_val), static_cast(false_val)) 30 | ); 31 | } 32 | else 33 | { 34 | return condition ? true_val : false_val; 35 | } 36 | } 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/deprecation.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_DEPRECATION_HPP 8 | #define MAMBA_UTIL_DEPRECATION_HPP 9 | 10 | #if __cplusplus >= 202002L 11 | #define MAMBA_DEPRECATED_CXX20 [[deprecated("Use C++20 functions with the same name")]] 12 | #else 13 | #define MAMBA_DEPRECATED_CXX20 [[]] 14 | #endif 15 | 16 | #if __cplusplus >= 202302L 17 | #define MAMBA_DEPRECATED_CXX23 [[deprecated("Use C++23 functions with the same name")]] 18 | #else 19 | #define MAMBA_DEPRECATED_CXX23 [[]] 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/functional.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_FUNCTIONAL_HPP 8 | #define MAMBA_UTIL_FUNCTIONAL_HPP 9 | 10 | #include 11 | 12 | #include "mamba/util/deprecation.hpp" 13 | 14 | namespace mamba::util 15 | { 16 | struct MAMBA_DEPRECATED_CXX20 identity 17 | { 18 | template 19 | constexpr auto operator()(T&& t) const noexcept -> T&&; 20 | }; 21 | 22 | /******************************** 23 | * Implementation of identity * 24 | ********************************/ 25 | 26 | template 27 | constexpr auto identity::operator()(T&& t) const noexcept -> T&& 28 | { 29 | return std::forward(t); 30 | } 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/json.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_JSON_HPP 8 | #define MAMBA_UTIL_JSON_HPP 9 | 10 | 11 | #include 12 | 13 | NLOHMANN_JSON_NAMESPACE_BEGIN 14 | 15 | template 16 | struct adl_serializer> 17 | { 18 | static void to_json(json& j, const std::optional& opt) 19 | { 20 | if (opt.has_value()) 21 | { 22 | j = opt.value(); 23 | } 24 | else 25 | { 26 | j = nullptr; 27 | } 28 | } 29 | 30 | static void from_json(const json& j, std::optional& opt) 31 | { 32 | if (!j.is_null()) 33 | { 34 | opt = j.template get(); 35 | } 36 | else 37 | { 38 | opt = std::nullopt; 39 | } 40 | } 41 | }; 42 | 43 | NLOHMANN_JSON_NAMESPACE_END 44 | 45 | namespace mamba::util 46 | { 47 | template 48 | void deserialize_maybe_missing(Json&& j, const char (&name)[N], T& t) 49 | { 50 | if (j.contains(name)) 51 | { 52 | t = std::forward(j)[name].template get(); 53 | } 54 | else 55 | { 56 | t = {}; 57 | } 58 | } 59 | } 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/loop_control.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_LOOP_CONTROL_HPP 8 | #define MAMBA_UTIL_LOOP_CONTROL_HPP 9 | 10 | namespace mamba::util 11 | { 12 | /** 13 | * An enum for breaking out of ``for_each`` loops, used as a poor man range. 14 | */ 15 | enum class LoopControl 16 | { 17 | Break, 18 | Continue, 19 | }; 20 | } 21 | #endif 22 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/os.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_OS_HPP 8 | #define MAMBA_UTIL_OS_HPP 9 | 10 | #include 11 | 12 | namespace mamba::util 13 | { 14 | struct OSError 15 | { 16 | std::string message = {}; 17 | }; 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/os_linux.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_OS_LINUX_HPP 8 | #define MAMBA_UTIL_OS_LINUX_HPP 9 | 10 | #include 11 | 12 | #include 13 | 14 | #include "mamba/util/os.hpp" 15 | 16 | namespace mamba::util 17 | { 18 | [[nodiscard]] auto linux_version() -> tl::expected; 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/os_osx.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_OS_OSX_HPP 8 | #define MAMBA_UTIL_OS_OSX_HPP 9 | 10 | #include 11 | 12 | #include 13 | 14 | #include "mamba/util/os.hpp" 15 | 16 | namespace mamba::util 17 | { 18 | [[nodiscard]] auto osx_version() -> tl::expected; 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/os_unix.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_OS_UNIX_HPP 8 | #define MAMBA_UTIL_OS_UNIX_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include "mamba/util/os.hpp" 16 | 17 | namespace mamba::util 18 | { 19 | [[nodiscard]] auto unix_name_version() 20 | -> tl::expected, OSError>; 21 | } 22 | #endif 23 | -------------------------------------------------------------------------------- /libmamba/include/mamba/util/os_win.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTIL_OS_WIN_HPP 8 | #define MAMBA_UTIL_OS_WIN_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | #include "mamba/util/os.hpp" 16 | 17 | namespace mamba::util 18 | { 19 | enum class WindowsKnowUserFolder 20 | { 21 | Documents, 22 | Profile, 23 | Programs, 24 | ProgramData, 25 | LocalAppData, 26 | RoamingAppData, 27 | }; 28 | 29 | [[nodiscard]] auto get_windows_known_user_folder(WindowsKnowUserFolder dir) -> std::string; 30 | 31 | [[nodiscard]] auto utf8_to_windows_encoding(const std::string_view utf8_text) -> std::wstring; 32 | 33 | [[nodiscard]] auto windows_encoding_to_utf8(std::wstring_view) -> std::string; 34 | 35 | [[nodiscard]] auto windows_version() -> tl::expected; 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /libmamba/include/mamba/version.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef LIBMAMBA_VERSION_HPP 8 | #define LIBMAMBA_VERSION_HPP 9 | 10 | #include 11 | #include 12 | 13 | #define LIBMAMBA_VERSION_MAJOR 2 14 | #define LIBMAMBA_VERSION_MINOR 1 15 | #define LIBMAMBA_VERSION_PATCH 1 16 | #define LIBMAMBA_VERSION_IS_PRERELEASE 0 17 | #if LIBMAMBA_VERSION_IS_PRERELEASE == 1 18 | #define LIBMAMBA_VERSION_PRERELEASE_NAME "" 19 | #endif 20 | 21 | #define LIBMAMBA_VERSION_STRING "2.1.1" 22 | #define LIBMAMBA_VERSION \ 23 | (LIBMAMBA_VERSION_MAJOR * 10000 + LIBMAMBA_VERSION_MINOR * 100 + LIBMAMBA_VERSION_PATCH) 24 | 25 | // Binary version 26 | #define LIBMAMBA_BINARY_CURRENT 3 27 | #define LIBMAMBA_BINARY_REVISION 0 28 | #define LIBMAMBA_BINARY_AGE 0 29 | 30 | namespace mamba 31 | { 32 | std::string version(); 33 | 34 | [[deprecated("will be replaced in a future minor version")]] 35 | std::array version_arr(); 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /libmamba/include/mamba/version.hpp.tmpl: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef LIBMAMBA_VERSION_HPP 8 | #define LIBMAMBA_VERSION_HPP 9 | 10 | #include 11 | #include 12 | 13 | #define LIBMAMBA_VERSION_MAJOR {{ version_major }} 14 | #define LIBMAMBA_VERSION_MINOR {{ version_minor }} 15 | #define LIBMAMBA_VERSION_PATCH {{ version_patch }} 16 | #define LIBMAMBA_VERSION_IS_PRERELEASE {{ version_is_prerelease }} 17 | #if LIBMAMBA_VERSION_IS_PRERELEASE == 1 18 | #define LIBMAMBA_VERSION_PRERELEASE_NAME "{{ version_prerelease_name }}" 19 | #endif 20 | 21 | #define LIBMAMBA_VERSION_STRING "{{ version_name }}" 22 | #define LIBMAMBA_VERSION \ 23 | (LIBMAMBA_VERSION_MAJOR * 10000 + LIBMAMBA_VERSION_MINOR * 100 + LIBMAMBA_VERSION_PATCH) 24 | 25 | // Binary version 26 | #define LIBMAMBA_BINARY_CURRENT 3 27 | #define LIBMAMBA_BINARY_REVISION 0 28 | #define LIBMAMBA_BINARY_AGE 0 29 | 30 | namespace mamba 31 | { 32 | std::string version(); 33 | 34 | [[deprecated("will be replaced in a future minor version")]] 35 | std::array version_arr(); 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /libmamba/longpath.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /libmamba/src/api/utils.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_UTILS_HPP 8 | #define MAMBA_UTILS_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | #include "tl/expected.hpp" 15 | 16 | namespace mamba 17 | { 18 | class Context; 19 | 20 | namespace detail 21 | { 22 | struct other_pkg_mgr_spec; 23 | } 24 | 25 | namespace pip 26 | { 27 | enum class Update : bool 28 | { 29 | No = false, 30 | Yes = true, 31 | }; 32 | } 33 | 34 | using command_args = std::vector; 35 | 36 | tl::expected install_for_other_pkgmgr( 37 | const Context& ctx, 38 | const detail::other_pkg_mgr_spec& other_spec, 39 | pip::Update update 40 | ); 41 | 42 | void 43 | populate_context_channels_from_specs(const std::vector& raw_matchspecs, Context& context); 44 | 45 | } 46 | 47 | #endif // MAMBA_UTILS_HPP 48 | -------------------------------------------------------------------------------- /libmamba/src/core/execution.cpp: -------------------------------------------------------------------------------- 1 | #include "mamba/core/execution.hpp" 2 | #include "mamba/core/invoke.hpp" 3 | #include "mamba/core/output.hpp" 4 | 5 | namespace mamba 6 | { 7 | // NOTE: see singleton.cpp for other functions and why they are located there instead of here 8 | 9 | void MainExecutor::invoke_close_handlers() 10 | { 11 | std::scoped_lock lock{ handlers_mutex }; 12 | for (auto&& handler : close_handlers) 13 | { 14 | const auto result = safe_invoke(handler); 15 | if (!result) 16 | { 17 | LOG_ERROR << "main executor close handler failed (ignored): " 18 | << result.error().what(); 19 | } 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /libmamba/src/core/timeref.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | namespace mamba::validation 5 | { 6 | 7 | TimeRef::TimeRef(const std::time_t& time) 8 | : m_time_ref(time) 9 | { 10 | } 11 | 12 | TimeRef::TimeRef() 13 | : TimeRef(mamba::utc_time_now()) 14 | { 15 | } 16 | 17 | void TimeRef::set(const std::time_t& time) 18 | { 19 | m_time_ref = time; 20 | } 21 | 22 | void TimeRef::set_now() 23 | { 24 | m_time_ref = mamba::utc_time_now(); 25 | } 26 | 27 | std::string TimeRef::timestamp() const 28 | { 29 | return mamba::timestamp(m_time_ref); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /libmamba/src/download/request.cpp: -------------------------------------------------------------------------------- 1 | #include "mamba/download/request.hpp" 2 | 3 | namespace mamba::download 4 | { 5 | RequestBase::RequestBase( 6 | std::string_view lname, 7 | std::optional lfilename, 8 | bool lcheck_only, 9 | bool lignore_failure 10 | ) 11 | : name(lname) 12 | , filename(lfilename) 13 | , check_only(lcheck_only) 14 | , ignore_failure(lignore_failure) 15 | { 16 | } 17 | 18 | Request::Request( 19 | std::string_view lname, 20 | MirrorName lmirror_name, 21 | std::string_view lurl_path, 22 | std::optional lfilename, 23 | bool lcheck_only, 24 | bool lignore_failure 25 | ) 26 | : RequestBase(lname, std::move(lfilename), lcheck_only, lignore_failure) 27 | , mirror_name(lmirror_name) 28 | , url_path(lurl_path) 29 | { 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /libmamba/src/solver/helpers.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include "solver/helpers.hpp" 8 | 9 | namespace mamba::solver 10 | { 11 | auto find_new_python_in_solution(const Solution& solution) 12 | -> std::optional> 13 | { 14 | auto out = std::optional>{}; 15 | for_each_to_install( 16 | solution.actions, 17 | [&](const auto& pkg) 18 | { 19 | if (pkg.name == "python") 20 | { 21 | out = std::cref(pkg); 22 | return util::LoopControl::Break; 23 | } 24 | return util::LoopControl::Continue; 25 | } 26 | ); 27 | return out; 28 | } 29 | 30 | auto python_binary_compatible(const specs::Version& older, const specs::Version& newer) -> bool 31 | { 32 | // Python binary compatibility is defined at the same MINOR level. 33 | return older.compatible_with(newer, /* level= */ 2); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /libmamba/src/solver/helpers.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_SOLVER_HELPERS_HPP 8 | #define MAMBA_SOLVER_HELPERS_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include "mamba/solver/solution.hpp" 14 | #include "mamba/specs/version.hpp" 15 | 16 | /** 17 | * Solver, repo, and package helpers for solver agnostic code. 18 | */ 19 | 20 | namespace mamba::solver 21 | { 22 | [[nodiscard]] auto find_new_python_in_solution(const Solution& solution) 23 | -> std::optional>; 24 | 25 | [[nodiscard]] auto python_binary_compatible( // 26 | const specs::Version& older, 27 | const specs::Version& newer 28 | ) -> bool; 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /libmamba/src/solver/libsolv/parameters.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include "mamba/solver/libsolv/parameters.hpp" 12 | #include "mamba/util/string.hpp" 13 | 14 | namespace mamba::solver::libsolv 15 | { 16 | namespace 17 | { 18 | auto attrs(const Priorities& p) 19 | { 20 | return std::tie(p.priority, p.subpriority); 21 | } 22 | } 23 | 24 | auto operator==(const Priorities& lhs, const Priorities& rhs) -> bool 25 | { 26 | return attrs(lhs) == attrs(rhs); 27 | } 28 | 29 | auto operator!=(const Priorities& lhs, const Priorities& rhs) -> bool 30 | { 31 | return !(lhs == rhs); 32 | } 33 | 34 | auto operator==(const RepodataOrigin& lhs, const RepodataOrigin& rhs) -> bool 35 | { 36 | return (util::rstrip(lhs.url, '/') == util::rstrip(rhs.url, '/')) && (lhs.etag == rhs.etag) 37 | && (lhs.mod == rhs.mod); 38 | } 39 | 40 | auto operator!=(const RepodataOrigin& lhs, const RepodataOrigin& rhs) -> bool 41 | { 42 | return !(lhs == rhs); 43 | } 44 | 45 | void to_json(nlohmann::json& j, const RepodataOrigin& m) 46 | { 47 | j["url"] = m.url; 48 | j["etag"] = m.etag; 49 | j["mod"] = m.mod; 50 | } 51 | 52 | void from_json(const nlohmann::json& j, RepodataOrigin& p) 53 | { 54 | p.url = j.value("url", ""); 55 | p.etag = j.value("etag", ""); 56 | p.mod = j.value("mod", ""); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /libmamba/src/solver/libsolv/repo_info.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | #include 9 | 10 | #include "mamba/solver/libsolv/repo_info.hpp" 11 | #include "solv-cpp/repo.hpp" 12 | 13 | namespace mamba::solver::libsolv 14 | { 15 | RepoInfo::RepoInfo(::Repo* repo) 16 | : m_ptr(repo) 17 | { 18 | } 19 | 20 | auto RepoInfo::name() const -> std::string_view 21 | { 22 | return solv::ObjRepoViewConst(*m_ptr).name(); 23 | } 24 | 25 | auto RepoInfo::priority() const -> Priorities 26 | { 27 | static_assert(std::is_same_vpriority), Priorities::value_type>); 28 | return { /* .priority= */ m_ptr->priority, /* .subpriority= */ m_ptr->subpriority }; 29 | } 30 | 31 | auto RepoInfo::package_count() const -> std::size_t 32 | { 33 | return solv::ObjRepoViewConst(*m_ptr).solvable_count(); 34 | } 35 | 36 | auto RepoInfo::id() const -> RepoId 37 | { 38 | static_assert(std::is_same_v); 39 | return solv::ObjRepoViewConst(*m_ptr).id(); 40 | } 41 | 42 | auto operator==(RepoInfo lhs, RepoInfo rhs) -> bool 43 | { 44 | return lhs.m_ptr == rhs.m_ptr; 45 | } 46 | 47 | auto operator!=(RepoInfo lhs, RepoInfo rhs) -> bool 48 | { 49 | return !(rhs == lhs); 50 | } 51 | } // namespace mamba 52 | -------------------------------------------------------------------------------- /libmamba/src/specs/version_spec_impl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MAMBA_SPECS_VERSION_SPEC_IMPL_HPP 2 | #define MAMBA_SPECS_VERSION_SPEC_IMPL_HPP 3 | 4 | 5 | #include "mamba/specs/version.hpp" 6 | #include "mamba/specs/version_spec.hpp" 7 | 8 | namespace mamba::specs 9 | { 10 | /** 11 | * Formatting of ``VersionSpec`` version glob relies on special handling in ``Version`` 12 | * formatter. 13 | * Said behaviour should not be surprising, this file however serves to make it clear why and 14 | * how this functionality was added to ``Version``. 15 | */ 16 | 17 | inline static const auto VERSION_GLOB_SEGMENT = VersionPart( 18 | { { 0, VersionSpec::glob_pattern_str } } 19 | ); 20 | 21 | inline static constexpr std::string_view GLOB_PATTERN_STR = VersionSpec::glob_pattern_str; 22 | } 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /libmamba/src/util/cryptography.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include "mamba/util/cryptography.hpp" 13 | 14 | namespace mamba::util::detail 15 | { 16 | void EVPDigester::EVPContextDeleter::operator()(::EVP_MD_CTX* ptr) const 17 | { 18 | if (ptr) 19 | { 20 | ::EVP_MD_CTX_destroy(ptr); 21 | } 22 | } 23 | 24 | EVPDigester::EVPDigester(Algorithm algo) 25 | : m_algorithm(algo) 26 | { 27 | m_ctx.reset(::EVP_MD_CTX_create()); 28 | } 29 | 30 | void EVPDigester::digest_start() 31 | { 32 | [[maybe_unused]] int status = 0; 33 | switch (m_algorithm) 34 | { 35 | case (Algorithm::sha256): 36 | { 37 | status = ::EVP_DigestInit_ex(m_ctx.get(), EVP_sha256(), nullptr); 38 | break; 39 | } 40 | case (Algorithm::md5): 41 | { 42 | status = ::EVP_DigestInit_ex(m_ctx.get(), EVP_md5(), nullptr); 43 | break; 44 | } 45 | } 46 | assert(status != 0); 47 | } 48 | 49 | void EVPDigester::digest_update(const std::byte* buffer, std::size_t count) 50 | { 51 | ::EVP_DigestUpdate(m_ctx.get(), buffer, count); 52 | } 53 | 54 | void EVPDigester::digest_finalize_to(std::byte* hash) 55 | { 56 | ::EVP_DigestFinal_ex(m_ctx.get(), reinterpret_cast(hash), nullptr); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /libmamba/src/util/os_linux.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include "mamba/util/os_linux.hpp" 12 | #include "mamba/util/os_unix.hpp" 13 | 14 | namespace mamba::util 15 | { 16 | auto linux_version() -> tl::expected 17 | { 18 | return unix_name_version().and_then( 19 | [](auto&& name_version) -> tl::expected 20 | { 21 | if (name_version.first != "Linux") 22 | { 23 | return tl::make_unexpected(OSError{ 24 | fmt::format(R"(OS "{}" is not Linux)", name_version.first), 25 | }); 26 | } 27 | return { std::forward(name_version).second }; 28 | } 29 | ); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /libmamba/src/util/os_osx.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | #include "mamba/util/os_osx.hpp" 13 | #include "mamba/util/string.hpp" 14 | 15 | namespace mamba::util 16 | { 17 | auto osx_version() -> tl::expected 18 | { 19 | // Note: we could also inspect /System/Library/CoreServices/SystemVersion.plist which is 20 | // an XML file that contains the same information. 21 | // However, then we'd either need an xml parser or some other crude method to read the data 22 | 23 | static constexpr auto args = std::array{ "sw_vers", "-productVersion" }; 24 | 25 | auto out = std::string(); 26 | auto err = std::string(); 27 | 28 | auto [status, ec] = reproc::run( 29 | args, 30 | reproc::options{}, 31 | reproc::sink::string(out), 32 | reproc::sink::string(err) 33 | ); 34 | 35 | if (ec) 36 | { 37 | return tl::make_unexpected(OSError{ fmt::format( 38 | R"(Could not find macOS version by calling "sw_vers -productVersion": {})", 39 | ec.message() 40 | ) }); 41 | } 42 | 43 | return { std::string(util::strip(out)) }; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /libmamba/src/util/os_unix.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include "mamba/util/os_unix.hpp" 12 | 13 | #ifndef _WIN32 14 | #include 15 | #endif 16 | 17 | namespace mamba::util 18 | { 19 | #ifndef _WIN32 20 | 21 | auto unix_name_version() -> tl::expected, OSError> 22 | { 23 | struct ::utsname uname_result = {}; 24 | const auto ret = ::uname(&uname_result); 25 | if (ret != 0) 26 | { 27 | return tl::make_unexpected(OSError{ fmt::format( 28 | "Error calling uname: {}", 29 | std::system_error(errno, std::generic_category()).what() 30 | ) }); 31 | } 32 | 33 | static const auto re = std::regex(R"r(([0-9]+\.[0-9]+\.[0-9]+)(?:-.*)?)r"); 34 | 35 | if (auto m = std::cmatch(); std::regex_search(uname_result.release, m, re) && (m.size() == 2)) 36 | { 37 | return { { uname_result.sysname, std::move(m)[1].str() } }; 38 | } 39 | 40 | return tl::make_unexpected(OSError{ 41 | fmt::format(R"(Could not parse Linux version in uname output "{}")", uname_result.release) } 42 | ); 43 | } 44 | 45 | #else 46 | 47 | auto unix_name_version() -> tl::expected, OSError> 48 | { 49 | return tl::make_unexpected(OSError{ "Cannot get Linux version on this system" }); 50 | } 51 | 52 | #endif 53 | } 54 | -------------------------------------------------------------------------------- /libmamba/src/util/random.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include "mamba/util/random.hpp" 8 | 9 | namespace mamba ::util 10 | { 11 | template auto random_generator() -> default_random_generator; 12 | 13 | template auto local_random_generator() -> default_random_generator&; 14 | 15 | template auto generate_random_alphanumeric_string( 16 | std::size_t len, 17 | default_random_generator& generator 18 | ) -> std::string; 19 | } 20 | -------------------------------------------------------------------------------- /libmamba/src/version.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include "mamba/version.hpp" 8 | 9 | namespace mamba 10 | { 11 | std::string version() 12 | { 13 | return LIBMAMBA_VERSION_STRING; 14 | } 15 | 16 | std::array version_arr() 17 | { 18 | return { LIBMAMBA_VERSION_MAJOR, LIBMAMBA_VERSION_MINOR, LIBMAMBA_VERSION_PATCH }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /libmamba/tests/data/config/.condarc: -------------------------------------------------------------------------------- 1 | channels: 2 | - https://repo.mamba.pm/conda-forge 3 | 4 | 5 | # See: https://github.com/mamba-org/mamba/issues/2934 6 | remote_connect_timeout_secs: 9.15 7 | -------------------------------------------------------------------------------- /libmamba/tests/data/env_file/env_1.yaml: -------------------------------------------------------------------------------- 1 | name: env_1 2 | channels: [conda-forge, bioconda] 3 | dependencies: 4 | - test1 5 | - test2 6 | - test3 7 | -------------------------------------------------------------------------------- /libmamba/tests/data/env_file/env_2.yaml: -------------------------------------------------------------------------------- 1 | name: env_2 2 | channels: 3 | - conda-forge 4 | - bioconda 5 | dependencies: 6 | - sel(win): test1-win 7 | - sel(unix): test1-unix 8 | - sel(linux): test1-linux 9 | - sel(linux): test2-linux 10 | - sel(osx): test1-osx 11 | - test4 12 | -------------------------------------------------------------------------------- /libmamba/tests/data/env_file/env_3.yaml: -------------------------------------------------------------------------------- 1 | name: env_3 2 | channels: [conda-forge, bioconda] 3 | dependencies: 4 | - test1 5 | - test2 6 | - test3 7 | - pip: 8 | - pytest 9 | - numpy 10 | -------------------------------------------------------------------------------- /libmamba/tests/data/env_file/env_4.yaml: -------------------------------------------------------------------------------- 1 | name: env_4 2 | channels: [conda-forge, bioconda] 3 | dependencies: 4 | - test1 5 | - test2 6 | - uv 7 | - pip: 8 | - pytest 9 | - numpy 10 | -------------------------------------------------------------------------------- /libmamba/tests/data/env_lockfile/bad_package-lock.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | 3 | package: 4 | - category: main 5 | dependencies: {} 6 | ## Commented out some fields to make it an incomplete definition 7 | # hash: 8 | # md5: d7c89558ba9fa0495403155b64376d81 9 | # sha256: fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726 10 | # manager: conda 11 | # optional: false 12 | name: _libgcc_mutex 13 | platform: linux-64 14 | url: https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2 15 | version: "0.1" 16 | -------------------------------------------------------------------------------- /libmamba/tests/data/env_lockfile/bad_version-lock.yaml: -------------------------------------------------------------------------------- 1 | version: -1 2 | -------------------------------------------------------------------------------- /libmamba/tests/data/env_lockfile/good_no_package-lock.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | 3 | # TODO: change the metadata to make them valid/matching actual locked env 4 | metadata: 5 | channels: 6 | - url: conda-forge 7 | used_env_vars: [] 8 | - url: defaults 9 | used_env_vars: [] 10 | content_hash: 11 | linux-64: 1173e3c96ce20d063a5701b325b76deb97394f891af270af4ee0cb7cc1f6e838 12 | osx-64: d01c1f5433f30bdbcd3bdad8d9b096774ab55f1210c094acdc61a35b32b28d67 13 | win-64: 310b23581083bfb983927c40d3bdc86162192d7b26ffd7bffc385f627c155697 14 | platforms: 15 | - linux-64 16 | - osx-64 17 | - win-64 18 | sources: 19 | - environment.yml 20 | 21 | package: 22 | -------------------------------------------------------------------------------- /libmamba/tests/data/env_lockfile/good_one_package-lock.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | 3 | # TODO: change the metadata to make them valid/matching actual locked env 4 | metadata: 5 | channels: 6 | - url: conda-forge 7 | used_env_vars: [] 8 | - url: defaults 9 | used_env_vars: [] 10 | content_hash: 11 | linux-64: 1173e3c96ce20d063a5701b325b76deb97394f891af270af4ee0cb7cc1f6e838 12 | osx-64: d01c1f5433f30bdbcd3bdad8d9b096774ab55f1210c094acdc61a35b32b28d67 13 | win-64: 310b23581083bfb983927c40d3bdc86162192d7b26ffd7bffc385f627c155697 14 | platforms: 15 | - linux-64 16 | - osx-64 17 | - win-64 18 | sources: 19 | - environment.yml 20 | 21 | package: 22 | - category: main 23 | dependencies: 24 | vc: ">=14.1,<15.0a0" 25 | vs2015_runtime: ">=14.16.27012" 26 | hash: 27 | md5: b28dd2488b4e5f892c67071acc1d0a8c 28 | sha256: 5b7e002932c0138d78d251caae0c571d13f857ff90e7ce21d58d67073381250e 29 | manager: conda 30 | name: libzlib 31 | optional: false 32 | platform: win-64 33 | url: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.2.11-h8ffe710_1013.tar.bz2 34 | version: 1.2.11 35 | -------------------------------------------------------------------------------- /libmamba/tests/data/env_lockfile/good_one_package_missing_category-lock.yaml: -------------------------------------------------------------------------------- 1 | version: 1 2 | 3 | # TODO: change the metadata to make them valid/matching actual locked env 4 | metadata: 5 | channels: 6 | - url: conda-forge 7 | used_env_vars: [] 8 | - url: defaults 9 | used_env_vars: [] 10 | content_hash: 11 | linux-64: 1173e3c96ce20d063a5701b325b76deb97394f891af270af4ee0cb7cc1f6e838 12 | osx-64: d01c1f5433f30bdbcd3bdad8d9b096774ab55f1210c094acdc61a35b32b28d67 13 | win-64: 310b23581083bfb983927c40d3bdc86162192d7b26ffd7bffc385f627c155697 14 | platforms: 15 | - linux-64 16 | - osx-64 17 | - win-64 18 | sources: 19 | - environment.yml 20 | 21 | package: 22 | - dependencies: 23 | vc: ">=14.1,<15.0a0" 24 | vs2015_runtime: ">=14.16.27012" 25 | hash: 26 | md5: b28dd2488b4e5f892c67071acc1d0a8c 27 | sha256: 5b7e002932c0138d78d251caae0c571d13f857ff90e7ce21d58d67073381250e 28 | manager: conda 29 | name: libzlib 30 | optional: false 31 | platform: win-64 32 | url: https://conda.anaconda.org/conda-forge/win-64/libzlib-1.2.11-h8ffe710_1013.tar.bz2 33 | version: 1.2.11 34 | -------------------------------------------------------------------------------- /libmamba/tests/data/repodata/conda-forge-repodata-version-2-missing-base_url.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "_libgcc_mutex-0.1-conda_forge.tar.bz2": { 7 | "build": "conda_forge", 8 | "build_number": 0, 9 | "build_string": "conda_forge", 10 | "constrains": null, 11 | "depends": null, 12 | "fn": "_libgcc_mutex-0.1-conda_forge.tar.bz2", 13 | "license": "None", 14 | "md5": "d7c89558ba9fa0495403155b64376d81", 15 | "name": "_libgcc_mutex", 16 | "sha256": "fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726", 17 | "size": 2562, 18 | "subdir": "linux-64", 19 | "timestamp": 1578324546, 20 | "track_features": "", 21 | "url": "https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2", 22 | "version": "0.1" 23 | } 24 | }, 25 | "packages.conda": { 26 | "bzip2-1.0.8-hd590300_5.conda": { 27 | "build": "hd590300_5", 28 | "build_number": 5, 29 | "build_string": "hd590300_5", 30 | "constrains": null, 31 | "depends": ["libgcc-ng >=12"], 32 | "fn": "bzip2-1.0.8-hd590300_5.conda", 33 | "license": "bzip2-1.0.6", 34 | "md5": "69b8b6202a07720f448be700e300ccf4", 35 | "name": "bzip2", 36 | "sha256": "242c0c324507ee172c0e0dd2045814e746bb303d1eb78870d182ceb0abc726a8", 37 | "size": 254228, 38 | "subdir": "linux-64", 39 | "timestamp": 1699279927, 40 | "track_features": "", 41 | "url": "https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hd590300_5.conda", 42 | "version": "1.0.8" 43 | } 44 | }, 45 | "repodata_version": 2 46 | } 47 | -------------------------------------------------------------------------------- /libmamba/tests/data/repodata/conda-forge-repodata-version-2.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "base_url": "https://repo.anaconda.com/repo/main/linux-64/", 4 | "subdir": "linux-64" 5 | }, 6 | "packages": { 7 | "_libgcc_mutex-0.1-conda_forge.tar.bz2": { 8 | "build": "conda_forge", 9 | "build_number": 0, 10 | "build_string": "conda_forge", 11 | "constrains": null, 12 | "depends": null, 13 | "fn": "_libgcc_mutex-0.1-conda_forge.tar.bz2", 14 | "license": "None", 15 | "md5": "d7c89558ba9fa0495403155b64376d81", 16 | "name": "_libgcc_mutex", 17 | "sha256": "fe51de6107f9edc7aa4f786a70f4a883943bc9d39b3bb7307c04c41410990726", 18 | "size": 2562, 19 | "subdir": "linux-64", 20 | "timestamp": 1578324546, 21 | "track_features": "", 22 | "url": "https://conda.anaconda.org/conda-forge/linux-64/_libgcc_mutex-0.1-conda_forge.tar.bz2", 23 | "version": "0.1" 24 | } 25 | }, 26 | "packages.conda": { 27 | "bzip2-1.0.8-hd590300_5.conda": { 28 | "build": "hd590300_5", 29 | "build_number": 5, 30 | "build_string": "hd590300_5", 31 | "constrains": null, 32 | "depends": ["libgcc-ng >=12"], 33 | "fn": "bzip2-1.0.8-hd590300_5.conda", 34 | "license": "bzip2-1.0.6", 35 | "md5": "69b8b6202a07720f448be700e300ccf4", 36 | "name": "bzip2", 37 | "sha256": "242c0c324507ee172c0e0dd2045814e746bb303d1eb78870d182ceb0abc726a8", 38 | "size": 254228, 39 | "subdir": "linux-64", 40 | "timestamp": 1699279927, 41 | "track_features": "", 42 | "url": "https://conda.anaconda.org/conda-forge/linux-64/bzip2-1.0.8-hd590300_5.conda", 43 | "version": "1.0.8" 44 | } 45 | }, 46 | "repodata_version": 2 47 | } 48 | -------------------------------------------------------------------------------- /libmamba/tests/data/repodata_json_cache/test_2.json: -------------------------------------------------------------------------------- 1 | {"_mod":"Fri, 11 Feb 2022 13:52:44 GMT","_url":"file:///Users/wolfvollprecht/Programs/mamba/mamba/tests/channel_a/linux-64/repodata.json", 2 | "info": { 3 | "subdir": "linux-64" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /libmamba/tests/data/repodata_json_cache/test_3.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /libmamba/tests/data/repodata_json_cache/test_4.json: -------------------------------------------------------------------------------- 1 | {"_cache_control":"{{}}\",,,\"","_etag":"\n\n\"\"random ecx,,ssd\n,,\"","_mod":"Fri, 11 Feb 2022 13:52:44 GMT","_url":"file:///Users/wolfvollprecht/Programs/mamba/mamba/tests/channel_a/linux-64/repodata.json", 2 | "info": { 3 | "subdir": "linux-64" 4 | } 5 | } -------------------------------------------------------------------------------- /libmamba/tests/data/repodata_json_cache/test_5.json: -------------------------------------------------------------------------------- 1 | {"_mod":"Fri, 11 Feb 2022 13:52:44 GMT","_url":"file:///Users/wolfvollprecht/Programs/mamba/mamba/tests/channel_a/linux-64/repodata.json" , 2 | ",,info": { 3 | "subdir": "linux-64" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /libmamba/tests/data/repodata_json_cache/test_6.json: -------------------------------------------------------------------------------- 1 | {"_url": "https://conda.anaconda.org/intake/osx-arm64", "_mod": "Thu, 02 Apr 2020 20:21:27 GMT", "info":{"platform":"osx","default_python_version":"2.7","arch":"arm64","subdir":"osx-arm64","default_numpy_version":"1.7"},"packages":{}} -------------------------------------------------------------------------------- /libmamba/tests/data/repodata_json_cache/test_7.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | } 5 | } -------------------------------------------------------------------------------- /libmamba/tests/data/repodata_json_cache/test_7.state.json: -------------------------------------------------------------------------------- 1 | { 2 | "cache_control": "something", 3 | "etag": "something else", 4 | "file_mtime": { 5 | "nanoseconds": 170463081, 6 | "seconds": 1673263108 7 | }, 8 | "file_size": 44, 9 | "has_zst": { 10 | "last_checked": "2023-01-06T16:33:06Z", 11 | "value": true 12 | }, 13 | "mod": "Fri, 11 Feb 2022 13:52:44 GMT", 14 | "url": "https://conda.anaconda.org/conda-forge/noarch/repodata.json.zst" 15 | } -------------------------------------------------------------------------------- /libmamba/tests/data/validation/1.sv0.6.root.json: -------------------------------------------------------------------------------- 1 | { 2 | "signatures": { 3 | "2b920f88531576643ada0a632915d1dcdd377557647093f29cbe251ba8c33724": { 4 | "other_headers": "04001608001d1621040673d781a8b80bcb7b002040ac7bc8bcf821360d050260a52453", 5 | "signature": "d891de3fc102a2ff7b96559ff2f4d81a8e25b5d51a44e10a9fbc5bdc3febf22120582f30e26f6dfe9450ca8100566af7cbc286bf7f52c700d074acd3d4a01603" 6 | } 7 | }, 8 | "signed": { 9 | "delegations": { 10 | "key_mgr": { 11 | "pubkeys": [ 12 | "013ddd714962866d12ba5bae273f14d48c89cf0773dee2dbf6d4561e521c83f7" 13 | ], 14 | "threshold": 1 15 | }, 16 | "root": { 17 | "pubkeys": [ 18 | "2b920f88531576643ada0a632915d1dcdd377557647093f29cbe251ba8c33724" 19 | ], 20 | "threshold": 1 21 | } 22 | }, 23 | "expiration": "2022-05-19T14:44:35Z", 24 | "metadata_spec_version": "0.6.0", 25 | "timestamp": "2021-05-19T14:44:35Z", 26 | "type": "root", 27 | "version": 1 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /libmamba/tests/data/validation/root copy.json: -------------------------------------------------------------------------------- 1 | { 2 | "signatures": [ 3 | { 4 | "keyid": "foo", 5 | "sig": "..." 6 | } 7 | ], 8 | "signed": { 9 | "_type": "root", 10 | "roles": { 11 | "root": { 12 | "keyids": ["foo"], 13 | "threshold": 1 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /libmamba/tests/src/catch-utils/conda_url.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | #pragma once 7 | 8 | #include 9 | 10 | #include 11 | 12 | #include "mamba/specs/conda_url.hpp" 13 | 14 | namespace Catch 15 | { 16 | template <> 17 | struct StringMaker 18 | { 19 | static std::string convert(const mamba::specs::CondaURL& value) 20 | { 21 | return value.str(); 22 | } 23 | }; 24 | } 25 | -------------------------------------------------------------------------------- /libmamba/tests/src/catch-utils/msvc_catch_byte.cpp: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | 3 | // Catch compiled on `conda-forge` for MSVC doesn't support outputting `std::byte`. 4 | // So we have to define StringMaker for it ourselves. 5 | // The declaration is present though, so this only causes link errors. 6 | 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace Catch 13 | { 14 | 15 | std::string StringMaker::convert(std::byte value) 16 | { 17 | return fmt::format("{}", value); 18 | } 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /libmamba/tests/src/catch-utils/msvc_catch_string_view.cpp: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | 3 | // Catch compiled on `conda-forge` for MSVC doesn't support outputting `string_view`. 4 | // So we have to define StringMaker for it ourselves. 5 | // The declaration is present though, so this only causes link errors. 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | namespace Catch 13 | { 14 | 15 | std::string StringMaker::convert(std::string_view str) 16 | { 17 | return std::string(str); 18 | } 19 | 20 | } 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /libmamba/tests/src/core/test_activation.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "mamba/core/activation.hpp" 4 | #include "mamba/core/context.hpp" 5 | 6 | #include "mambatests.hpp" 7 | 8 | namespace mamba 9 | { 10 | namespace 11 | { 12 | TEST_CASE("activation") 13 | { 14 | PosixActivator activator{ mambatests::context() }; 15 | // std::cout << a.add_prefix_to_path("/home/wolfv/miniconda3", 0) << 16 | // std::endl; std::cout << a.activate("/home/wolfv/miniconda3/", false) << 17 | // std::endl; 18 | } 19 | 20 | TEST_CASE("Activator::get_default_env") 21 | { 22 | Context ctx; 23 | ctx.prefix_params.root_prefix = "/home/user/miniforge"; 24 | PosixActivator a(ctx); 25 | REQUIRE(a.get_default_env("/home/user/miniforge") == "base"); 26 | REQUIRE(a.get_default_env("/home/user/miniforge/envs/env") == "env"); 27 | REQUIRE(a.get_default_env("/home/user/miniforge/envs/an.env") == "an.env"); 28 | REQUIRE(a.get_default_env("/home/user/miniforge/envs/an-oth.er") == "an-oth.er"); 29 | REQUIRE(a.get_default_env("/opt/envs/yet.an-oth.er") == "yet.an-oth.er"); 30 | 31 | const fs::u8path& alternative_folder = "/opt/envs.d/env"; 32 | REQUIRE(a.get_default_env(alternative_folder) == alternative_folder); 33 | 34 | const fs::u8path& alt_folder = "/home/user/some/env"; 35 | REQUIRE(a.get_default_env(alt_folder) == alt_folder); 36 | } 37 | } 38 | } // namespace mamba 39 | -------------------------------------------------------------------------------- /libmamba/tests/src/core/test_output.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include "mamba/core/context.hpp" 10 | #include "mamba/core/output.hpp" 11 | 12 | #include "mambatests.hpp" 13 | 14 | namespace mamba 15 | { 16 | namespace 17 | { 18 | TEST_CASE("no_progress_bars") 19 | { 20 | mambatests::context().graphics_params.no_progress_bars = true; 21 | auto proxy = Console::instance().add_progress_bar("conda-forge"); 22 | REQUIRE_FALSE(proxy.defined()); 23 | REQUIRE_FALSE(proxy); 24 | 25 | mambatests::context().graphics_params.no_progress_bars = false; 26 | proxy = Console::instance().add_progress_bar("conda-forge"); 27 | REQUIRE(proxy.defined()); 28 | REQUIRE(proxy); 29 | } 30 | } 31 | } // namespace mamba 32 | -------------------------------------------------------------------------------- /libmamba/tests/src/core/test_shell_init.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2022, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | namespace mamba 10 | { 11 | namespace 12 | { 13 | TEST_CASE("init") 14 | { 15 | // std::cout << rcfile_content("/home/wolfv/miniconda3/", "bash"); 16 | } 17 | 18 | TEST_CASE("bashrc_modifications") 19 | { 20 | // modify_rc_file("/home/wolfv/Programs/mamba/test/.bashrc", 21 | // "/home/wolfv/superconda/", "bash"); 22 | } 23 | } 24 | } // namespace mamba 25 | -------------------------------------------------------------------------------- /libmamba/tests/src/test_main.cpp: -------------------------------------------------------------------------------- 1 | #define CATCH_CONFIG_MAIN 2 | 3 | #include 4 | -------------------------------------------------------------------------------- /libmamba/tests/src/util/test_os_linux.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include "mamba/util/build.hpp" 12 | #include "mamba/util/os_linux.hpp" 13 | 14 | using namespace mamba; 15 | using namespace mamba::util; 16 | 17 | namespace 18 | { 19 | TEST_CASE("linux_version") 20 | { 21 | const auto maybe_version = linux_version(); 22 | if (util::on_linux) 23 | { 24 | REQUIRE(maybe_version.has_value()); 25 | static const auto version_regex = std::regex(R"r(\d+\.\d+\.\d+)r"); 26 | REQUIRE(std ::regex_match(maybe_version.value(), version_regex)); 27 | } 28 | else 29 | { 30 | REQUIRE_FALSE(maybe_version.has_value()); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /libmamba/tests/src/util/test_os_osx.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include "mamba/util/build.hpp" 12 | #include "mamba/util/os_osx.hpp" 13 | 14 | using namespace mamba; 15 | using namespace mamba::util; 16 | 17 | namespace 18 | { 19 | TEST_CASE("osx_version") 20 | { 21 | const auto maybe_version = osx_version(); 22 | if (util::on_mac) 23 | { 24 | CHECK(maybe_version.has_value()); 25 | // The version would be a sequence: 26 | // 'x.x' or 'x.x.x' 27 | // with 'x' matching one or more digits 28 | static const auto version_regex = std::regex(R"r(\d+\.\d+(\.\d+)?)r"); 29 | CHECK(std ::regex_match(maybe_version.value(), version_regex)); 30 | } 31 | else 32 | { 33 | REQUIRE_FALSE(maybe_version.has_value()); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /libmamba/tests/src/util/test_os_unix.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include "mamba/util/build.hpp" 12 | #include "mamba/util/os_unix.hpp" 13 | 14 | using namespace mamba; 15 | using namespace mamba::util; 16 | 17 | namespace 18 | { 19 | TEST_CASE("unix_name_version") 20 | { 21 | const auto maybe_name_version = unix_name_version(); 22 | if (util::on_linux) 23 | { 24 | REQUIRE(maybe_name_version.has_value()); 25 | REQUIRE(maybe_name_version.value().first == "Linux"); 26 | static const auto version_regex = std::regex(R"r(\d+\.\d+\.\d+)r"); 27 | REQUIRE(std ::regex_match(maybe_name_version.value().second, version_regex)); 28 | } 29 | else if (util::on_mac) 30 | { 31 | REQUIRE(maybe_name_version.has_value()); 32 | REQUIRE(maybe_name_version.value().first == "Darwin"); 33 | static const auto version_regex = std::regex(R"r(\d+\.\d+\.\d+)r"); 34 | REQUIRE(std ::regex_match(maybe_name_version.value().second, version_regex)); 35 | } 36 | else 37 | { 38 | REQUIRE_FALSE(maybe_name_version.has_value()); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /libmamba/tests/src/util/test_os_win.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "mamba/util/build.hpp" 14 | #include "mamba/util/os_win.hpp" 15 | 16 | using namespace mamba; 17 | using namespace mamba::util; 18 | 19 | namespace 20 | { 21 | TEST_CASE("utf8") 22 | { 23 | if (!util::on_win) 24 | { 25 | SKIP(); 26 | } 27 | const std::wstring text_utf16 = L"Hello, I am Joël. 私のにほんごわへたです"; 28 | const std::string text_utf8 = u8"Hello, I am Joël. 私のにほんごわへたです"; 29 | 30 | SECTION("utf8_to_windows_encoding") 31 | { 32 | REQUIRE(utf8_to_windows_encoding("") == L""); 33 | REQUIRE(utf8_to_windows_encoding(text_utf8) == text_utf16); 34 | } 35 | 36 | SECTION("windows_encoding_to_utf8") 37 | { 38 | REQUIRE(windows_encoding_to_utf8(L"") == ""); 39 | REQUIRE(windows_encoding_to_utf8(text_utf16) == text_utf8); 40 | } 41 | } 42 | 43 | TEST_CASE("windows_version") 44 | { 45 | const auto maybe_version = windows_version(); 46 | if (util::on_win) 47 | { 48 | REQUIRE(maybe_version.has_value()); 49 | static const auto version_regex = std::regex(R"r(\d+\.\d+\.\d+)r"); 50 | REQUIRE(std::regex_match(maybe_version.value(), version_regex)); 51 | } 52 | else 53 | { 54 | REQUIRE_FALSE(maybe_version.has_value()); 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /libmamba/tests/src/util/test_type_traits.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include 10 | 11 | #include "mamba/util/type_traits.hpp" 12 | 13 | using namespace mamba::util; 14 | 15 | struct NotOStreamable 16 | { 17 | }; 18 | 19 | struct OStreamable 20 | { 21 | }; 22 | 23 | auto 24 | operator<<(std::ostream& s, const OStreamable&) -> std::ostream&; 25 | 26 | TEST_CASE("ostreamable") 27 | { 28 | REQUIRE(is_ostreamable_v); 29 | REQUIRE(is_ostreamable_v); 30 | REQUIRE_FALSE(is_ostreamable_v); 31 | REQUIRE(is_ostreamable_v); 32 | } 33 | -------------------------------------------------------------------------------- /libmamba/tests/src/util/test_weakening_map.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | #include "mamba/util/weakening_map.hpp" 13 | 14 | 15 | using namespace mamba::util; 16 | 17 | namespace 18 | { 19 | TEST_CASE("DecreaseWeakener") 20 | { 21 | struct DecreaseWeakener 22 | { 23 | [[nodiscard]] auto make_first_key(int key) const -> int 24 | { 25 | return key + 1; 26 | } 27 | 28 | [[nodiscard]] auto weaken_key(int key) const -> std::optional 29 | { 30 | if (key > 1) 31 | { 32 | return { key - 1 }; 33 | } 34 | return std::nullopt; 35 | } 36 | }; 37 | 38 | using test_map = weakening_map, DecreaseWeakener>; 39 | 40 | SECTION("empty") 41 | { 42 | auto map = test_map(); 43 | 44 | REQUIRE_FALSE(map.contains_weaken(1)); 45 | REQUIRE_FALSE(map.contains_weaken(0)); 46 | } 47 | 48 | SECTION("key match") 49 | { 50 | auto map = test_map({ { 1, 10 }, { 4, 40 } }); 51 | 52 | REQUIRE_FALSE(map.contains_weaken(-1)); 53 | 54 | REQUIRE(map.at_weaken(4) == 40); // Exact match 55 | REQUIRE(map.at_weaken(0) == 10); // First key match 56 | REQUIRE(map.at_weaken(7) == 40); // Weaken key 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /libmambapy/.gitignore: -------------------------------------------------------------------------------- 1 | libmambapy/bindings* 2 | libmambapy.egg-info/ 3 | -------------------------------------------------------------------------------- /libmambapy/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2019 QuantStack and the Mamba contributors. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /libmambapy/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include libmambapy/bindings* 2 | exclude src/ 3 | -------------------------------------------------------------------------------- /libmambapy/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = [ 3 | "setuptools>=42", 4 | "wheel", 5 | "scikit-build>=0.13", 6 | "cmake>=3.18", 7 | "ninja", 8 | ] 9 | build-backend = "setuptools.build_meta" 10 | 11 | [project] 12 | name = "libmambapy" 13 | authors = [ 14 | {name = "Wolf Vollprecht"}, 15 | {name = "Adrien Delsalle"}, 16 | {name = "Jonas Haag"}, 17 | {name = "QuantStack", email = "info@quantstack.net"}, 18 | {name = "Other contributors"}, 19 | ] 20 | maintainers = [ 21 | {name = "QuantStack", email = "info@quantstack.net"}, 22 | ] 23 | description = "A fast library to interact with the Conda package ecosystem" 24 | requires-python = ">=3.7" 25 | keywords = ["mamba", "conda", "packaging"] 26 | license = {text = "BSD-3-Clause"} 27 | dependencies = [] 28 | dynamic = ["version"] 29 | [projet.url] 30 | Documentation = "https://mamba.readthedocs.io" 31 | Repository = "https://github.com/mamba-org/mamba/" 32 | 33 | [tool.setuptools] 34 | platforms = ["Windows", "Linux", "Mac OS X"] 35 | -------------------------------------------------------------------------------- /libmambapy/setup.py: -------------------------------------------------------------------------------- 1 | import importlib.util 2 | import os 3 | import pathlib 4 | import sys 5 | 6 | import skbuild 7 | import skbuild.constants 8 | 9 | __dir__ = pathlib.Path(__file__).parent.absolute() 10 | 11 | 12 | def CMAKE_INSTALL_DIR(): 13 | """Where scikit-build configures CMAKE_INSTALL_PREFIX.""" 14 | return os.path.abspath(skbuild.constants.CMAKE_INSTALL_DIR()) 15 | 16 | 17 | def libmambapy_version(): 18 | """Get the version of libmambapy from its version module.""" 19 | spec = importlib.util.spec_from_file_location( 20 | "libmambapy_version", __dir__ / "src/libmambapy/version.py" 21 | ) 22 | ver = importlib.util.module_from_spec(spec) 23 | spec.loader.exec_module(ver) 24 | return ver.__version__ 25 | 26 | 27 | def get_cmake_args(): 28 | cmake_args = [f"-DMAMBA_INSTALL_PYTHON_EXT_LIBDIR={CMAKE_INSTALL_DIR()}/src/libmambapy"] 29 | if sys.platform != "win32" and sys.platform != "cygwin": 30 | cmake_args += ["-DMAMBA_WARNING_AS_ERROR=ON"] 31 | return cmake_args 32 | 33 | 34 | skbuild.setup( 35 | version=libmambapy_version(), 36 | packages=["libmambapy", "libmambapy.bindings", "libmambapy.solver"], 37 | package_dir={"": "src"}, 38 | package_data={"libmambapy": ["py.typed", "__init__.pyi"]}, 39 | cmake_languages=["CXX"], 40 | cmake_minimum_required_version="3.17", 41 | cmake_install_dir="src/libmambapy", # Must match package_dir layout 42 | cmake_args=get_cmake_args(), 43 | ) 44 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/__init__.py: -------------------------------------------------------------------------------- 1 | # Import all submodules so that one can use them directly with `import libmambapy` 2 | import libmambapy.utils 3 | import libmambapy.version 4 | import libmambapy.specs 5 | import libmambapy.solver 6 | 7 | # Legacy which used to combine everything 8 | from libmambapy.bindings.legacy import * # noqa: F403 9 | 10 | # Define top-level attributes 11 | __version__ = libmambapy.version.__version__ 12 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/bindings/bind_utils.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef LIBMAMBAPY_BIND_UTILS_HPP 8 | #define LIBMAMBAPY_BIND_UTILS_HPP 9 | 10 | #include 11 | 12 | #include 13 | #include 14 | 15 | namespace mambapy 16 | { 17 | template 18 | auto enum_from_str(const pybind11::str& name) 19 | { 20 | auto pyenum = pybind11::type::of(); 21 | return pyenum.attr("__members__")[name].template cast(); 22 | } 23 | 24 | template 25 | auto copy(const T& x) -> std::unique_ptr 26 | { 27 | return std::make_unique(x); 28 | } 29 | 30 | template 31 | auto deepcopy(const T& x, const pybind11::dict& /* memo */) -> std::unique_ptr 32 | { 33 | return std::make_unique(x); 34 | } 35 | 36 | template 37 | auto hash(const T& x) -> std::size_t 38 | { 39 | return std::hash()(x); 40 | } 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/bindings/bindings.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include "bindings.hpp" 8 | 9 | PYBIND11_MODULE(bindings, m) 10 | { 11 | mambapy::bind_submodule_utils(m.def_submodule("utils")); 12 | mambapy::bind_submodule_specs(m.def_submodule("specs")); 13 | auto solver_submodule = m.def_submodule("solver"); 14 | mambapy::bind_submodule_solver(solver_submodule); 15 | mambapy::bind_submodule_solver_libsolv(solver_submodule.def_submodule("libsolv")); 16 | mambapy::bind_submodule_legacy(m.def_submodule("legacy")); 17 | } 18 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/bindings/bindings.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef LIBMAMBAPY_BINDINGS_HPP 8 | #define LIBMAMBAPY_BINDINGS_HPP 9 | 10 | #include 11 | 12 | namespace mambapy 13 | { 14 | void bind_submodule_utils(pybind11::module_ m); 15 | void bind_submodule_specs(pybind11::module_ m); 16 | void bind_submodule_solver(pybind11::module_ m); 17 | void bind_submodule_solver_libsolv(pybind11::module_ m); 18 | void bind_submodule_legacy(pybind11::module_ m); 19 | } 20 | #endif 21 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/bindings/flat_set_caster.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include "mamba/util/flat_set.hpp" 10 | 11 | #ifndef MAMBA_PY_SET_CASTER_HPP 12 | #define MAMBA_PY_SET_CASTER_HPP 13 | 14 | namespace PYBIND11_NAMESPACE 15 | { 16 | namespace detail 17 | { 18 | template 19 | struct type_caster> 20 | : set_caster, Key> 21 | { 22 | }; 23 | } 24 | } 25 | #endif 26 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/bindings/longpath.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/bindings/path_caster.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2024, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef LIBMAMBAPY_PATH_CASTER_HPP 8 | #define LIBMAMBAPY_PATH_CASTER_HPP 9 | 10 | #include 11 | #include 12 | 13 | #include "mamba/fs/filesystem.hpp" 14 | 15 | namespace PYBIND11_NAMESPACE 16 | { 17 | namespace detail 18 | { 19 | template <> 20 | struct type_caster : path_caster 21 | { 22 | }; 23 | } 24 | } 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/bindings/weakening_map_bind.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2023, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef LIBMAMBAPY_WEAKENING_MAP_BIND_HPP 8 | #define LIBMAMBAPY_WEAKENING_MAP_BIND_HPP 9 | 10 | #include 11 | #include 12 | #include 13 | 14 | namespace mambapy 15 | { 16 | template 17 | auto bind_weakening_map(Py& m, const char* klass) 18 | { 19 | namespace py = pybind11; 20 | using key_type = typename Map::key_type; 21 | using mapped_type = typename Map::mapped_type; 22 | 23 | return py::bind_map(m, klass) 24 | .def(py::init( 25 | [](const py::dict& py_db) 26 | { 27 | auto db = Map(); 28 | for (const auto& [name, auth] : py_db) 29 | { 30 | db.emplace(py::cast(name), py::cast(auth)); 31 | } 32 | return db; 33 | } 34 | )) 35 | .def(py::self == py::self) 36 | .def(py::self != py::self) 37 | .def("at_weaken", py::overload_cast(&Map::at_weaken, py::const_)) 38 | .def("contains_weaken", &Map::contains_weaken); 39 | } 40 | } 41 | #endif 42 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/py.typed: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/libmambapy/src/libmambapy/py.typed -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/solver/__init__.py: -------------------------------------------------------------------------------- 1 | from libmambapy.bindings.solver import * # noqa: F403 2 | import libmambapy.solver.libsolv # noqa: F401 3 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/solver/libsolv.py: -------------------------------------------------------------------------------- 1 | # This file exists on its own rather than in `__init__.py` to make `import libmambapy.solver.libsolv` work. 2 | from libmambapy.bindings.solver.libsolv import * # noqa: F403 3 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/specs.py: -------------------------------------------------------------------------------- 1 | # This file exists on its own rather than in `__init__.py` to make `import libmambapy.specs` work. 2 | from libmambapy.bindings.specs import * # noqa: F403 3 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/utils.py: -------------------------------------------------------------------------------- 1 | # This file exists on its own rather than in `__init__.py` to make `import libmambapy.utils` work. 2 | from libmambapy.bindings.utils import * # noqa: F403 3 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/version.py: -------------------------------------------------------------------------------- 1 | version_info = ("2", "1", "1") 2 | version_prerelease = "" 3 | __version__ = ".".join(map(str, version_info)) 4 | if version_prerelease != "": 5 | __version__ = f"{__version__}.{version_prerelease}" 6 | -------------------------------------------------------------------------------- /libmambapy/src/libmambapy/version.py.tmpl: -------------------------------------------------------------------------------- 1 | version_info = ("{{ version_major }}", "{{ version_minor }}", "{{ version_patch }}") 2 | version_prerelease = "{{ version_prerelease_name }}" 3 | __version__ = ".".join(map(str, version_info)) 4 | if version_prerelease != "": 5 | __version__ = f"{__version__}.{version_prerelease}" 6 | -------------------------------------------------------------------------------- /libmambapy/tests/test_legacy.py: -------------------------------------------------------------------------------- 1 | import libmambapy 2 | 3 | 4 | def test_context_instance_scoped(): 5 | ctx = libmambapy.Context() # Initialize and then terminate libmamba internals 6 | assert ctx is not None 7 | 8 | 9 | def test_context_no_log_nor_signal_handling(): 10 | ctx = libmambapy.Context( 11 | libmambapy.ContextOptions(enable_logging=False, enable_signal_handling=False) 12 | ) 13 | assert ctx is not None 14 | 15 | 16 | def test_channel_context(): 17 | ctx = libmambapy.Context() 18 | 19 | cc = libmambapy.ChannelContext.make_conda_compatible(ctx) 20 | assert cc.make_channel("pkgs/main")[0].url.str() == "https://repo.anaconda.com/pkgs/main" 21 | assert "pkgs/main" in cc.params().custom_channels 22 | chan = cc.params().custom_channels["pkgs/main"] 23 | assert isinstance(cc.has_zst(chan), bool) # Not testing value 24 | 25 | cc = libmambapy.ChannelContext.make_simple(ctx) 26 | assert cc.make_channel("pkgs/main")[0].url.str() == "https://conda.anaconda.org/pkgs/main" 27 | assert len(cc.params().custom_channels) == 0 28 | -------------------------------------------------------------------------------- /libmambapy/tests/test_version.py: -------------------------------------------------------------------------------- 1 | import libmambapy 2 | 3 | 4 | def test_version(): 5 | assert isinstance(libmambapy.__version__, str) 6 | assert libmambapy.version.__version__ == libmambapy.__version__ 7 | -------------------------------------------------------------------------------- /mamba_package/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2019, QuantStack and Mamba Contributors 2 | # 3 | # Distributed under the terms of the BSD 3-Clause License. 4 | # 5 | # The full license is in the file LICENSE, distributed with this software. 6 | 7 | cmake_minimum_required(VERSION 3.16) 8 | cmake_policy(SET CMP0025 NEW) # Introduced in cmake 3.0 9 | cmake_policy(SET CMP0077 NEW) # Introduced in cmake 3.13 10 | 11 | project(mamba-package) 12 | include(GNUInstallDirs) 13 | 14 | # Source files 15 | # ============ 16 | 17 | set( 18 | MAMBA_PACKAGE_SRCS 19 | ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/package.cpp 20 | ) 21 | 22 | set(MAMBA_PACKAGE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/src/package.hpp) 23 | 24 | # Dependencies 25 | # ============ 26 | 27 | if(NOT TARGET mamba::libmamba) 28 | find_package(libmamba REQUIRED) 29 | endif() 30 | 31 | # Build definition 32 | # ================ 33 | 34 | add_executable(mamba-package ${MAMBA_PACKAGE_SRCS} ${MAMBA_PACKAGE_HEADERS}) 35 | mamba_target_add_compile_warnings(mamba-package WARNING_AS_ERROR ${MAMBA_WARNING_AS_ERROR}) 36 | 37 | target_link_libraries(mamba-package PRIVATE mamba::libmamba) 38 | 39 | set_target_properties(mamba-package PROPERTIES CXX_STANDARD 17) 40 | 41 | install( 42 | TARGETS mamba-package 43 | RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} 44 | LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} 45 | ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} 46 | ) 47 | -------------------------------------------------------------------------------- /mamba_package/src/main.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include 8 | 9 | #include "mamba/api/configuration.hpp" 10 | #include "mamba/core/context.hpp" 11 | #include "mamba/core/execution.hpp" 12 | #include "mamba/core/output.hpp" 13 | #include "mamba/core/thread_utils.hpp" 14 | #include "mamba/core/util_os.hpp" 15 | #include "mamba/version.hpp" 16 | 17 | #include "package.hpp" 18 | 19 | int 20 | main(int argc, char** argv) 21 | { 22 | using namespace mamba; // NOLINT(build/namespaces) 23 | 24 | MainExecutor main_executor; 25 | Context context{ { /* .enable_blah_blah = */ true } }; 26 | Console console{ context }; 27 | Configuration config{ context }; 28 | 29 | // call init console to setup utf8 extraction 30 | init_console(); 31 | 32 | CLI::App app{ "Version: " + version() + "\n" }; 33 | set_package_command(&app, context); 34 | 35 | try 36 | { 37 | CLI11_PARSE(app, argc, argv); 38 | } 39 | catch (const std::exception& e) 40 | { 41 | LOG_CRITICAL << e.what(); 42 | set_sig_interrupted(); 43 | return 1; 44 | } 45 | 46 | 47 | if (app.get_subcommands().size() == 0) 48 | { 49 | config.load(); 50 | console.print(app.help()); 51 | } 52 | 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /mamba_package/src/package.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef MAMBA_PACKAGE_PACKAGE_HPP 8 | #define MAMBA_PACKAGE_PACKAGE_HPP 9 | 10 | #include 11 | 12 | namespace mamba 13 | { 14 | class Context; 15 | } 16 | 17 | void 18 | set_package_command(CLI::App* com, mamba::Context& context); 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /micromamba/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 2019 QuantStack and the Mamba contributors. 2 | 3 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 4 | 5 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 6 | 7 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | 9 | 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 10 | 11 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 12 | -------------------------------------------------------------------------------- /micromamba/etc/profile.d/mamba.sh.in: -------------------------------------------------------------------------------- 1 | echo "WARNING: @CMAKE_INSTALL_PREFIX@/etc/profile.d/mamba.sh (the file emitting this warning) is deprecated." 2 | echo "WARNING: This file will be removed on the next release after 30th September 2025." 3 | echo "WARNING: Please use 'mamba shell init' to get the correct initialization for your shell." 4 | 5 | if [ -z "${MAMBA_ROOT_PREFIX}" ]; then 6 | echo "WARNING: The MAMBA_ROOT_PREFIX environment variable is not set." 7 | echo "WARNING: This is required for mamba to work correctly as of 2.0." 8 | echo "WARNING: " 9 | echo "WARNING: For now, we are setting 'MAMBA_ROOT_PREFIX' to '@CMAKE_INSTALL_PREFIX@'." 10 | echo "WARNING: " 11 | echo "WARNING: Please make sure this is consistent with your installation or alternatively (by order of preference):" 12 | echo "WARNING: - rerun 'mamba shell init' to initialize mamba for your current shell" 13 | echo "WARNING: - manually set 'MAMBA_ROOT_PREFIX' to the root of your installation in your shell profile script." 14 | echo "WARNING: - use the '-r,--root-prefix' CLI option when calling mamba." 15 | echo "WARNING: " 16 | echo "WARNING: This message originates from @CMAKE_INSTALL_PREFIX@/etc/profile.d/mamba.sh" 17 | export MAMBA_ROOT_PREFIX="@CMAKE_INSTALL_PREFIX@" 18 | fi 19 | 20 | __mamba_setup="$("@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/mamba" shell hook --shell posix 2> /dev/null)" 21 | if [ $? -eq 0 ]; then 22 | eval "$__mamba_setup" 23 | else 24 | alias mamba="@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@/mamba" # Fallback on help from mamba activate 25 | fi 26 | unset __mamba_setup 27 | -------------------------------------------------------------------------------- /micromamba/longpath.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | true 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /micromamba/src/common_options.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef UMAMBA_COMMON_OPTIONS_HPP 8 | #define UMAMBA_COMMON_OPTIONS_HPP 9 | 10 | #include 11 | 12 | #include "mamba/api/configuration.hpp" 13 | #include "mamba/core/context.hpp" 14 | 15 | 16 | void 17 | init_rc_options(CLI::App* subcom, mamba::Configuration& config); 18 | 19 | void 20 | init_general_options(CLI::App* subcom, mamba::Configuration& config); 21 | 22 | void 23 | init_prefix_options(CLI::App* subcom, mamba::Configuration& config); 24 | 25 | void 26 | init_install_options(CLI::App* subcom, mamba::Configuration& config); 27 | 28 | void 29 | init_network_options(CLI::App* subcom, mamba::Configuration& config); 30 | 31 | void 32 | strict_channel_priority_hook(mamba::Configuration& config, bool& value); 33 | 34 | void 35 | no_channel_priority_hook(mamba::Configuration& config, bool& value); 36 | 37 | void 38 | init_channel_parser(CLI::App* subcom, mamba::Configuration& config); 39 | 40 | void 41 | load_channel_options(mamba::Context& ctx); 42 | 43 | void 44 | override_channels_hook(mamba::Configuration& config, bool& override_channels); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /micromamba/src/constructor.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef UMAMBA_CONSTRUCTOR_HPP 8 | #define UMAMBA_CONSTRUCTOR_HPP 9 | 10 | #include "mamba/fs/filesystem.hpp" 11 | 12 | namespace mamba 13 | { 14 | class ChannelContext; 15 | class Configuration; 16 | } 17 | 18 | void 19 | construct( 20 | mamba::Configuration& config, 21 | const mamba::fs::u8path& prefix, 22 | bool extract_conda_pkgs, 23 | bool extract_tarball 24 | ); 25 | 26 | void 27 | read_binary_from_stdin_and_write_to_file(mamba::fs::u8path& filename); 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /micromamba/src/create.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include "mamba/api/create.hpp" 8 | 9 | #include "common_options.hpp" 10 | 11 | 12 | using namespace mamba; // NOLINT(build/namespaces) 13 | 14 | void 15 | set_create_command(CLI::App* subcom, Configuration& config) 16 | { 17 | init_install_options(subcom, config); 18 | 19 | subcom->callback([&] { return mamba::create(config); }); 20 | } 21 | -------------------------------------------------------------------------------- /micromamba/src/info.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include "mamba/api/configuration.hpp" 8 | #include "mamba/api/info.hpp" 9 | #include "mamba/core/context.hpp" 10 | 11 | #include "common_options.hpp" 12 | 13 | void 14 | init_info_parser(CLI::App* subcom, mamba::Configuration& config) 15 | { 16 | init_general_options(subcom, config); 17 | init_prefix_options(subcom, config); 18 | 19 | auto& print_licenses = config.insert( 20 | mamba::Configurable("print_licenses", false).group("cli").description("Print licenses.") 21 | ); 22 | subcom->add_flag("--licenses", print_licenses.get_cli_config(), print_licenses.description()); 23 | 24 | auto& base = config.insert( 25 | mamba::Configurable("base", false).group("cli").description("Display base environment path.") 26 | ); 27 | subcom->add_flag("--base", base.get_cli_config(), base.description()); 28 | 29 | auto& environments = config.insert( 30 | mamba::Configurable("environments", false).group("cli").description("List known environments.") 31 | ); 32 | subcom->add_flag("-e,--envs", environments.get_cli_config(), environments.description()); 33 | } 34 | 35 | void 36 | set_info_command(CLI::App* subcom, mamba::Configuration& config) 37 | { 38 | init_info_parser(subcom, config); 39 | 40 | subcom->callback([&config] { info(config); }); 41 | } 42 | -------------------------------------------------------------------------------- /micromamba/src/install.cpp: -------------------------------------------------------------------------------- 1 | #include "mamba/api/configuration.hpp" 2 | #include "mamba/api/install.hpp" 3 | 4 | #include "common_options.hpp" 5 | 6 | 7 | using namespace mamba; // NOLINT(build/namespaces) 8 | 9 | void 10 | set_install_command(CLI::App* subcom, Configuration& config) 11 | { 12 | init_install_options(subcom, config); 13 | 14 | auto& freeze_installed = config.at("freeze_installed"); 15 | subcom->add_flag( 16 | "--freeze-installed", 17 | freeze_installed.get_cli_config(), 18 | freeze_installed.description() 19 | ); 20 | auto& force_reinstall = config.at("force_reinstall"); 21 | subcom->add_flag( 22 | "--force-reinstall", 23 | force_reinstall.get_cli_config(), 24 | force_reinstall.description() 25 | ); 26 | 27 | subcom->callback([&] { return mamba::install(config); }); 28 | } 29 | -------------------------------------------------------------------------------- /micromamba/src/version.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #include "version.hpp" 8 | 9 | namespace umamba 10 | { 11 | std::string version() 12 | { 13 | return UMAMBA_VERSION_STRING; 14 | } 15 | 16 | std::array version_arr() 17 | { 18 | return { UMAMBA_VERSION_MAJOR, UMAMBA_VERSION_MINOR, UMAMBA_VERSION_PATCH }; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /micromamba/src/version.hpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef UMAMBA_VERSION_HPP 8 | #define UMAMBA_VERSION_HPP 9 | 10 | #include 11 | #include 12 | 13 | #define UMAMBA_VERSION_MAJOR 2 14 | #define UMAMBA_VERSION_MINOR 1 15 | #define UMAMBA_VERSION_PATCH 1 16 | #define UMAMBA_VERSION_IS_PRERELEASE 0 17 | #if UMAMBA_VERSION_IS_PRERELEASE == 1 18 | #define UMAMBA_VERSION_PRERELEASE_NAME "" 19 | #endif 20 | 21 | #define UMAMBA_VERSION_STRING "2.1.1" 22 | #define UMAMBA_VERSION \ 23 | (UMAMBA_VERSION_MAJOR * 10000 + UMAMBA_VERSION_MINOR * 100 + UMAMBA_VERSION_PATCH) 24 | 25 | // Binary version 26 | #define UMAMBA_BINARY_CURRENT 1 27 | #define UMAMBA_BINARY_REVISION 0 28 | #define UMAMBA_BINARY_AGE 0 29 | 30 | namespace umamba 31 | { 32 | std::string version(); 33 | 34 | [[deprecated("will be replaced in a future minor version")]] 35 | std::array version_arr(); 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /micromamba/src/version.hpp.tmpl: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2019, QuantStack and Mamba Contributors 2 | // 3 | // Distributed under the terms of the BSD 3-Clause License. 4 | // 5 | // The full license is in the file LICENSE, distributed with this software. 6 | 7 | #ifndef UMAMBA_VERSION_HPP 8 | #define UMAMBA_VERSION_HPP 9 | 10 | #include 11 | #include 12 | 13 | #define UMAMBA_VERSION_MAJOR {{ version_major }} 14 | #define UMAMBA_VERSION_MINOR {{ version_minor }} 15 | #define UMAMBA_VERSION_PATCH {{ version_patch }} 16 | #define UMAMBA_VERSION_IS_PRERELEASE {{ version_is_prerelease }} 17 | #if UMAMBA_VERSION_IS_PRERELEASE == 1 18 | #define UMAMBA_VERSION_PRERELEASE_NAME "{{ version_prerelease_name }}" 19 | #endif 20 | 21 | #define UMAMBA_VERSION_STRING "{{ version_name }}" 22 | #define UMAMBA_VERSION \ 23 | (UMAMBA_VERSION_MAJOR * 10000 + UMAMBA_VERSION_MINOR * 100 + UMAMBA_VERSION_PATCH) 24 | 25 | // Binary version 26 | #define UMAMBA_BINARY_CURRENT 1 27 | #define UMAMBA_BINARY_REVISION 0 28 | #define UMAMBA_BINARY_AGE 0 29 | 30 | namespace umamba 31 | { 32 | std::string version(); 33 | 34 | [[deprecated("will be replaced in a future minor version")]] 35 | std::array version_arr(); 36 | 37 | } 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /micromamba/test-server/channel_a/linux-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "linux-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | }, 20 | "A_0.2.0.tar.bz2": { 21 | "build": "abc", 22 | "build_number": 0, 23 | "depends": [], 24 | "license": "BSD", 25 | "license_family": "BSD", 26 | "md5": "85107fc10154734ef34a5a75685be684", 27 | "name": "a", 28 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 29 | "size": 222503, 30 | "subdir": "linux-64", 31 | "timestamp": 1578950023135, 32 | "version": "0.2.0" 33 | }, 34 | "B_0.1.0.tar.bz2": { 35 | "build": "abc", 36 | "build_number": 0, 37 | "depends": ["a"], 38 | "license": "BSD", 39 | "license_family": "BSD", 40 | "md5": "85107fc10154734ef34a5a75685be684", 41 | "name": "b", 42 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 43 | "size": 222503, 44 | "subdir": "linux-64", 45 | "timestamp": 1578950023135, 46 | "version": "0.1.0" 47 | } 48 | }, 49 | "removed": [], 50 | "repodata_version": 1 51 | } 52 | -------------------------------------------------------------------------------- /micromamba/test-server/channel_a/linux-64/repodata.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/test-server/channel_a/linux-64/repodata.tar.bz2 -------------------------------------------------------------------------------- /micromamba/test-server/channel_a/linux-64/repodata.tpl: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [ 10 | ], 11 | "license": "BSD", 12 | "license_family": "BSD", 13 | "md5": "85107fc10154734ef34a5a75685be684", 14 | "name": "a", 15 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 16 | "size": 222503, 17 | "subdir": "linux-64", 18 | "timestamp": 1578950023135, 19 | "version": "0.1.0" 20 | }, 21 | "A_0.2.0.tar.bz2": { 22 | "build": "abc", 23 | "build_number": 0, 24 | "depends": [ 25 | ], 26 | "license": "BSD", 27 | "license_family": "BSD", 28 | "md5": "85107fc10154734ef34a5a75685be684", 29 | "name": "a", 30 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 31 | "size": 222503, 32 | "subdir": "linux-64", 33 | "timestamp": 1578950023135, 34 | "version": "0.2.0" 35 | }, 36 | "B_0.1.0.tar.bz2": { 37 | "build": "abc", 38 | "build_number": 0, 39 | "depends": [ 40 | "a"GLIBC_PLACEHOLDER 41 | ], 42 | "license": "BSD", 43 | "license_family": "BSD", 44 | "md5": "85107fc10154734ef34a5a75685be684", 45 | "name": "b", 46 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 47 | "size": 222503, 48 | "subdir": "linux-64", 49 | "timestamp": 1578950023135, 50 | "version": "0.1.0" 51 | } 52 | }, 53 | "removed": [], 54 | "repodata_version": 1 55 | } 56 | -------------------------------------------------------------------------------- /micromamba/test-server/channel_a/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/test-server/channel_a/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2 -------------------------------------------------------------------------------- /micromamba/test-server/channel_a/noarch/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "noarch" 4 | }, 5 | "packages": { 6 | "_r-mutex-1.0.1-anacondar_1.tar.bz2": { 7 | "build": "anacondar_1", 8 | "build_number": 1, 9 | "constrains": [], 10 | "depends": [], 11 | "license": "BSD", 12 | "md5": "19f9db5f4f1b7f5ef5f6d67207f25f38", 13 | "name": "_r-mutex", 14 | "noarch": "generic", 15 | "platform": null, 16 | "sha256": "e58f9eeb416b92b550e824bcb1b9fb1958dee69abfe3089dfd1a9173e3a0528a", 17 | "size": 3566, 18 | "subdir": "noarch", 19 | "timestamp": 1562343890778, 20 | "track_features": "", 21 | "version": "1.0.1" 22 | }, 23 | "testpkg_0.1.0.tar.bz2": { 24 | "build": "abc", 25 | "build_number": 0, 26 | "depends": [], 27 | "license": "BSD", 28 | "license_family": "BSD", 29 | "md5": "85107fc10154734ef34a5a75685be684", 30 | "name": "testpkg", 31 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 32 | "size": 222503, 33 | "subdir": "noarch", 34 | "timestamp": 1578950023135, 35 | "version": "0.1.0" 36 | } 37 | }, 38 | "removed": [], 39 | "repodata_version": 1 40 | } 41 | -------------------------------------------------------------------------------- /micromamba/test-server/channel_a/win-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "win-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "win-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | }, 20 | "A_0.2.0.tar.bz2": { 21 | "build": "abc", 22 | "build_number": 0, 23 | "depends": [], 24 | "license": "BSD", 25 | "license_family": "BSD", 26 | "md5": "85107fc10154734ef34a5a75685be684", 27 | "name": "a", 28 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 29 | "size": 222503, 30 | "subdir": "win-64", 31 | "timestamp": 1578950023135, 32 | "version": "0.2.0" 33 | }, 34 | "B_0.1.0.tar.bz2": { 35 | "build": "abc", 36 | "build_number": 0, 37 | "depends": ["a"], 38 | "license": "BSD", 39 | "license_family": "BSD", 40 | "md5": "85107fc10154734ef34a5a75685be684", 41 | "name": "b", 42 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 43 | "size": 222503, 44 | "subdir": "win-64", 45 | "timestamp": 1578950023135, 46 | "version": "0.1.0" 47 | } 48 | }, 49 | "removed": [], 50 | "repodata_version": 1 51 | } 52 | -------------------------------------------------------------------------------- /micromamba/test-server/channel_a/win-64/repodata.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/test-server/channel_a/win-64/repodata.tar.bz2 -------------------------------------------------------------------------------- /micromamba/test-server/channel_a/win-64/repodata.tpl: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "win-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [ 10 | ], 11 | "license": "BSD", 12 | "license_family": "BSD", 13 | "md5": "85107fc10154734ef34a5a75685be684", 14 | "name": "a", 15 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 16 | "size": 222503, 17 | "subdir": "win-64", 18 | "timestamp": 1578950023135, 19 | "version": "0.1.0" 20 | }, 21 | "A_0.2.0.tar.bz2": { 22 | "build": "abc", 23 | "build_number": 0, 24 | "depends": [ 25 | ], 26 | "license": "BSD", 27 | "license_family": "BSD", 28 | "md5": "85107fc10154734ef34a5a75685be684", 29 | "name": "a", 30 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 31 | "size": 222503, 32 | "subdir": "win-64", 33 | "timestamp": 1578950023135, 34 | "version": "0.2.0" 35 | }, 36 | "B_0.1.0.tar.bz2": { 37 | "build": "abc", 38 | "build_number": 0, 39 | "depends": [ 40 | "a"GLIBC_PLACEHOLDER 41 | ], 42 | "license": "BSD", 43 | "license_family": "BSD", 44 | "md5": "85107fc10154734ef34a5a75685be684", 45 | "name": "b", 46 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 47 | "size": 222503, 48 | "subdir": "win-64", 49 | "timestamp": 1578950023135, 50 | "version": "0.1.0" 51 | } 52 | }, 53 | "removed": [], 54 | "repodata_version": 1 55 | } 56 | -------------------------------------------------------------------------------- /micromamba/test-server/channel_b/linux-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "linux-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | } 20 | }, 21 | "removed": [], 22 | "repodata_version": 1 23 | } 24 | -------------------------------------------------------------------------------- /micromamba/test-server/channel_b/noarch/repodata.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /micromamba/test-server/channel_b/win-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "win-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "win-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | } 20 | }, 21 | "removed": [], 22 | "repodata_version": 1 23 | } 24 | -------------------------------------------------------------------------------- /micromamba/test-server/generate_gpg_keys.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -euo pipefail -x 4 | 5 | cat << EOF | gpg --batch --generate-key 6 | %no-protection 7 | Key-Type: eddsa 8 | Key-Curve: Ed25519 9 | Key-Usage: sign 10 | Name-Real: MAMBA1 11 | Name-Email: mail at example.com 12 | Creation-Date: 20170801T180000 13 | Expire-Date: 0 14 | Subkey-Type: ecdh 15 | Subkey-Curve: Curve25519 16 | Subkey-Usage: encrypt 17 | EOF 18 | 19 | cat << EOF | gpg --batch --generate-key 20 | %no-protection 21 | Key-Type: eddsa 22 | Key-Curve: Ed25519 23 | Key-Usage: sign 24 | Name-Real: MAMBA2 25 | Name-Email: mail at example.com 26 | Creation-Date: 20170801T180000 27 | Expire-Date: 0 28 | Subkey-Type: ecdh 29 | Subkey-Curve: Curve25519 30 | Subkey-Usage: encrypt 31 | EOF 32 | -------------------------------------------------------------------------------- /micromamba/test-server/repo/channeldata.json: -------------------------------------------------------------------------------- 1 | { 2 | "channeldata_version": 1, 3 | "packages": { 4 | "test-package": { 5 | "activate.d": false, 6 | "binary_prefix": false, 7 | "deactivate.d": false, 8 | "description": null, 9 | "dev_url": null, 10 | "doc_source_url": null, 11 | "doc_url": null, 12 | "home": "https://github.com/mamba-org/mamba", 13 | "icon_hash": null, 14 | "icon_url": null, 15 | "identifiers": null, 16 | "keywords": null, 17 | "license": "BSD", 18 | "post_link": false, 19 | "pre_link": false, 20 | "pre_unlink": false, 21 | "recipe_origin": null, 22 | "run_exports": {}, 23 | "source_git_url": null, 24 | "source_url": null, 25 | "subdirs": ["noarch"], 26 | "summary": "I am just a test package!", 27 | "tags": null, 28 | "text_prefix": false, 29 | "timestamp": 1613117294, 30 | "version": "0.1" 31 | } 32 | }, 33 | "subdirs": ["noarch"] 34 | } 35 | -------------------------------------------------------------------------------- /micromamba/test-server/repo/noarch/current_repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "noarch" 4 | }, 5 | "packages": { 6 | "test-package-0.1-0.tar.bz2": { 7 | "build": "0", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "md5": "719449904d9d4ac9853437a9504f87c5", 12 | "name": "test-package", 13 | "sha256": "1c8942fd0ad0dd3f780bff1a159a6ff8b82968965a630b3e1bff27b7168f68b5", 14 | "size": 5747, 15 | "subdir": "noarch", 16 | "timestamp": 1613117294, 17 | "version": "0.1" 18 | } 19 | }, 20 | "packages.conda": {}, 21 | "removed": [], 22 | "repodata_version": 1 23 | } 24 | -------------------------------------------------------------------------------- /micromamba/test-server/repo/noarch/current_repodata.json.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/test-server/repo/noarch/current_repodata.json.bz2 -------------------------------------------------------------------------------- /micromamba/test-server/repo/noarch/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "noarch" 4 | }, 5 | "packages": { 6 | "test-package-0.1-0.tar.bz2": { 7 | "build": "0", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "md5": "719449904d9d4ac9853437a9504f87c5", 12 | "name": "test-package", 13 | "sha256": "1c8942fd0ad0dd3f780bff1a159a6ff8b82968965a630b3e1bff27b7168f68b5", 14 | "size": 5747, 15 | "subdir": "noarch", 16 | "timestamp": 1613117294, 17 | "version": "0.1" 18 | } 19 | }, 20 | "packages.conda": {}, 21 | "removed": [], 22 | "repodata_version": 1 23 | } 24 | -------------------------------------------------------------------------------- /micromamba/test-server/repo/noarch/repodata.json.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/test-server/repo/noarch/repodata.json.bz2 -------------------------------------------------------------------------------- /micromamba/test-server/repo/noarch/repodata_from_packages.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "noarch" 4 | }, 5 | "packages": { 6 | "test-package-0.1-0.tar.bz2": { 7 | "build": "0", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "md5": "719449904d9d4ac9853437a9504f87c5", 12 | "name": "test-package", 13 | "sha256": "1c8942fd0ad0dd3f780bff1a159a6ff8b82968965a630b3e1bff27b7168f68b5", 14 | "size": 5747, 15 | "subdir": "noarch", 16 | "timestamp": 1613117294, 17 | "version": "0.1" 18 | } 19 | }, 20 | "packages.conda": {}, 21 | "removed": [], 22 | "repodata_version": 1 23 | } 24 | -------------------------------------------------------------------------------- /micromamba/test-server/repo/noarch/repodata_from_packages.json.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/test-server/repo/noarch/repodata_from_packages.json.bz2 -------------------------------------------------------------------------------- /micromamba/test-server/repo/noarch/test-package-0.1-0.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/test-server/repo/noarch/test-package-0.1-0.tar.bz2 -------------------------------------------------------------------------------- /micromamba/test-server/repo/recipes/test-package/meta.yaml: -------------------------------------------------------------------------------- 1 | package: 2 | name: test-package 3 | version: 0.1 4 | 5 | build: 6 | number: 0 7 | script: echo Hello world 8 | noarch: generic 9 | 10 | about: 11 | home: https://github.com/mamba-org/mamba 12 | license: BSD 13 | license_family: BSD 14 | summary: I am just a test package! 15 | -------------------------------------------------------------------------------- /micromamba/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/__init__.py -------------------------------------------------------------------------------- /micromamba/tests/channel_a/linux-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "linux-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | }, 20 | "A_0.2.0.tar.bz2": { 21 | "build": "abc", 22 | "build_number": 0, 23 | "depends": [], 24 | "license": "BSD", 25 | "license_family": "BSD", 26 | "md5": "85107fc10154734ef34a5a75685be684", 27 | "name": "a", 28 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 29 | "size": 222503, 30 | "subdir": "linux-64", 31 | "timestamp": 1578950023135, 32 | "version": "0.2.0" 33 | }, 34 | "B_0.1.0.tar.bz2": { 35 | "build": "abc", 36 | "build_number": 0, 37 | "depends": ["a"], 38 | "license": "BSD", 39 | "license_family": "BSD", 40 | "md5": "85107fc10154734ef34a5a75685be684", 41 | "name": "b", 42 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 43 | "size": 222503, 44 | "subdir": "linux-64", 45 | "timestamp": 1578950023135, 46 | "version": "0.1.0" 47 | } 48 | }, 49 | "removed": [], 50 | "repodata_version": 1 51 | } 52 | -------------------------------------------------------------------------------- /micromamba/tests/channel_a/linux-64/repodata.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/channel_a/linux-64/repodata.tar.bz2 -------------------------------------------------------------------------------- /micromamba/tests/channel_a/linux-64/repodata.tpl: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [ 10 | ], 11 | "license": "BSD", 12 | "license_family": "BSD", 13 | "md5": "85107fc10154734ef34a5a75685be684", 14 | "name": "a", 15 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 16 | "size": 222503, 17 | "subdir": "linux-64", 18 | "timestamp": 1578950023135, 19 | "version": "0.1.0" 20 | }, 21 | "A_0.2.0.tar.bz2": { 22 | "build": "abc", 23 | "build_number": 0, 24 | "depends": [ 25 | ], 26 | "license": "BSD", 27 | "license_family": "BSD", 28 | "md5": "85107fc10154734ef34a5a75685be684", 29 | "name": "a", 30 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 31 | "size": 222503, 32 | "subdir": "linux-64", 33 | "timestamp": 1578950023135, 34 | "version": "0.2.0" 35 | }, 36 | "B_0.1.0.tar.bz2": { 37 | "build": "abc", 38 | "build_number": 0, 39 | "depends": [ 40 | "a"GLIBC_PLACEHOLDER 41 | ], 42 | "license": "BSD", 43 | "license_family": "BSD", 44 | "md5": "85107fc10154734ef34a5a75685be684", 45 | "name": "b", 46 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 47 | "size": 222503, 48 | "subdir": "linux-64", 49 | "timestamp": 1578950023135, 50 | "version": "0.1.0" 51 | } 52 | }, 53 | "removed": [], 54 | "repodata_version": 1 55 | } 56 | -------------------------------------------------------------------------------- /micromamba/tests/channel_a/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/channel_a/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2 -------------------------------------------------------------------------------- /micromamba/tests/channel_a/noarch/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "noarch" 4 | }, 5 | "packages": { 6 | "_r-mutex-1.0.1-anacondar_1.tar.bz2": { 7 | "build": "anacondar_1", 8 | "build_number": 1, 9 | "constrains": [], 10 | "depends": [], 11 | "license": "BSD", 12 | "md5": "19f9db5f4f1b7f5ef5f6d67207f25f38", 13 | "name": "_r-mutex", 14 | "noarch": "generic", 15 | "platform": null, 16 | "sha256": "e58f9eeb416b92b550e824bcb1b9fb1958dee69abfe3089dfd1a9173e3a0528a", 17 | "size": 3566, 18 | "subdir": "noarch", 19 | "timestamp": 1562343890778, 20 | "track_features": "", 21 | "version": "1.0.1" 22 | }, 23 | "testpkg_0.1.0.tar.bz2": { 24 | "build": "abc", 25 | "build_number": 0, 26 | "depends": [], 27 | "license": "BSD", 28 | "license_family": "BSD", 29 | "md5": "85107fc10154734ef34a5a75685be684", 30 | "name": "testpkg", 31 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 32 | "size": 222503, 33 | "subdir": "noarch", 34 | "timestamp": 1578950023135, 35 | "version": "0.1.0" 36 | } 37 | }, 38 | "removed": [], 39 | "repodata_version": 1 40 | } 41 | -------------------------------------------------------------------------------- /micromamba/tests/channel_a/win-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "win-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "win-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | }, 20 | "A_0.2.0.tar.bz2": { 21 | "build": "abc", 22 | "build_number": 0, 23 | "depends": [], 24 | "license": "BSD", 25 | "license_family": "BSD", 26 | "md5": "85107fc10154734ef34a5a75685be684", 27 | "name": "a", 28 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 29 | "size": 222503, 30 | "subdir": "win-64", 31 | "timestamp": 1578950023135, 32 | "version": "0.2.0" 33 | }, 34 | "B_0.1.0.tar.bz2": { 35 | "build": "abc", 36 | "build_number": 0, 37 | "depends": ["a"], 38 | "license": "BSD", 39 | "license_family": "BSD", 40 | "md5": "85107fc10154734ef34a5a75685be684", 41 | "name": "b", 42 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 43 | "size": 222503, 44 | "subdir": "win-64", 45 | "timestamp": 1578950023135, 46 | "version": "0.1.0" 47 | } 48 | }, 49 | "removed": [], 50 | "repodata_version": 1 51 | } 52 | -------------------------------------------------------------------------------- /micromamba/tests/channel_a/win-64/repodata.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/channel_a/win-64/repodata.tar.bz2 -------------------------------------------------------------------------------- /micromamba/tests/channel_a/win-64/repodata.tpl: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "win-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [ 10 | ], 11 | "license": "BSD", 12 | "license_family": "BSD", 13 | "md5": "85107fc10154734ef34a5a75685be684", 14 | "name": "a", 15 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 16 | "size": 222503, 17 | "subdir": "win-64", 18 | "timestamp": 1578950023135, 19 | "version": "0.1.0" 20 | }, 21 | "A_0.2.0.tar.bz2": { 22 | "build": "abc", 23 | "build_number": 0, 24 | "depends": [ 25 | ], 26 | "license": "BSD", 27 | "license_family": "BSD", 28 | "md5": "85107fc10154734ef34a5a75685be684", 29 | "name": "a", 30 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 31 | "size": 222503, 32 | "subdir": "win-64", 33 | "timestamp": 1578950023135, 34 | "version": "0.2.0" 35 | }, 36 | "B_0.1.0.tar.bz2": { 37 | "build": "abc", 38 | "build_number": 0, 39 | "depends": [ 40 | "a"GLIBC_PLACEHOLDER 41 | ], 42 | "license": "BSD", 43 | "license_family": "BSD", 44 | "md5": "85107fc10154734ef34a5a75685be684", 45 | "name": "b", 46 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 47 | "size": 222503, 48 | "subdir": "win-64", 49 | "timestamp": 1578950023135, 50 | "version": "0.1.0" 51 | } 52 | }, 53 | "removed": [], 54 | "repodata_version": 1 55 | } 56 | -------------------------------------------------------------------------------- /micromamba/tests/channel_b/linux-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "linux-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | } 20 | }, 21 | "removed": [], 22 | "repodata_version": 1 23 | } 24 | -------------------------------------------------------------------------------- /micromamba/tests/channel_b/noarch/repodata.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /micromamba/tests/channel_b/win-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "win-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "win-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | } 20 | }, 21 | "removed": [], 22 | "repodata_version": 1 23 | } 24 | -------------------------------------------------------------------------------- /micromamba/tests/data/cph_test_data-0.0.1-0.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/data/cph_test_data-0.0.1-0.tar.bz2 -------------------------------------------------------------------------------- /micromamba/tests/dump_proxy_connections.py: -------------------------------------------------------------------------------- 1 | """ 2 | mitmproxy connection dumper plugin 3 | 4 | This script shouldn't be run or imported directly. Instead, it should be passed to mitmproxy as a script (-s). 5 | It will then dump all request urls in the file specified by the outfile option. 6 | 7 | We use this script instead of letting mitmdump do the dumping, because we only care about the urls, while mitmdump 8 | also dumps all message content. 9 | """ 10 | 11 | from mitmproxy import ctx 12 | from mitmproxy.addonmanager import Loader 13 | from mitmproxy.http import HTTPFlow 14 | 15 | import logging 16 | 17 | # Asking `passlib` to only log errors to avoid random failure in the CI 18 | # cf. https://github.com/mamba-org/mamba/issues/3323 19 | # and https://github.com/pyca/bcrypt/issues/684 20 | logging.getLogger("passlib").setLevel(logging.ERROR) 21 | 22 | 23 | class DumpAddon: 24 | def load(self, loader: Loader): 25 | loader.add_option( 26 | name="outfile", 27 | typespec=str, 28 | default="", 29 | help="Path for the file in which to dump the requests", 30 | ) 31 | 32 | def request(self, flow: HTTPFlow): 33 | with open(ctx.options.outfile, "a+") as f: 34 | f.write(flow.request.url + "\n") 35 | 36 | 37 | addons = [DumpAddon()] 38 | -------------------------------------------------------------------------------- /micromamba/tests/env-create-export.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - https://conda.anaconda.org/conda-forge 3 | dependencies: 4 | - micromamba=0.24.0 5 | -------------------------------------------------------------------------------- /micromamba/tests/env-extra-white-space.yaml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | dependencies: 4 | - python > 3.11 5 | - numpy < 2.0 6 | - scipy >= 1.5.0, < 2.0.0 7 | - scikit-learn >1.0.0 8 | -------------------------------------------------------------------------------- /micromamba/tests/env-logging-overhead-regression.yaml: -------------------------------------------------------------------------------- 1 | # This environment was observed to have the spdlog-based logging system make 2 | # mamba hang when environments are created with: 3 | # 4 | # {micromamba,mamba} env create -n repro-create -f ./env-logging-overhead-regression.yaml 5 | # 6 | # or updated with: 7 | # 8 | # {micromamba,mamba} env update -n repro-create -f ./env-logging-overhead-regression.yaml 9 | # 10 | channels: 11 | - conda-forge 12 | dependencies: 13 | - python=3.9 14 | - xeus-cling=0.6.0 15 | - xtensor=0.20.8 16 | - xtensor-blas=0.16.1 17 | - notebook 18 | -------------------------------------------------------------------------------- /micromamba/tests/env-pypi-pkg-test.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - pip 3 | - pip: 4 | - pypi-pkg-test 5 | -------------------------------------------------------------------------------- /micromamba/tests/env-requires-pip-install-with-spaces.yaml: -------------------------------------------------------------------------------- 1 | name: test env with spaces 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.9 6 | - pip 7 | - pip: 8 | - pydantic 9 | -------------------------------------------------------------------------------- /micromamba/tests/env-requires-pip-install.yaml: -------------------------------------------------------------------------------- 1 | name: test_env 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - python=3.9 6 | - pip 7 | - pip: 8 | - pydantic 9 | -------------------------------------------------------------------------------- /micromamba/tests/explicit_env_osx.txt: -------------------------------------------------------------------------------- 1 | # This file may be used to create an environment using: 2 | # $ conda create --name --file 3 | # platform: osx-64 4 | @EXPLICIT 5 | 6 | https://repo.anaconda.com/pkgs/main/osx-64/ca-certificates-2021.5.25-hecd8cb5_1.conda 7 | 8 | # some comment in the middle of nowhere 9 | https://repo.anaconda.com/pkgs/main/osx-64/libcxx-10.0.0-1.conda 10 | https://repo.anaconda.com/pkgs/main/noarch/tzdata-2021a-h52ac0ba_0.conda 11 | https://repo.anaconda.com/pkgs/main/osx-64/xz-5.2.5-h1de35cc_0.conda 12 | https://repo.anaconda.com/pkgs/main/osx-64/zlib-1.2.11-h1de35cc_3.conda 13 | https://repo.anaconda.com/pkgs/main/osx-64/libffi-3.3-hb1e8313_2.conda 14 | https://repo.anaconda.com/pkgs/main/osx-64/ncurses-6.2-h0a44026_1.conda 15 | https://repo.anaconda.com/pkgs/main/osx-64/openssl-1.1.1k-h9ed2024_0.conda 16 | https://repo.anaconda.com/pkgs/main/osx-64/tk-8.6.10-hb0a8c7a_0.conda 17 | https://repo.anaconda.com/pkgs/main/osx-64/readline-8.1-h9ed2024_0.conda 18 | https://repo.anaconda.com/pkgs/main/osx-64/sqlite-3.36.0-hce871da_0.conda 19 | https://repo.anaconda.com/pkgs/main/osx-64/python-3.9.5-h88f2d9e_3.conda 20 | https://repo.anaconda.com/pkgs/main/osx-64/certifi-2021.5.30-py39hecd8cb5_0.conda 21 | https://repo.anaconda.com/pkgs/main/noarch/wheel-0.36.2-pyhd3eb1b0_0.conda 22 | https://repo.anaconda.com/pkgs/main/osx-64/setuptools-52.0.0-py39hecd8cb5_0.conda 23 | https://repo.anaconda.com/pkgs/main/osx-64/pip-21.1.3-py39hecd8cb5_0.conda 24 | -------------------------------------------------------------------------------- /micromamba/tests/pre_commit_conda_hooks_repo/.pre-commit-hooks.yaml: -------------------------------------------------------------------------------- 1 | - id: sys-exec 2 | name: sys-exec 3 | entry: python -c 'import os; import sys; print(sys.executable.split(os.path.sep)[-2]) if os.name == "nt" else print(sys.executable.split(os.path.sep)[-3])' 4 | language: conda 5 | files: \.py$ 6 | - id: additional-deps 7 | name: additional-deps 8 | entry: python 9 | language: conda 10 | files: \.py$ 11 | -------------------------------------------------------------------------------- /micromamba/tests/pre_commit_conda_hooks_repo/README.md: -------------------------------------------------------------------------------- 1 | # conda_hooks_repo 2 | 3 | Copied from 4 | Was deleted in 5 | 6 | Copyright (c) 2014 pre-commit dev team: Anthony Sottile, Ken Struys 7 | MIT license 8 | -------------------------------------------------------------------------------- /micromamba/tests/pre_commit_conda_hooks_repo/environment.yml: -------------------------------------------------------------------------------- 1 | channels: 2 | - conda-forge 3 | - defaults 4 | dependencies: 5 | - python 6 | - pip 7 | -------------------------------------------------------------------------------- /micromamba/tests/spec_file_1.txt: -------------------------------------------------------------------------------- 1 | xtensor >=0.20 2 | xsimd 3 | -------------------------------------------------------------------------------- /micromamba/tests/spec_file_2.txt: -------------------------------------------------------------------------------- 1 | python=3.7.* 2 | wheel 3 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_a/linux-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "linux-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | }, 20 | "A_0.2.0.tar.bz2": { 21 | "build": "abc", 22 | "build_number": 0, 23 | "depends": [], 24 | "license": "BSD", 25 | "license_family": "BSD", 26 | "md5": "85107fc10154734ef34a5a75685be684", 27 | "name": "a", 28 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 29 | "size": 222503, 30 | "subdir": "linux-64", 31 | "timestamp": 1578950023135, 32 | "version": "0.2.0" 33 | }, 34 | "B_0.1.0.tar.bz2": { 35 | "build": "abc", 36 | "build_number": 0, 37 | "depends": ["a"], 38 | "license": "BSD", 39 | "license_family": "BSD", 40 | "md5": "85107fc10154734ef34a5a75685be684", 41 | "name": "b", 42 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 43 | "size": 222503, 44 | "subdir": "linux-64", 45 | "timestamp": 1578950023135, 46 | "version": "0.1.0" 47 | } 48 | }, 49 | "removed": [], 50 | "repodata_version": 1 51 | } 52 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_a/linux-64/repodata.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/test-server/channel_a/linux-64/repodata.tar.bz2 -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_a/linux-64/repodata.tpl: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [ 10 | ], 11 | "license": "BSD", 12 | "license_family": "BSD", 13 | "md5": "85107fc10154734ef34a5a75685be684", 14 | "name": "a", 15 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 16 | "size": 222503, 17 | "subdir": "linux-64", 18 | "timestamp": 1578950023135, 19 | "version": "0.1.0" 20 | }, 21 | "A_0.2.0.tar.bz2": { 22 | "build": "abc", 23 | "build_number": 0, 24 | "depends": [ 25 | ], 26 | "license": "BSD", 27 | "license_family": "BSD", 28 | "md5": "85107fc10154734ef34a5a75685be684", 29 | "name": "a", 30 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 31 | "size": 222503, 32 | "subdir": "linux-64", 33 | "timestamp": 1578950023135, 34 | "version": "0.2.0" 35 | }, 36 | "B_0.1.0.tar.bz2": { 37 | "build": "abc", 38 | "build_number": 0, 39 | "depends": [ 40 | "a"GLIBC_PLACEHOLDER 41 | ], 42 | "license": "BSD", 43 | "license_family": "BSD", 44 | "md5": "85107fc10154734ef34a5a75685be684", 45 | "name": "b", 46 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 47 | "size": 222503, 48 | "subdir": "linux-64", 49 | "timestamp": 1578950023135, 50 | "version": "0.1.0" 51 | } 52 | }, 53 | "removed": [], 54 | "repodata_version": 1 55 | } 56 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_a/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/test-server/channel_a/noarch/_r-mutex-1.0.1-anacondar_1.tar.bz2 -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_a/noarch/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "noarch" 4 | }, 5 | "packages": { 6 | "_r-mutex-1.0.1-anacondar_1.tar.bz2": { 7 | "build": "anacondar_1", 8 | "build_number": 1, 9 | "constrains": [], 10 | "depends": [], 11 | "license": "BSD", 12 | "md5": "19f9db5f4f1b7f5ef5f6d67207f25f38", 13 | "name": "_r-mutex", 14 | "noarch": "generic", 15 | "platform": null, 16 | "sha256": "e58f9eeb416b92b550e824bcb1b9fb1958dee69abfe3089dfd1a9173e3a0528a", 17 | "size": 3566, 18 | "subdir": "noarch", 19 | "timestamp": 1562343890778, 20 | "track_features": "", 21 | "version": "1.0.1" 22 | }, 23 | "testpkg_0.1.0.tar.bz2": { 24 | "build": "abc", 25 | "build_number": 0, 26 | "depends": [], 27 | "license": "BSD", 28 | "license_family": "BSD", 29 | "md5": "85107fc10154734ef34a5a75685be684", 30 | "name": "testpkg", 31 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 32 | "size": 222503, 33 | "subdir": "noarch", 34 | "timestamp": 1578950023135, 35 | "version": "0.1.0" 36 | } 37 | }, 38 | "removed": [], 39 | "repodata_version": 1 40 | } 41 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_a/win-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "win-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "win-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | }, 20 | "A_0.2.0.tar.bz2": { 21 | "build": "abc", 22 | "build_number": 0, 23 | "depends": [], 24 | "license": "BSD", 25 | "license_family": "BSD", 26 | "md5": "85107fc10154734ef34a5a75685be684", 27 | "name": "a", 28 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 29 | "size": 222503, 30 | "subdir": "win-64", 31 | "timestamp": 1578950023135, 32 | "version": "0.2.0" 33 | }, 34 | "B_0.1.0.tar.bz2": { 35 | "build": "abc", 36 | "build_number": 0, 37 | "depends": ["a"], 38 | "license": "BSD", 39 | "license_family": "BSD", 40 | "md5": "85107fc10154734ef34a5a75685be684", 41 | "name": "b", 42 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 43 | "size": 222503, 44 | "subdir": "win-64", 45 | "timestamp": 1578950023135, 46 | "version": "0.1.0" 47 | } 48 | }, 49 | "removed": [], 50 | "repodata_version": 1 51 | } 52 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_a/win-64/repodata.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/test-server/channel_a/win-64/repodata.tar.bz2 -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_a/win-64/repodata.tpl: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "win-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [ 10 | ], 11 | "license": "BSD", 12 | "license_family": "BSD", 13 | "md5": "85107fc10154734ef34a5a75685be684", 14 | "name": "a", 15 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 16 | "size": 222503, 17 | "subdir": "win-64", 18 | "timestamp": 1578950023135, 19 | "version": "0.1.0" 20 | }, 21 | "A_0.2.0.tar.bz2": { 22 | "build": "abc", 23 | "build_number": 0, 24 | "depends": [ 25 | ], 26 | "license": "BSD", 27 | "license_family": "BSD", 28 | "md5": "85107fc10154734ef34a5a75685be684", 29 | "name": "a", 30 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 31 | "size": 222503, 32 | "subdir": "win-64", 33 | "timestamp": 1578950023135, 34 | "version": "0.2.0" 35 | }, 36 | "B_0.1.0.tar.bz2": { 37 | "build": "abc", 38 | "build_number": 0, 39 | "depends": [ 40 | "a"GLIBC_PLACEHOLDER 41 | ], 42 | "license": "BSD", 43 | "license_family": "BSD", 44 | "md5": "85107fc10154734ef34a5a75685be684", 45 | "name": "b", 46 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 47 | "size": 222503, 48 | "subdir": "win-64", 49 | "timestamp": 1578950023135, 50 | "version": "0.1.0" 51 | } 52 | }, 53 | "removed": [], 54 | "repodata_version": 1 55 | } 56 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_b/linux-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "linux-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "linux-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | } 20 | }, 21 | "removed": [], 22 | "repodata_version": 1 23 | } 24 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_b/noarch/repodata.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/channel_b/win-64/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "win-64" 4 | }, 5 | "packages": { 6 | "A_0.1.0.tar.bz2": { 7 | "build": "abc", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "85107fc10154734ef34a5a75685be684", 13 | "name": "a", 14 | "sha256": "398831eff682d2c975b360d64656d8f475cbc1f1b6d0ee33d86285190e7ee4d1", 15 | "size": 222503, 16 | "subdir": "win-64", 17 | "timestamp": 1578950023135, 18 | "version": "0.1.0" 19 | } 20 | }, 21 | "removed": [], 22 | "repodata_version": 1 23 | } 24 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/repo/channeldata.json: -------------------------------------------------------------------------------- 1 | { 2 | "channeldata_version": 1, 3 | "packages": { 4 | "test-package": { 5 | "activate.d": false, 6 | "binary_prefix": false, 7 | "deactivate.d": false, 8 | "description": null, 9 | "dev_url": null, 10 | "doc_source_url": null, 11 | "doc_url": null, 12 | "home": "https://github.com/mamba-org/mamba", 13 | "icon_hash": null, 14 | "icon_url": null, 15 | "identifiers": null, 16 | "keywords": null, 17 | "license": "BSD", 18 | "post_link": false, 19 | "pre_link": false, 20 | "pre_unlink": false, 21 | "recipe_origin": null, 22 | "run_exports": {}, 23 | "source_git_url": null, 24 | "source_url": null, 25 | "subdirs": ["noarch"], 26 | "summary": "I am just a test package!", 27 | "tags": null, 28 | "text_prefix": false, 29 | "timestamp": 1613117294, 30 | "version": "0.1" 31 | } 32 | }, 33 | "subdirs": ["noarch"] 34 | } 35 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/repo/noarch/current_repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "noarch" 4 | }, 5 | "packages": { 6 | "test-package-0.1-0.tar.bz2": { 7 | "build": "0", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "2a8595f37faa2950e1b433acbe91d481", 13 | "name": "test-package", 14 | "noarch": "generic", 15 | "sha256": "b908ffce2d26d94c58c968abf286568d4bcf87d1cfe6c994958351724a6f6988", 16 | "size": 5719, 17 | "subdir": "noarch", 18 | "timestamp": 1613117294885, 19 | "version": "0.1" 20 | } 21 | }, 22 | "packages.conda": {}, 23 | "removed": [], 24 | "repodata_version": 1 25 | } 26 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/repo/noarch/current_repodata.json.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/test-server/repo/noarch/current_repodata.json.bz2 -------------------------------------------------------------------------------- /micromamba/tests/test-server/repo/noarch/repodata.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "noarch" 4 | }, 5 | "packages": { 6 | "test-package-0.1-0.tar.bz2": { 7 | "build": "0", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "2a8595f37faa2950e1b433acbe91d481", 13 | "name": "test-package", 14 | "noarch": "generic", 15 | "sha256": "b908ffce2d26d94c58c968abf286568d4bcf87d1cfe6c994958351724a6f6988", 16 | "size": 5719, 17 | "subdir": "noarch", 18 | "timestamp": 1613117294885, 19 | "version": "0.1" 20 | } 21 | }, 22 | "packages.conda": {}, 23 | "removed": [], 24 | "repodata_version": 1 25 | } 26 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/repo/noarch/repodata.json.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/test-server/repo/noarch/repodata.json.bz2 -------------------------------------------------------------------------------- /micromamba/tests/test-server/repo/noarch/repodata_from_packages.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "subdir": "noarch" 4 | }, 5 | "packages": { 6 | "test-package-0.1-0.tar.bz2": { 7 | "build": "0", 8 | "build_number": 0, 9 | "depends": [], 10 | "license": "BSD", 11 | "license_family": "BSD", 12 | "md5": "2a8595f37faa2950e1b433acbe91d481", 13 | "name": "test-package", 14 | "noarch": "generic", 15 | "sha256": "b908ffce2d26d94c58c968abf286568d4bcf87d1cfe6c994958351724a6f6988", 16 | "size": 5719, 17 | "subdir": "noarch", 18 | "timestamp": 1613117294885, 19 | "version": "0.1" 20 | } 21 | }, 22 | "packages.conda": {}, 23 | "removed": [], 24 | "repodata_version": 1 25 | } 26 | -------------------------------------------------------------------------------- /micromamba/tests/test-server/repo/noarch/repodata_from_packages.json.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/test-server/repo/noarch/repodata_from_packages.json.bz2 -------------------------------------------------------------------------------- /micromamba/tests/test-server/repo/noarch/test-package-0.1-0.tar.bz2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mamba-org/mamba/6e4be2889c3a406001d043b8e2dc3a0fcedb025a/micromamba/tests/test-server/repo/noarch/test-package-0.1-0.tar.bz2 -------------------------------------------------------------------------------- /micromamba/tests/test-server/repo/recipes/test-package/meta.yaml: -------------------------------------------------------------------------------- 1 | package: 2 | name: test-package 3 | version: 0.1 4 | 5 | build: 6 | number: 0 7 | script: echo Hello world 8 | noarch: generic 9 | 10 | about: 11 | home: https://github.com/mamba-org/mamba 12 | license: BSD 13 | license_family: BSD 14 | summary: I am just a test package! 15 | -------------------------------------------------------------------------------- /micromamba/tests/test_history.py: -------------------------------------------------------------------------------- 1 | import re 2 | 3 | # Need to import everything to get fixtures 4 | from .helpers import * # noqa: F403 5 | from . import helpers 6 | 7 | 8 | def test_history(tmp_home, tmp_root_prefix): 9 | env_name = "myenv" 10 | helpers.create("-n", env_name, "python=3.8") 11 | helpers.install("-n", env_name, "xtl") 12 | helpers.uninstall("-n", env_name, "xtl") 13 | 14 | effective_prefix = tmp_root_prefix / "envs" / env_name 15 | history_path = effective_prefix / "conda-meta" / "history" 16 | assert history_path.exists() 17 | with open(history_path) as f: 18 | history = f.read() 19 | assert len(re.findall(r"\+https:\/\/conda.anaconda.org\/conda-forge\/.+::xtl", history)) > 0 20 | assert len(re.findall(r"-https:\/\/conda.anaconda.org\/conda-forge\/.+::xtl", history)) > 0 21 | -------------------------------------------------------------------------------- /micromamba/tests/test_virtual_pkgs.py: -------------------------------------------------------------------------------- 1 | import os 2 | import platform 3 | 4 | from .helpers import info 5 | 6 | 7 | class TestVirtualPkgs: 8 | def test_virtual_packages(self): 9 | infos = info() 10 | 11 | assert "virtual packages :" in infos 12 | assert "__archspec=1=" in infos 13 | if platform.system() == "Windows": 14 | assert "__win" in infos 15 | elif platform.system() == "Darwin": 16 | assert "__unix=0=0" in infos 17 | assert "__osx" in infos 18 | elif platform.system() == "Linux": 19 | assert "__unix=0=0" in infos 20 | assert "__glibc" in infos 21 | linux_ver = platform.release().split("-", 1)[0] 22 | assert f"__linux={linux_ver}=0" in infos 23 | 24 | def test_virtual_linux(self): 25 | if platform.system() == "Linux": 26 | infos = info() 27 | assert "__linux=" in infos 28 | assert "__linux=0=0" not in infos 29 | else: 30 | infos = info(env={**os.environ, "CONDA_SUBDIR": "linux-64"}) 31 | assert "__linux=0=0" in infos 32 | -------------------------------------------------------------------------------- /micromamba/tests/yaml_env.yml: -------------------------------------------------------------------------------- 1 | name: yaml_testenv 2 | channels: 3 | - conda-forge 4 | dependencies: 5 | - xtensor 6 | - xsimd 7 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.pytest.ini_options] 2 | minversion = "6.0" 3 | tmp_path_retention_policy = "failed" 4 | addopts = "--color=yes" 5 | 6 | [tool.ruff] 7 | line-length = 100 8 | target-version = "py37" 9 | [tool.ruff.format] 10 | line-ending = "lf" 11 | -------------------------------------------------------------------------------- /vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", 3 | "dependencies": [ 4 | "zstd", 5 | "curl", 6 | { 7 | "name": "winreg", 8 | "platform": "windows" 9 | }, 10 | { 11 | "features": ["bzip2", "lz4", "lzma", "lzo", "crypto", "zstd"], 12 | "name": "libarchive" 13 | }, 14 | { 15 | "host": true, 16 | "name": "vcpkg-cmake" 17 | }, 18 | { 19 | "host": true, 20 | "name": "vcpkg-cmake-config" 21 | } 22 | ], 23 | "homepage": "https://github.com/mamba-org/mamba", 24 | "license": "BSD-3-Clause", 25 | "name": "micromamba", 26 | "supports": "x64 | (arm64 & !windows)" 27 | } 28 | --------------------------------------------------------------------------------