From 055adedf0b5e78e6724691b99eadfc5ce8c70ece Mon Sep 17 00:00:00 2001 From: AntoinePrv Date: Wed, 13 Sep 2023 16:19:50 +0200 Subject: [PATCH] No ugly kenum --- .../include/mamba/api/configuration_impl.hpp | 24 +++++----- libmamba/include/mamba/core/context.hpp | 22 ++++----- libmamba/src/api/channel_loader.cpp | 2 +- libmamba/src/api/install.cpp | 2 +- libmamba/src/api/remove.cpp | 2 +- libmamba/src/api/update.cpp | 2 +- libmamba/src/core/channel.cpp | 4 +- libmamba/src/core/context.cpp | 8 ++-- libmamba/src/core/download.cpp | 2 +- libmamba/src/core/fetch.cpp | 2 +- libmamba/src/core/package_cache.cpp | 8 ++-- libmamba/src/core/package_handling.cpp | 6 +-- libmamba/tests/src/core/test_channel.cpp | 6 +-- .../tests/src/core/test_configuration.cpp | 46 ++++++++----------- libmambapy/libmambapy/__init__.pyi | 14 +++--- libmambapy/src/main.cpp | 6 +-- mamba/mamba/utils.py | 6 +-- micromamba/src/common_options.cpp | 20 ++++---- micromamba/src/server.cpp | 2 +- 19 files changed, 89 insertions(+), 95 deletions(-) diff --git a/libmamba/include/mamba/api/configuration_impl.hpp b/libmamba/include/mamba/api/configuration_impl.hpp index c49215136b..0f94b76671 100644 --- a/libmamba/include/mamba/api/configuration_impl.hpp +++ b/libmamba/include/mamba/api/configuration_impl.hpp @@ -200,15 +200,15 @@ namespace YAML { static Node encode(const mamba::VerificationLevel& rhs) { - if (rhs == mamba::VerificationLevel::kDisabled) + if (rhs == mamba::VerificationLevel::Disabled) { return Node("disabled"); } - else if (rhs == mamba::VerificationLevel::kWarn) + else if (rhs == mamba::VerificationLevel::Warn) { return Node("warn"); } - else if (rhs == mamba::VerificationLevel::kEnabled) + else if (rhs == mamba::VerificationLevel::Enabled) { return Node("enabled"); } @@ -229,15 +229,15 @@ namespace YAML if (str == "enabled") { - rhs = mamba::VerificationLevel::kEnabled; + rhs = mamba::VerificationLevel::Enabled; } else if (str == "warn") { - rhs = mamba::VerificationLevel::kWarn; + rhs = mamba::VerificationLevel::Warn; } else if (str == "disabled") { - rhs = mamba::VerificationLevel::kDisabled; + rhs = mamba::VerificationLevel::Disabled; } else { @@ -255,15 +255,15 @@ namespace YAML { static Node encode(const mamba::ChannelPriority& rhs) { - if (rhs == mamba::ChannelPriority::kStrict) + if (rhs == mamba::ChannelPriority::Strict) { return Node("strict"); } - else if (rhs == mamba::ChannelPriority::kFlexible) + else if (rhs == mamba::ChannelPriority::Flexible) { return Node("flexible"); } - else if (rhs == mamba::ChannelPriority::kDisabled) + else if (rhs == mamba::ChannelPriority::Disabled) { return Node("disabled"); } @@ -284,15 +284,15 @@ namespace YAML if (str == "strict") { - rhs = mamba::ChannelPriority::kStrict; + rhs = mamba::ChannelPriority::Strict; } else if ((str == "flexible") || (str == "true")) { - rhs = mamba::ChannelPriority::kFlexible; + rhs = mamba::ChannelPriority::Flexible; } else if (str == "disabled") { - rhs = mamba::ChannelPriority::kDisabled; + rhs = mamba::ChannelPriority::Disabled; } else { diff --git a/libmamba/include/mamba/core/context.hpp b/libmamba/include/mamba/core/context.hpp index cebd2b5a04..f28f060d90 100644 --- a/libmamba/include/mamba/core/context.hpp +++ b/libmamba/include/mamba/core/context.hpp @@ -25,14 +25,14 @@ namespace mamba { enum class VerificationLevel { - kDisabled, - kWarn, - kEnabled + Disabled, + Warn, + Enabled }; struct ValidationOptions { - VerificationLevel safety_checks = VerificationLevel::kWarn; + VerificationLevel safety_checks = VerificationLevel::Warn; bool extra_safety_checks = false; bool verify_artifacts = false; }; @@ -40,16 +40,16 @@ namespace mamba enum class ChannelPriority { - kDisabled, - kFlexible, - kStrict + Disabled, + Flexible, + Strict }; enum class AuthenticationType { - kBasicHTTPAuthentication, - kBearerToken, - kCondaToken + BasicHTTPAuthentication, + BearerToken, + CondaToken }; struct AuthenticationInfo @@ -153,7 +153,7 @@ namespace mamba std::size_t local_repodata_ttl = 1; // take from header bool offline = false; - ChannelPriority channel_priority = ChannelPriority::kFlexible; + ChannelPriority channel_priority = ChannelPriority::Flexible; bool auto_activate_base = false; bool extract_sparse = false; diff --git a/libmamba/src/api/channel_loader.cpp b/libmamba/src/api/channel_loader.cpp index ff953ee154..f979ef3694 100644 --- a/libmamba/src/api/channel_loader.cpp +++ b/libmamba/src/api/channel_loader.cpp @@ -82,7 +82,7 @@ namespace mamba } auto sdir = std::move(sdires).value(); subdirs.push_back(std::move(sdir)); - if (ctx.channel_priority == ChannelPriority::kDisabled) + if (ctx.channel_priority == ChannelPriority::Disabled) { priorities.push_back(std::make_pair(0, 0)); } diff --git a/libmamba/src/api/install.cpp b/libmamba/src/api/install.cpp index 2507067fec..3605ba95a2 100644 --- a/libmamba/src/api/install.cpp +++ b/libmamba/src/api/install.cpp @@ -511,7 +511,7 @@ namespace mamba { { SOLVER_FLAG_ALLOW_UNINSTALL, ctx.allow_uninstall }, { SOLVER_FLAG_ALLOW_DOWNGRADE, ctx.allow_downgrade }, - { SOLVER_FLAG_STRICT_REPO_PRIORITY, ctx.channel_priority == ChannelPriority::kStrict }, + { SOLVER_FLAG_STRICT_REPO_PRIORITY, ctx.channel_priority == ChannelPriority::Strict }, } ); diff --git a/libmamba/src/api/remove.cpp b/libmamba/src/api/remove.cpp index 6460a64c46..2e02d68fdc 100644 --- a/libmamba/src/api/remove.cpp +++ b/libmamba/src/api/remove.cpp @@ -129,7 +129,7 @@ namespace mamba { SOLVER_FLAG_ALLOW_DOWNGRADE, 1 }, { SOLVER_FLAG_ALLOW_UNINSTALL, 1 }, { SOLVER_FLAG_STRICT_REPO_PRIORITY, - ctx.channel_priority == ChannelPriority::kStrict }, + ctx.channel_priority == ChannelPriority::Strict }, } ); diff --git a/libmamba/src/api/update.cpp b/libmamba/src/api/update.cpp index 0e3c1b2832..0162f059cd 100644 --- a/libmamba/src/api/update.cpp +++ b/libmamba/src/api/update.cpp @@ -75,7 +75,7 @@ namespace mamba { { SOLVER_FLAG_ALLOW_DOWNGRADE, ctx.allow_downgrade }, { SOLVER_FLAG_ALLOW_UNINSTALL, ctx.allow_uninstall }, - { SOLVER_FLAG_STRICT_REPO_PRIORITY, ctx.channel_priority == ChannelPriority::kStrict }, + { SOLVER_FLAG_STRICT_REPO_PRIORITY, ctx.channel_priority == ChannelPriority::Strict }, } ); diff --git a/libmamba/src/core/channel.cpp b/libmamba/src/core/channel.cpp index e3be7855a3..ebe4053620 100644 --- a/libmamba/src/core/channel.cpp +++ b/libmamba/src/core/channel.cpp @@ -619,12 +619,12 @@ namespace mamba const auto& authentication_info = m_context.authentication_info(); auto it = authentication_info.find(auth); if (it != authentication_info.end() - && it->second.type == AuthenticationType::kCondaToken) + && it->second.type == AuthenticationType::CondaToken) { chan.m_token = it->second.value; break; } - else if (it != authentication_info.end() && it->second.type == AuthenticationType::kBasicHTTPAuthentication) + else if (it != authentication_info.end() && it->second.type == AuthenticationType::BasicHTTPAuthentication) { chan.m_auth = it->second.value; break; diff --git a/libmamba/src/core/context.cpp b/libmamba/src/core/context.cpp index 82c2427757..757756db85 100644 --- a/libmamba/src/core/context.cpp +++ b/libmamba/src/core/context.cpp @@ -224,7 +224,7 @@ namespace mamba token_url = token_url.substr(0, token_url.size() - 6); std::string token_content = read_contents(entry.path()); - AuthenticationInfo auth_info{ AuthenticationType::kCondaToken, token_content }; + AuthenticationInfo auth_info{ AuthenticationType::CondaToken, token_content }; m_authentication_info[token_url] = auth_info; LOG_INFO << "Found token for " << token_url << " at " << entry.path(); } @@ -247,14 +247,14 @@ namespace mamba AuthenticationInfo info; if (type == "CondaToken") { - info.type = AuthenticationType::kCondaToken; + info.type = AuthenticationType::CondaToken; info.value = el["token"].get(); LOG_INFO << "Found token for host " << host << " in ~/.mamba/auth/authentication.json"; } else if (type == "BasicHTTPAuthentication") { - info.type = AuthenticationType::kBasicHTTPAuthentication; + info.type = AuthenticationType::BasicHTTPAuthentication; const auto& user = el.value("user", ""); auto pass = decode_base64(el["password"].get()); if (pass) @@ -273,7 +273,7 @@ namespace mamba } else if (type == "BearerToken") { - info.type = AuthenticationType::kBearerToken; + info.type = AuthenticationType::BearerToken; info.value = el["token"].get(); LOG_INFO << "Found bearer token for host " << host << " in ~/.mamba/auth/authentication.json"; diff --git a/libmamba/src/core/download.cpp b/libmamba/src/core/download.cpp index 56ee69fdc5..dc696ee2b2 100644 --- a/libmamba/src/core/download.cpp +++ b/libmamba/src/core/download.cpp @@ -223,7 +223,7 @@ namespace mamba if (context.authentication_info().count(host)) { const auto& auth = context.authentication_info().at(host); - if (auth.type == AuthenticationType::kBearerToken) + if (auth.type == AuthenticationType::BearerToken) { m_handle.add_header(fmt::format("Authorization: Bearer {}", auth.value)); } diff --git a/libmamba/src/core/fetch.cpp b/libmamba/src/core/fetch.cpp index 8f62d11c5d..de1507f62b 100644 --- a/libmamba/src/core/fetch.cpp +++ b/libmamba/src/core/fetch.cpp @@ -260,7 +260,7 @@ namespace mamba if (m_context.authentication_info().count(host)) { const auto& auth = m_context.authentication_info().at(host); - if (auth.type == AuthenticationType::kBearerToken) + if (auth.type == AuthenticationType::BearerToken) { m_curl_handle->add_header(fmt::format("Authorization: Bearer {}", auth.value)); } diff --git a/libmamba/src/core/package_cache.cpp b/libmamba/src/core/package_cache.cpp index f02364f555..a3b547d5f6 100644 --- a/libmamba/src/core/package_cache.cpp +++ b/libmamba/src/core/package_cache.cpp @@ -139,13 +139,13 @@ namespace mamba } else { - if (options.safety_checks == VerificationLevel::kWarn) + if (options.safety_checks == VerificationLevel::Warn) { LOG_WARNING << "Could not validate package '" + tarball_path.string() + "': md5 and sha256 sum unknown.\n" "Set safety_checks to disabled to override this warning."; } - else if (options.safety_checks == VerificationLevel::kEnabled) + else if (options.safety_checks == VerificationLevel::Enabled) { // we cannot validate this archive, but we could also not validate a downloaded // archive since we just don't know the sha256 or md5 sum @@ -207,14 +207,14 @@ namespace mamba || (!s.sha256.empty() && repodata_record.contains("sha256")); if (!can_validate) { - if (options.safety_checks == VerificationLevel::kWarn) + if (options.safety_checks == VerificationLevel::Warn) { LOG_WARNING << "Could not validate package '" + repodata_record_path.string() + "': md5 and sha256 sum unknown.\n" "Set safety_checks to disabled to override this warning."; } - else if (options.safety_checks == VerificationLevel::kEnabled) + else if (options.safety_checks == VerificationLevel::Enabled) { throw std::runtime_error( "Could not validate package '" + repodata_record_path.string() diff --git a/libmamba/src/core/package_handling.cpp b/libmamba/src/core/package_handling.cpp index 65ead8fa08..d26c8787cc 100644 --- a/libmamba/src/core/package_handling.cpp +++ b/libmamba/src/core/package_handling.cpp @@ -830,13 +830,13 @@ namespace mamba bool validate(const fs::u8path& pkg_folder, const ValidationOptions& options) { auto safety_checks = options.safety_checks; - if (safety_checks == VerificationLevel::kDisabled) + if (safety_checks == VerificationLevel::Disabled) { return true; } - bool is_warn = safety_checks == VerificationLevel::kWarn; - bool is_fail = safety_checks == VerificationLevel::kEnabled; + bool is_warn = safety_checks == VerificationLevel::Warn; + bool is_fail = safety_checks == VerificationLevel::Enabled; bool full_validation = options.extra_safety_checks; try diff --git a/libmamba/tests/src/core/test_channel.cpp b/libmamba/tests/src/core/test_channel.cpp index 3d5c9c33ae..342c1e3e6b 100644 --- a/libmamba/tests/src/core/test_channel.cpp +++ b/libmamba/tests/src/core/test_channel.cpp @@ -492,7 +492,7 @@ namespace mamba { auto& ctx = mambatests::context(); ctx.authentication_info()["conda.anaconda.org"] = AuthenticationInfo{ - AuthenticationType::kCondaToken, + AuthenticationType::CondaToken, "my-12345-token" }; @@ -515,11 +515,11 @@ namespace mamba { auto& ctx = mambatests::context(); ctx.authentication_info()["conda.anaconda.org"] = AuthenticationInfo{ - AuthenticationType::kCondaToken, + AuthenticationType::CondaToken, "base-token" }; ctx.authentication_info()["conda.anaconda.org/conda-forge"] = AuthenticationInfo{ - AuthenticationType::kCondaToken, + AuthenticationType::CondaToken, "channel-token" }; diff --git a/libmamba/tests/src/core/test_configuration.cpp b/libmamba/tests/src/core/test_configuration.cpp index cd16ba2ced..268da94f4f 100644 --- a/libmamba/tests/src/core/test_configuration.cpp +++ b/libmamba/tests/src/core/test_configuration.cpp @@ -839,23 +839,20 @@ namespace mamba load_test_config({ rc1, rc2, rc3 }); CHECK_EQ( config.at("channel_priority").value(), - ChannelPriority::kFlexible + ChannelPriority::Flexible ); - CHECK(ctx.channel_priority == ChannelPriority::kFlexible); + CHECK(ctx.channel_priority == ChannelPriority::Flexible); load_test_config({ rc3, rc1, rc2 }); CHECK_EQ( config.at("channel_priority").value(), - ChannelPriority::kDisabled + ChannelPriority::Disabled ); - CHECK(ctx.channel_priority == ChannelPriority::kDisabled); + CHECK(ctx.channel_priority == ChannelPriority::Disabled); load_test_config({ rc2, rc1, rc3 }); - CHECK_EQ( - config.at("channel_priority").value(), - ChannelPriority::kStrict - ); - CHECK(ctx.channel_priority == ChannelPriority::kStrict); + CHECK_EQ(config.at("channel_priority").value(), ChannelPriority::Strict); + CHECK(ctx.channel_priority == ChannelPriority::Strict); env::set("MAMBA_CHANNEL_PRIORITY", "strict"); load_test_config(rc3); @@ -868,11 +865,8 @@ namespace mamba config.dump(MAMBA_SHOW_CONFIG_VALUES | MAMBA_SHOW_CONFIG_SRCS), "channel_priority: strict # 'MAMBA_CHANNEL_PRIORITY' > '" + src + "'" ); - CHECK_EQ( - config.at("channel_priority").value(), - ChannelPriority::kStrict - ); - CHECK_EQ(ctx.channel_priority, ChannelPriority::kStrict); + CHECK_EQ(config.at("channel_priority").value(), ChannelPriority::Strict); + CHECK_EQ(ctx.channel_priority, ChannelPriority::Strict); config.at("channel_priority").set_yaml_value("flexible").compute(); CHECK_EQ( @@ -881,9 +875,9 @@ namespace mamba ); CHECK_EQ( config.at("channel_priority").value(), - ChannelPriority::kFlexible + ChannelPriority::Flexible ); - CHECK_EQ(ctx.channel_priority, ChannelPriority::kFlexible); + CHECK_EQ(ctx.channel_priority, ChannelPriority::Flexible); env::set("MAMBA_CHANNEL_PRIORITY", "stric"); REQUIRE_THROWS_AS(load_test_config(rc3), YAML::Exception); @@ -1012,20 +1006,20 @@ namespace mamba load_test_config({ rc1, rc2, rc3 }); CHECK_EQ( config.at("safety_checks").value(), - VerificationLevel::kEnabled + VerificationLevel::Enabled ); - CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::kEnabled); + CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::Enabled); load_test_config({ rc2, rc1, rc3 }); - CHECK_EQ(config.at("safety_checks").value(), VerificationLevel::kWarn); - CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::kWarn); + CHECK_EQ(config.at("safety_checks").value(), VerificationLevel::Warn); + CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::Warn); load_test_config({ rc3, rc1, rc3 }); CHECK_EQ( config.at("safety_checks").value(), - VerificationLevel::kDisabled + VerificationLevel::Disabled ); - CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::kDisabled); + CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::Disabled); env::set("MAMBA_SAFETY_CHECKS", "warn"); load_test_config(rc1); @@ -1038,8 +1032,8 @@ namespace mamba config.dump(MAMBA_SHOW_CONFIG_VALUES | MAMBA_SHOW_CONFIG_SRCS), "safety_checks: warn # 'MAMBA_SAFETY_CHECKS' > '" + src + "'" ); - CHECK_EQ(config.at("safety_checks").value(), VerificationLevel::kWarn); - CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::kWarn); + CHECK_EQ(config.at("safety_checks").value(), VerificationLevel::Warn); + CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::Warn); config.at("safety_checks").set_yaml_value("disabled").compute(); CHECK_EQ( @@ -1048,9 +1042,9 @@ namespace mamba ); CHECK_EQ( config.at("safety_checks").value(), - VerificationLevel::kDisabled + VerificationLevel::Disabled ); - CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::kDisabled); + CHECK_EQ(ctx.validation_params.safety_checks, VerificationLevel::Disabled); env::set("MAMBA_SAFETY_CHECKS", "yeap"); REQUIRE_THROWS_AS(load_test_config(rc2), std::runtime_error); diff --git a/libmambapy/libmambapy/__init__.pyi b/libmambapy/libmambapy/__init__.pyi index c789c540c9..8fcf2427ab 100644 --- a/libmambapy/libmambapy/__init__.pyi +++ b/libmambapy/libmambapy/__init__.pyi @@ -182,11 +182,11 @@ class ChannelPriority: """ Members: - kFlexible + Flexible - kStrict + Strict - kDisabled + Disabled """ def __eq__(self, other: object) -> bool: ... @@ -208,10 +208,10 @@ class ChannelPriority: """ :type: int """ - __members__: dict # value = {'kFlexible': , 'kStrict': , 'kDisabled': } - kDisabled: libmambapy.bindings.ChannelPriority # value = - kFlexible: libmambapy.bindings.ChannelPriority # value = - kStrict: libmambapy.bindings.ChannelPriority # value = + Disabled: libmambapy.bindings.ChannelPriority # value = + Flexible: libmambapy.bindings.ChannelPriority # value = + Strict: libmambapy.bindings.ChannelPriority # value = + __members__: dict # value = {'Flexible': , 'Strict': , 'Disabled': } pass class CompressedProblemsGraph: diff --git a/libmambapy/src/main.cpp b/libmambapy/src/main.cpp index 2634aea919..132711a5ed 100644 --- a/libmambapy/src/main.cpp +++ b/libmambapy/src/main.cpp @@ -573,9 +573,9 @@ PYBIND11_MODULE(bindings, m) .def("download", &MultiDownloadTarget::download); py::enum_(m, "ChannelPriority") - .value("kFlexible", ChannelPriority::kFlexible) - .value("kStrict", ChannelPriority::kStrict) - .value("kDisabled", ChannelPriority::kDisabled); + .value("Flexible", ChannelPriority::Flexible) + .value("Strict", ChannelPriority::Strict) + .value("Disabled", ChannelPriority::Disabled); py::enum_(m, "LogLevel") .value("TRACE", mamba::log_level::trace) diff --git a/mamba/mamba/utils.py b/mamba/mamba/utils.py index e84ae0f820..32566d46ab 100644 --- a/mamba/mamba/utils.py +++ b/mamba/mamba/utils.py @@ -276,11 +276,11 @@ def get_base_url(url, name=None): api_ctx.use_only_tar_bz2 = context.use_only_tar_bz2 if context.channel_priority is ChannelPriority.STRICT: - api_ctx.channel_priority = api.ChannelPriority.kStrict + api_ctx.channel_priority = api.ChannelPriority.Strict elif context.channel_priority is ChannelPriority.FLEXIBLE: - api_ctx.channel_priority = api.ChannelPriority.kFlexible + api_ctx.channel_priority = api.ChannelPriority.Flexible elif context.channel_priority is ChannelPriority.DISABLED: - api_ctx.channel_priority = api.ChannelPriority.kDisabled + api_ctx.channel_priority = api.ChannelPriority.Disabled def to_conda_channel(channel, platform): diff --git a/micromamba/src/common_options.cpp b/micromamba/src/common_options.cpp index eb4c3ca57b..8f43c8e7ab 100644 --- a/micromamba/src/common_options.cpp +++ b/micromamba/src/common_options.cpp @@ -202,9 +202,9 @@ init_channel_parser(CLI::App* subcom, Configuration& config) override_channels.description() ); - std::map cp_map = { { "disabled", ChannelPriority::kDisabled }, - { "flexible", ChannelPriority::kFlexible }, - { "strict", ChannelPriority::kStrict } }; + std::map cp_map = { { "disabled", ChannelPriority::Disabled }, + { "flexible", ChannelPriority::Flexible }, + { "strict", ChannelPriority::Strict } }; auto& channel_priority = config.at("channel_priority"); subcom ->add_option( @@ -288,7 +288,7 @@ strict_channel_priority_hook(Configuration& config, bool&) if (strict_channel_priority.configured()) { if ((channel_priority.cli_configured() || channel_priority.env_var_configured()) - && (channel_priority.cli_value() != ChannelPriority::kStrict)) + && (channel_priority.cli_value() != ChannelPriority::Strict)) { throw std::runtime_error("Cannot set both 'strict_channel_priority' and 'channel_priority'." ); @@ -302,7 +302,7 @@ strict_channel_priority_hook(Configuration& config, bool&) ); } // Override 'channel_priority' CLI value - channel_priority.set_cli_value(ChannelPriority::kStrict); + channel_priority.set_cli_value(ChannelPriority::Strict); } } } @@ -317,7 +317,7 @@ no_channel_priority_hook(Configuration& config, bool&) if (no_channel_priority.configured()) { if ((channel_priority.cli_configured() || channel_priority.env_var_configured()) - && (channel_priority.cli_value() != ChannelPriority::kDisabled)) + && (channel_priority.cli_value() != ChannelPriority::Disabled)) { throw std::runtime_error("Cannot set both 'no_channel_priority' and 'channel_priority'."); } @@ -330,7 +330,7 @@ no_channel_priority_hook(Configuration& config, bool&) ); } // Override 'channel_priority' CLI value - channel_priority.set_cli_value(ChannelPriority::kDisabled); + channel_priority.set_cli_value(ChannelPriority::Disabled); } } } @@ -422,9 +422,9 @@ init_install_options(CLI::App* subcom, Configuration& config) shortcuts.description() ); - std::map vl_map = { { "enabled", VerificationLevel::kEnabled }, - { "warn", VerificationLevel::kWarn }, - { "disabled", VerificationLevel::kDisabled } }; + std::map vl_map = { { "enabled", VerificationLevel::Enabled }, + { "warn", VerificationLevel::Warn }, + { "disabled", VerificationLevel::Disabled } }; auto& safety_checks = config.at("safety_checks"); subcom ->add_option( diff --git a/micromamba/src/server.cpp b/micromamba/src/server.cpp index b79c817ca6..e19c67d46b 100644 --- a/micromamba/src/server.cpp +++ b/micromamba/src/server.cpp @@ -138,7 +138,7 @@ handle_solve_request( *cache_entry.pool, { { SOLVER_FLAG_ALLOW_UNINSTALL, ctx.allow_uninstall }, { SOLVER_FLAG_ALLOW_DOWNGRADE, ctx.allow_downgrade }, - { SOLVER_FLAG_STRICT_REPO_PRIORITY, ctx.channel_priority == ChannelPriority::kStrict } } + { SOLVER_FLAG_STRICT_REPO_PRIORITY, ctx.channel_priority == ChannelPriority::Strict } } ); solver.add_jobs(specs, SOLVER_INSTALL);