mirror of https://github.com/mamba-org/mamba.git
Support future deprecated API for `Context` (#2494)
Add deprecated API for context and updated stubs accordingly
This commit is contained in:
parent
5b8d2a2149
commit
32c64cdbfe
|
@ -565,6 +565,22 @@ class Context:
|
||||||
def channels(self, arg0: typing.List[str]) -> None:
|
def channels(self, arg0: typing.List[str]) -> None:
|
||||||
pass
|
pass
|
||||||
@property
|
@property
|
||||||
|
def conda_prefix(self) -> Path:
|
||||||
|
"""
|
||||||
|
:type: Path
|
||||||
|
"""
|
||||||
|
@conda_prefix.setter
|
||||||
|
def conda_prefix(self, arg1: Path) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
|
def connect_timeout_secs(self) -> int:
|
||||||
|
"""
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
|
@connect_timeout_secs.setter
|
||||||
|
def connect_timeout_secs(self, arg1: int) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
def custom_channels(self) -> typing.Dict[str, str]:
|
def custom_channels(self) -> typing.Dict[str, str]:
|
||||||
"""
|
"""
|
||||||
:type: typing.Dict[str, str]
|
:type: typing.Dict[str, str]
|
||||||
|
@ -597,6 +613,14 @@ class Context:
|
||||||
def download_only(self, arg0: bool) -> None:
|
def download_only(self, arg0: bool) -> None:
|
||||||
pass
|
pass
|
||||||
@property
|
@property
|
||||||
|
def download_threads(self) -> int:
|
||||||
|
"""
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
|
@download_threads.setter
|
||||||
|
def download_threads(self, arg1: int) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
def dry_run(self) -> bool:
|
def dry_run(self) -> bool:
|
||||||
"""
|
"""
|
||||||
:type: bool
|
:type: bool
|
||||||
|
@ -621,6 +645,22 @@ class Context:
|
||||||
def experimental_sat_error_message(self, arg1: bool) -> None:
|
def experimental_sat_error_message(self, arg1: bool) -> None:
|
||||||
pass
|
pass
|
||||||
@property
|
@property
|
||||||
|
def extract_threads(self) -> int:
|
||||||
|
"""
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
|
@extract_threads.setter
|
||||||
|
def extract_threads(self, arg1: int) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
|
def json(self) -> bool:
|
||||||
|
"""
|
||||||
|
:type: bool
|
||||||
|
"""
|
||||||
|
@json.setter
|
||||||
|
def json(self, arg1: bool) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
def local_repodata_ttl(self) -> int:
|
def local_repodata_ttl(self) -> int:
|
||||||
"""
|
"""
|
||||||
:type: int
|
:type: int
|
||||||
|
@ -629,6 +669,14 @@ class Context:
|
||||||
def local_repodata_ttl(self, arg0: int) -> None:
|
def local_repodata_ttl(self, arg0: int) -> None:
|
||||||
pass
|
pass
|
||||||
@property
|
@property
|
||||||
|
def max_retries(self) -> int:
|
||||||
|
"""
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
|
@max_retries.setter
|
||||||
|
def max_retries(self, arg1: int) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
def offline(self) -> bool:
|
def offline(self) -> bool:
|
||||||
"""
|
"""
|
||||||
:type: bool
|
:type: bool
|
||||||
|
@ -677,6 +725,14 @@ class Context:
|
||||||
def proxy_servers(self, arg0: typing.Dict[str, str]) -> None:
|
def proxy_servers(self, arg0: typing.Dict[str, str]) -> None:
|
||||||
pass
|
pass
|
||||||
@property
|
@property
|
||||||
|
def quiet(self) -> bool:
|
||||||
|
"""
|
||||||
|
:type: bool
|
||||||
|
"""
|
||||||
|
@quiet.setter
|
||||||
|
def quiet(self, arg1: bool) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
def remote_fetch_params(self) -> Context.RemoteFetchParams:
|
def remote_fetch_params(self) -> Context.RemoteFetchParams:
|
||||||
"""
|
"""
|
||||||
:type: Context.RemoteFetchParams
|
:type: Context.RemoteFetchParams
|
||||||
|
@ -685,6 +741,46 @@ class Context:
|
||||||
def remote_fetch_params(self, arg0: Context.RemoteFetchParams) -> None:
|
def remote_fetch_params(self, arg0: Context.RemoteFetchParams) -> None:
|
||||||
pass
|
pass
|
||||||
@property
|
@property
|
||||||
|
def retry_backoff(self) -> int:
|
||||||
|
"""
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
|
@retry_backoff.setter
|
||||||
|
def retry_backoff(self, arg1: int) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
|
def retry_timeout(self) -> int:
|
||||||
|
"""
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
|
@retry_timeout.setter
|
||||||
|
def retry_timeout(self, arg1: int) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
|
def root_prefix(self) -> Path:
|
||||||
|
"""
|
||||||
|
:type: Path
|
||||||
|
"""
|
||||||
|
@root_prefix.setter
|
||||||
|
def root_prefix(self, arg1: Path) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
|
def ssl_verify(self) -> str:
|
||||||
|
"""
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
@ssl_verify.setter
|
||||||
|
def ssl_verify(self, arg1: str) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
|
def target_prefix(self) -> Path:
|
||||||
|
"""
|
||||||
|
:type: Path
|
||||||
|
"""
|
||||||
|
@target_prefix.setter
|
||||||
|
def target_prefix(self, arg1: Path) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
def threads_params(self) -> Context.ThreadsParams:
|
def threads_params(self) -> Context.ThreadsParams:
|
||||||
"""
|
"""
|
||||||
:type: Context.ThreadsParams
|
:type: Context.ThreadsParams
|
||||||
|
@ -716,6 +812,22 @@ class Context:
|
||||||
@use_only_tar_bz2.setter
|
@use_only_tar_bz2.setter
|
||||||
def use_only_tar_bz2(self, arg0: bool) -> None:
|
def use_only_tar_bz2(self, arg0: bool) -> None:
|
||||||
pass
|
pass
|
||||||
|
@property
|
||||||
|
def user_agent(self) -> str:
|
||||||
|
"""
|
||||||
|
:type: str
|
||||||
|
"""
|
||||||
|
@user_agent.setter
|
||||||
|
def user_agent(self, arg1: str) -> None:
|
||||||
|
pass
|
||||||
|
@property
|
||||||
|
def verbosity(self) -> int:
|
||||||
|
"""
|
||||||
|
:type: int
|
||||||
|
"""
|
||||||
|
@verbosity.setter
|
||||||
|
def verbosity(self, arg1: int) -> None:
|
||||||
|
pass
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class DownloadTargetList:
|
class DownloadTargetList:
|
||||||
|
|
|
@ -535,6 +535,201 @@ PYBIND11_MODULE(bindings, m)
|
||||||
.def_readwrite("threads_params", &Context::threads_params)
|
.def_readwrite("threads_params", &Context::threads_params)
|
||||||
.def_readwrite("prefix_params", &Context::prefix_params);
|
.def_readwrite("prefix_params", &Context::prefix_params);
|
||||||
|
|
||||||
|
////////////////////////////////////////////
|
||||||
|
// Support the old deprecated API ///
|
||||||
|
////////////////////////////////////////////
|
||||||
|
// RemoteFetchParams
|
||||||
|
ctx.def_property(
|
||||||
|
"ssl_verify",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.ssl_verify` instead.");
|
||||||
|
return self.remote_fetch_params.ssl_verify;
|
||||||
|
},
|
||||||
|
[](Context& self, std::string sv)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.ssl_verify` instead.");
|
||||||
|
self.remote_fetch_params.ssl_verify = sv;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"max_retries",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.max_retries` instead.");
|
||||||
|
return self.remote_fetch_params.max_retries;
|
||||||
|
},
|
||||||
|
[](Context& self, int mr)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.max_retries` instead.");
|
||||||
|
self.remote_fetch_params.max_retries = mr;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"retry_timeout",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.retry_timeout` instead.");
|
||||||
|
return self.remote_fetch_params.retry_timeout;
|
||||||
|
},
|
||||||
|
[](Context& self, int rt)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.retry_timeout` instead.");
|
||||||
|
self.remote_fetch_params.retry_timeout = rt;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"retry_backoff",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.retry_backoff` instead.");
|
||||||
|
return self.remote_fetch_params.retry_backoff;
|
||||||
|
},
|
||||||
|
[](Context& self, int rb)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.retry_backoff` instead.");
|
||||||
|
self.remote_fetch_params.retry_backoff = rb;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"user_agent",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.user_agent` instead.");
|
||||||
|
return self.remote_fetch_params.user_agent;
|
||||||
|
},
|
||||||
|
[](Context& self, std::string ua)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.user_agent` instead.");
|
||||||
|
self.remote_fetch_params.user_agent = ua;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"connect_timeout_secs",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.connect_timeout_secs` instead.");
|
||||||
|
return self.remote_fetch_params.connect_timeout_secs;
|
||||||
|
},
|
||||||
|
[](Context& self, int cts)
|
||||||
|
{
|
||||||
|
deprecated("Use `remote_fetch_params.connect_timeout_secs` instead.");
|
||||||
|
self.remote_fetch_params.connect_timeout_secs = cts;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// OutputParams
|
||||||
|
ctx.def_property(
|
||||||
|
"verbosity",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `output_params.verbosity` instead.");
|
||||||
|
return self.output_params.verbosity;
|
||||||
|
},
|
||||||
|
[](Context& self, int v)
|
||||||
|
{
|
||||||
|
deprecated("Use `output_params.verbosity` instead.");
|
||||||
|
self.output_params.verbosity = v;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"json",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `output_params.json` instead.");
|
||||||
|
return self.output_params.json;
|
||||||
|
},
|
||||||
|
[](Context& self, bool j)
|
||||||
|
{
|
||||||
|
deprecated("Use `output_params.json` instead.");
|
||||||
|
self.output_params.json = j;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"quiet",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `output_params.quiet` instead.");
|
||||||
|
return self.output_params.quiet;
|
||||||
|
},
|
||||||
|
[](Context& self, bool q)
|
||||||
|
{
|
||||||
|
deprecated("Use `output_params.quiet` instead.");
|
||||||
|
self.output_params.quiet = q;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// ThreadsParams
|
||||||
|
ctx.def_property(
|
||||||
|
"download_threads",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `threads_params.download_threads` instead.");
|
||||||
|
return self.threads_params.download_threads;
|
||||||
|
},
|
||||||
|
[](Context& self, std::size_t dt)
|
||||||
|
{
|
||||||
|
deprecated("Use `threads_params.download_threads` instead.");
|
||||||
|
self.threads_params.download_threads = dt;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"extract_threads",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `threads_params.extract_threads` instead.");
|
||||||
|
return self.threads_params.extract_threads;
|
||||||
|
},
|
||||||
|
[](Context& self, int et)
|
||||||
|
{
|
||||||
|
deprecated("Use `threads_params.extract_threads` instead.");
|
||||||
|
self.threads_params.extract_threads = et;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
// PrefixParams
|
||||||
|
ctx.def_property(
|
||||||
|
"target_prefix",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `prefix_params.target_prefix` instead.");
|
||||||
|
return self.prefix_params.target_prefix;
|
||||||
|
},
|
||||||
|
[](Context& self, fs::u8path tp)
|
||||||
|
{
|
||||||
|
deprecated("Use `prefix_params.target_prefix` instead.");
|
||||||
|
self.prefix_params.target_prefix = tp;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"conda_prefix",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `prefix_params.conda_prefix` instead.");
|
||||||
|
return self.prefix_params.conda_prefix;
|
||||||
|
},
|
||||||
|
[](Context& self, fs::u8path cp)
|
||||||
|
{
|
||||||
|
deprecated("Use `prefix_params.conda_prefix` instead.");
|
||||||
|
self.prefix_params.conda_prefix = cp;
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.def_property(
|
||||||
|
"root_prefix",
|
||||||
|
[](const Context& self)
|
||||||
|
{
|
||||||
|
deprecated("Use `prefix_params.root_prefix` instead.");
|
||||||
|
return self.prefix_params.root_prefix;
|
||||||
|
},
|
||||||
|
[](Context& self, fs::u8path rp)
|
||||||
|
{
|
||||||
|
deprecated("Use `prefix_params.root_prefix` instead.");
|
||||||
|
self.prefix_params.root_prefix = rp;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
////////////////////////////////////////////
|
||||||
|
|
||||||
pyPrefixData
|
pyPrefixData
|
||||||
.def(py::init(
|
.def(py::init(
|
||||||
[](const fs::u8path& prefix_path) -> PrefixData
|
[](const fs::u8path& prefix_path) -> PrefixData
|
||||||
|
|
Loading…
Reference in New Issue