Skip to content

Commit 1f226d6

Browse files
authored
Add missing bidings and other improvements (#3990)
1 parent 7cdf568 commit 1f226d6

File tree

3 files changed

+32
-27
lines changed

3 files changed

+32
-27
lines changed

libmamba/include/mamba/core/context.hpp

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -156,24 +156,24 @@ namespace mamba
156156
LinkParams link_params;
157157

158158
download::RemoteFetchParams remote_fetch_params = {
159-
/* .ssl_verify */ { "" },
160-
/* .ssl_no_revoke */ false,
161-
/* .curl_initialized */ false,
162-
/* .user_agent */ { "mamba/" LIBMAMBA_VERSION_STRING },
163-
/* .connect_timeout_secs */ 10.,
164-
/* .retry_timeout */ 2,
165-
/* .retry_backoff */ 3,
166-
/* .max_retries */ 3,
167-
/* .proxy_servers */ {},
159+
.ssl_verify = { "" },
160+
.ssl_no_revoke = false,
161+
.curl_initialized = false,
162+
.user_agent = { "mamba/" LIBMAMBA_VERSION_STRING },
163+
.connect_timeout_secs = 10.,
164+
.retry_timeout = 2,
165+
.retry_backoff = 3,
166+
.max_retries = 3,
167+
.proxy_servers = {},
168168
};
169169

170170
download::Options download_options() const
171171
{
172172
return {
173-
/* .download_threads */ this->threads_params.download_threads,
174-
/* .fail_fast */ false,
175-
/* .sort */ true,
176-
/* .verbose */ this->output_params.verbosity >= 2,
173+
.download_threads = this->threads_params.download_threads,
174+
.fail_fast = false,
175+
.sort = true,
176+
.verbose = this->output_params.verbosity >= 2,
177177
};
178178
}
179179

@@ -195,31 +195,33 @@ namespace mamba
195195
};
196196

197197
return {
198-
/* .local_repodata_ttl */ get_local_repodata_ttl(),
199-
/* .offline */ this->offline,
200-
/* .force_use_zst */ false // Must override based on ChannelContext
198+
.local_repodata_ttl_s = get_local_repodata_ttl(),
199+
.offline = this->offline,
200+
.repodata_force_use_zst = false // Must override based on ChannelContext
201201
};
202202
}
203203

204204
SubdirDownloadParams subdir_download_params() const
205205
{
206206
return {
207-
/* .offline */ this->offline,
208-
/* .repodata_check_zst */ this->repodata_use_zst,
207+
.offline = this->offline,
208+
.repodata_check_zst = this->repodata_use_zst,
209209
};
210210
}
211211

212212
TransactionParams transaction_params() const
213213
{
214-
return { /* .is_mamba_exe */ command_params.is_mamba_exe,
215-
/* .json_output */ output_params.json,
216-
/* .verbosity */ output_params.verbosity,
217-
/* .shortcut */ shortcuts,
218-
/* .envs_dirs */ envs_dirs,
219-
/* .platform */ platform,
220-
/* .prefix_params */ prefix_params,
221-
/* .link_params */ link_params,
222-
/* .threads_params */ threads_params };
214+
return {
215+
.is_mamba_exe = command_params.is_mamba_exe,
216+
.json_output = output_params.json,
217+
.verbosity = output_params.verbosity,
218+
.shortcuts = shortcuts,
219+
.envs_dirs = envs_dirs,
220+
.platform = platform,
221+
.prefix_params = prefix_params,
222+
.link_params = link_params,
223+
.threads_params = threads_params,
224+
};
223225
}
224226

225227
std::size_t lock_timeout = 0;

libmambapy/src/libmambapy/bindings/legacy.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,7 @@ bind_submodule_impl(pybind11::module_ m)
11671167
.def_readwrite("output_params", &Context::output_params)
11681168
.def_readwrite("threads_params", &Context::threads_params)
11691169
.def_readwrite("prefix_params", &Context::prefix_params)
1170+
.def_readwrite("link_params", &Context::link_params)
11701171
.def_readwrite("validation_params", &Context::validation_params);
11711172

11721173
static const auto default_transaction_params = TransactionParams{};

libmambapy/src/libmambapy/bindings/specs.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,8 +501,10 @@ namespace mambapy
501501
)
502502
.def("is_package", &Channel::is_package)
503503
.def_property("url", &Channel::url, &Channel::set_url)
504+
.def_property_readonly("mirror_urls", &Channel::mirror_urls)
504505
.def_property("platforms", &Channel::platforms, &Channel::set_platforms)
505506
.def_property("display_name", &Channel::display_name, &Channel::set_display_name)
507+
.def_property_readonly("id", &Channel::id)
506508
.def("platform_url", &Channel::platform_url)
507509
.def("platform_urls", &Channel::platform_urls)
508510
.def("url_equivalent_with", &Channel::url_equivalent_with)

0 commit comments

Comments
 (0)