Skip to content

Add missing bidings and other improvements #3990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions libmamba/include/mamba/core/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,24 +156,24 @@ namespace mamba
LinkParams link_params;

download::RemoteFetchParams remote_fetch_params = {
/* .ssl_verify */ { "" },
/* .ssl_no_revoke */ false,
/* .curl_initialized */ false,
/* .user_agent */ { "mamba/" LIBMAMBA_VERSION_STRING },
/* .connect_timeout_secs */ 10.,
/* .retry_timeout */ 2,
/* .retry_backoff */ 3,
/* .max_retries */ 3,
/* .proxy_servers */ {},
.ssl_verify = { "" },
.ssl_no_revoke = false,
.curl_initialized = false,
.user_agent = { "mamba/" LIBMAMBA_VERSION_STRING },
.connect_timeout_secs = 10.,
.retry_timeout = 2,
.retry_backoff = 3,
.max_retries = 3,
.proxy_servers = {},
};

download::Options download_options() const
{
return {
/* .download_threads */ this->threads_params.download_threads,
/* .fail_fast */ false,
/* .sort */ true,
/* .verbose */ this->output_params.verbosity >= 2,
.download_threads = this->threads_params.download_threads,
.fail_fast = false,
.sort = true,
.verbose = this->output_params.verbosity >= 2,
};
}

Expand All @@ -195,31 +195,33 @@ namespace mamba
};

return {
/* .local_repodata_ttl */ get_local_repodata_ttl(),
/* .offline */ this->offline,
/* .force_use_zst */ false // Must override based on ChannelContext
.local_repodata_ttl_s = get_local_repodata_ttl(),
.offline = this->offline,
.repodata_force_use_zst = false // Must override based on ChannelContext
};
}

SubdirDownloadParams subdir_download_params() const
{
return {
/* .offline */ this->offline,
/* .repodata_check_zst */ this->repodata_use_zst,
.offline = this->offline,
.repodata_check_zst = this->repodata_use_zst,
};
}

TransactionParams transaction_params() const
{
return { /* .is_mamba_exe */ command_params.is_mamba_exe,
/* .json_output */ output_params.json,
/* .verbosity */ output_params.verbosity,
/* .shortcut */ shortcuts,
/* .envs_dirs */ envs_dirs,
/* .platform */ platform,
/* .prefix_params */ prefix_params,
/* .link_params */ link_params,
/* .threads_params */ threads_params };
return {
.is_mamba_exe = command_params.is_mamba_exe,
.json_output = output_params.json,
.verbosity = output_params.verbosity,
.shortcuts = shortcuts,
.envs_dirs = envs_dirs,
.platform = platform,
.prefix_params = prefix_params,
.link_params = link_params,
.threads_params = threads_params,
};
}

std::size_t lock_timeout = 0;
Expand Down
1 change: 1 addition & 0 deletions libmambapy/src/libmambapy/bindings/legacy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@ bind_submodule_impl(pybind11::module_ m)
.def_readwrite("output_params", &Context::output_params)
.def_readwrite("threads_params", &Context::threads_params)
.def_readwrite("prefix_params", &Context::prefix_params)
.def_readwrite("link_params", &Context::link_params)
.def_readwrite("validation_params", &Context::validation_params);

static const auto default_transaction_params = TransactionParams{};
Expand Down
2 changes: 2 additions & 0 deletions libmambapy/src/libmambapy/bindings/specs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,10 @@ namespace mambapy
)
.def("is_package", &Channel::is_package)
.def_property("url", &Channel::url, &Channel::set_url)
.def_property_readonly("mirror_urls", &Channel::mirror_urls)
.def_property("platforms", &Channel::platforms, &Channel::set_platforms)
.def_property("display_name", &Channel::display_name, &Channel::set_display_name)
.def_property_readonly("id", &Channel::id)
.def("platform_url", &Channel::platform_url)
.def("platform_urls", &Channel::platform_urls)
.def("url_equivalent_with", &Channel::url_equivalent_with)
Expand Down
Loading