diff --git a/.github/workflows/unix_impl.yml b/.github/workflows/unix_impl.yml index f8de80afa..da529c222 100644 --- a/.github/workflows/unix_impl.yml +++ b/.github/workflows/unix_impl.yml @@ -112,6 +112,10 @@ jobs: python -m pytest libmambapy/tests/ \ ${{ runner.debug == 'true' && '-v --capture=tee-sys' || '--exitfirst' }} \ ${{ github.ref == 'refs/heads/main' && '--reruns 3' || '' }} + - name: Generate libmambapy stubs + run: stubgen -o generated/ -p libmambapy -p libmambapy.bindings + - name: Check committed libmambapy stubs against generated ones + run: python dev/compare_stubs.py generated/ libmambapy/src mamba_integration_tests_unix: name: mamba integration tests diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f81a7955..d8480961c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -34,6 +34,7 @@ repos: hooks: - id: ruff args: [--fix] + exclude_types: [pyi] - id: ruff-format - repo: https://github.com/asottile/blacken-docs rev: 1.19.1 diff --git a/compare_stubs.py b/compare_stubs.py deleted file mode 100644 index 472e10d17..000000000 --- a/compare_stubs.py +++ /dev/null @@ -1,42 +0,0 @@ -import ast -import sys -from itertools import zip_longest - - -# https://stackoverflow.com/a/66733795 -# original autho Seanny123, CC BY-SA 4.0 -def compare_ast(node1, node2) -> bool: - if type(node1) is not type(node2): - return False - - if isinstance(node1, ast.AST): - for k, v in vars(node1).items(): - if k in {"lineno", "end_lineno", "col_offset", "end_col_offset", "ctx"}: - continue - if not compare_ast(v, getattr(node2, k)): - return False - return True - - elif isinstance(node1, list) and isinstance(node2, list): - return all(compare_ast(n1, n2) for n1, n2 in zip_longest(node1, node2)) - else: - return node1 == node2 - - -if __name__ == "__main__": - print(sys.argv) - - f1, f2 = sys.argv[1:3] - - with open(f1) as fi: - a1 = ast.parse(fi.read()) - - with open(f2) as fi: - a2 = ast.parse(fi.read()) - - if not compare_ast(a1, a2): - print("Stubs are different! Please rerun pybind11-stubgen") - print("CI has these: \n\n") - with open(f2) as fi: - print(fi.read()) - sys.exit(1) diff --git a/dev/compare_stubs.py b/dev/compare_stubs.py new file mode 100644 index 000000000..b31ac577a --- /dev/null +++ b/dev/compare_stubs.py @@ -0,0 +1,112 @@ +import ast +import sys +import pathlib +import itertools +from collections.abc import Iterable + + +# https://stackoverflow.com/a/66733795 +# original autho Seanny123, CC BY-SA 4.0 +def compare_ast(node1, node2) -> bool: + if type(node1) is not type(node2): + return False + + if isinstance(node1, ast.AST): + for k, v in vars(node1).items(): + if k in {"lineno", "end_lineno", "col_offset", "end_col_offset", "ctx"}: + continue + if not compare_ast(v, getattr(node2, k)): + return False + return True + + elif isinstance(node1, list) and isinstance(node2, list): + return all(compare_ast(n1, n2) for n1, n2 in itertools.zip_longest(node1, node2)) + else: + return node1 == node2 + + +def compare_two_files(file1: pathlib.Path, file2: pathlib.Path) -> bool: + with open(file1) as f1: + a1 = ast.parse(f1.read()) + with open(file2) as f2: + a2 = ast.parse(f2.read()) + return compare_ast(a1, a2) + + +def common_suffix_len(a: str, b: str) -> int: + return len( + [x for x, y in itertools.takewhile(lambda p: p[0] == p[1], zip(reversed(a), reversed(b)))] + ) + + +StubFileCompare = tuple[pathlib.Path, pathlib.Path, bool] +StubFileMissing = pathlib.Path + + +def compare_files( + files1: Iterable[pathlib.Path], + files2: Iterable[pathlib.Path], +) -> list[StubFileCompare | StubFileMissing]: + matches: list[tuple[pathlib.Path, pathlib.Path]] = [] + mismatches: list[pathlib] = [] + + files2_remaining = set(files2) + files1 = sorted(files1, key=lambda p: len(str(p)), reverse=True) + for f1 in files1: + best = max( + files2_remaining, key=lambda f2: common_suffix_len(str(f1), str(f2)), default=None + ) + if best is not None: + matches.append((f1, best)) + files2_remaining.remove(best) + else: + mismatches.append(f1) + mismatches += files2 + return [(f1, f2, compare_two_files(f1, f2)) for f1, f2 in matches] + mismatches + + +def compare_directories( + dir1: pathlib.Path, + dir2: pathlib.Path, +) -> list[StubFileCompare | StubFileMissing]: + return compare_files( + dir1.glob("**/*.pyi"), + dir2.glob("**/*.pyi"), + ) + + +def compare_paths( + path1: pathlib.Path, + path2: pathlib.Path, +) -> list[StubFileCompare | StubFileMissing]: + if path1.is_dir() and path2.is_dir(): + return compare_directories(path1, path2) + elif not path1.is_dir() and not path2.is_dir(): + return [(path1, path2, compare_two_files(path1, path2))] + else: + raise ValueError("Path must be two directories or two files") + + +if __name__ == "__main__": + path1 = pathlib.Path(sys.argv[1]) + path2 = pathlib.Path(sys.argv[2]) + + comparison = compare_paths(path1, path2) + + ok = True + for c in comparison: + if isinstance(c, tuple): + p1, p2, same = c + print("{} {} -> {}".format("✅" if same else "❌", p1, p2)) + ok &= same + else: + print(f"❌ {c} -> ?") + ok = False + + if not ok: + print( + "\nStubs are out of date! Compile and install libmambapy, then run:" + "\n stubgen -o libmambapy/src/ -p libmambapy -p libmambapy.bindings" + ) + + sys.exit(0 if ok else 1) diff --git a/dev/environment-dev.yml b/dev/environment-dev.yml index 37c7e64ee..e3f7e3730 100644 --- a/dev/environment-dev.yml +++ b/dev/environment-dev.yml @@ -43,7 +43,7 @@ dependencies: - securesystemslib # libmambapy build dependencies - scikit-build - - pybind11-stubgen <1.0 + - mypy # For stubgen # libmambapy dependencies - python - pybind11 diff --git a/libmambapy/src/libmambapy/__init__.pyi b/libmambapy/src/libmambapy/__init__.pyi index 97202ad7a..9f723c6b3 100644 --- a/libmambapy/src/libmambapy/__init__.pyi +++ b/libmambapy/src/libmambapy/__init__.pyi @@ -1,1802 +1,4 @@ -from __future__ import annotations -import libmambapy.core.bindings -import typing +from libmambapy.bindings.legacy import * +from _typeshed import Incomplete -__all__ = [ - "Channel", - "ChannelPriority", - "CompressedProblemsGraph", - "ContextOptions", - "Context", - "ExtraPkgInfo", - "History", - "Key", - "KeyMgr", - "LockFile", - "LogLevel", - "MAMBA_CLEAN_ALL", - "MAMBA_CLEAN_INDEX", - "MAMBA_CLEAN_LOCKS", - "MAMBA_CLEAN_PKGS", - "MAMBA_CLEAN_TARBALLS", - "MAMBA_FORCE_REINSTALL", - "MAMBA_NO_DEPS", - "MAMBA_ONLY_DEPS", - "MambaNativeException", - "MatchSpec", - "MultiPackageCache", - "PackageInfo", - "Path", - "PkgMgr", - "Pool", - "PrefixData", - "ProblemsGraph", - "Query", - "QueryFormat", - "Repo", - "RoleBase", - "RoleBaseExtension", - "RoleFullKeys", - "RootImpl", - "RootRole", - "SOLVER_ALLOWUNINSTALL", - "SOLVER_CLEANDEPS", - "SOLVER_DISFAVOR", - "SOLVER_DISTUPGRADE", - "SOLVER_DROP_ORPHANED", - "SOLVER_ERASE", - "SOLVER_ESSENTIAL", - "SOLVER_FAVOR", - "SOLVER_FLAG_ADD_ALREADY_RECOMMENDED", - "SOLVER_FLAG_ALLOW_ARCHCHANGE", - "SOLVER_FLAG_ALLOW_DOWNGRADE", - "SOLVER_FLAG_ALLOW_NAMECHANGE", - "SOLVER_FLAG_ALLOW_UNINSTALL", - "SOLVER_FLAG_ALLOW_VENDORCHANGE", - "SOLVER_FLAG_BEST_OBEY_POLICY", - "SOLVER_FLAG_BREAK_ORPHANS", - "SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE", - "SOLVER_FLAG_DUP_ALLOW_DOWNGRADE", - "SOLVER_FLAG_DUP_ALLOW_NAMECHANGE", - "SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE", - "SOLVER_FLAG_FOCUS_BEST", - "SOLVER_FLAG_FOCUS_INSTALLED", - "SOLVER_FLAG_IGNORE_RECOMMENDED", - "SOLVER_FLAG_INSTALL_ALSO_UPDATES", - "SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES", - "SOLVER_FLAG_KEEP_ORPHANS", - "SOLVER_FLAG_NEED_UPDATEPROVIDE", - "SOLVER_FLAG_NO_AUTOTARGET", - "SOLVER_FLAG_NO_INFARCHCHECK", - "SOLVER_FLAG_NO_UPDATEPROVIDE", - "SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED", - "SOLVER_FLAG_SPLITPROVIDES", - "SOLVER_FLAG_STRICT_REPO_PRIORITY", - "SOLVER_FLAG_STRONG_RECOMMENDS", - "SOLVER_FLAG_URPM_REORDER", - "SOLVER_FLAG_YUM_OBSOLETES", - "SOLVER_FORCEBEST", - "SOLVER_INSTALL", - "SOLVER_JOBMASK", - "SOLVER_LOCK", - "SOLVER_MULTIVERSION", - "SOLVER_NOAUTOSET", - "SOLVER_NOOP", - "SOLVER_NOTBYUSER", - "SOLVER_ORUPDATE", - "SOLVER_SELECTMASK", - "SOLVER_SETARCH", - "SOLVER_SETEV", - "SOLVER_SETEVR", - "SOLVER_SETMASK", - "SOLVER_SETNAME", - "SOLVER_SETREPO", - "SOLVER_SETVENDOR", - "SOLVER_SOLVABLE", - "SOLVER_SOLVABLE_ALL", - "SOLVER_SOLVABLE_NAME", - "SOLVER_SOLVABLE_ONE_OF", - "SOLVER_SOLVABLE_PROVIDES", - "SOLVER_SOLVABLE_REPO", - "SOLVER_TARGETED", - "SOLVER_UPDATE", - "SOLVER_USERINSTALLED", - "SOLVER_VERIFY", - "SOLVER_WEAK", - "SOLVER_WEAKENDEPS", - "Solver", - "SolverProblem", - "SolverRuleinfo", - "SpecBase", - "SpecImpl", - "SubdirData", - "SubdirIndex", - "SubdirIndexEntry", - "TimeRef", - "Transaction", - "Version", - "cache_fn_url", - "cancel_json_output", - "clean", - "create_cache_dir", - "generate_ed25519_keypair", - "get_channels", - "get_virtual_packages", - "init_console", - "ostream_redirect", - "sign", - "simplify_conflicts", - "transmute", -] - -class Channel: - def __init__(self, arg0: str) -> None: ... - def __repr__(self) -> str: ... - def platform_url(self, platform: str, with_credentials: bool = True) -> str: ... - def platform_urls( - self, with_credentials: bool = True - ) -> typing.Set[typing.Tuple[str, str]]: ... - def urls(self, with_credentials: bool = True) -> typing.Set[str]: ... - @property - def canonical_name(self) -> str: - """ - :type: str - """ - @property - def location(self) -> str: - """ - :type: str - """ - @property - def name(self) -> str: - """ - :type: str - """ - @property - def platforms(self) -> typing.Set[str]: - """ - :type: typing.Set[str] - """ - pass - -class ChannelPriority: - """ - Members: - - Flexible - - Strict - - Disabled - """ - - def __eq__(self, other: object) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: object) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - @property - def name(self) -> str: - """ - :type: str - """ - @property - def value(self) -> int: - """ - :type: int - """ - Disabled: libmambapy.core.bindings.ChannelPriority # value = - Flexible: libmambapy.core.bindings.ChannelPriority # value = - Strict: libmambapy.core.bindings.ChannelPriority # value = - __members__: dict # value = {'Flexible': , 'Strict': , 'Disabled': } - pass - -class CompressedProblemsGraph: - class ConflictMap: - def __bool__(self) -> bool: ... - def __contains__(self, arg0: int) -> bool: ... - def __init__(self) -> None: ... - def __iter__(self) -> typing.Iterator: ... - def __len__(self) -> int: ... - def add(self, arg0: int, arg1: int) -> bool: ... - def clear(self) -> None: ... - def conflicts(self, arg0: int) -> typing.Set[int]: ... - def has_conflict(self, arg0: int) -> bool: ... - def in_conflict(self, arg0: int, arg1: int) -> bool: ... - pass - - class ConstraintListNode: - def __bool__(self) -> bool: ... - def __init__(self) -> None: ... - def __iter__(self) -> typing.Iterator: ... - def __len__(self) -> int: ... - def add(self, arg0: ProblemsGraph.ConstraintNode) -> None: ... - def build_strings_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - def clear(self) -> None: ... - def name(self) -> str: ... - def versions_and_build_strings_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - def versions_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - pass - - class DependencyList: - def __bool__(self) -> bool: ... - def __init__(self) -> None: ... - def __iter__(self) -> typing.Iterator: ... - def __len__(self) -> int: ... - def add(self, arg0: MatchSpec) -> None: ... - def build_strings_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - def clear(self) -> None: ... - def name(self) -> str: ... - def versions_and_build_strings_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - def versions_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - pass - - class PackageListNode: - def __bool__(self) -> bool: ... - def __init__(self) -> None: ... - def __iter__(self) -> typing.Iterator: ... - def __len__(self) -> int: ... - def add(self, arg0: ProblemsGraph.PackageNode) -> None: ... - def build_strings_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - def clear(self) -> None: ... - def name(self) -> str: ... - def versions_and_build_strings_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - def versions_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - pass - - class RootNode: - def __init__(self) -> None: ... - pass - - class UnresolvedDependencyListNode: - def __bool__(self) -> bool: ... - def __init__(self) -> None: ... - def __iter__(self) -> typing.Iterator: ... - def __len__(self) -> int: ... - def add(self, arg0: ProblemsGraph.UnresolvedDependencyNode) -> None: ... - def build_strings_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - def clear(self) -> None: ... - def name(self) -> str: ... - def versions_and_build_strings_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - def versions_trunc( - self, - sep: str = "|", - etc: str = "...", - threshold: int = 5, - remove_duplicates: bool = True, - ) -> typing.Tuple[str, int]: ... - pass - - def conflicts(self) -> ProblemsGraph.ConflictMap: ... - @staticmethod - @typing.overload - def from_problems_graph( - arg0: ProblemsGraph, arg1: typing.Callable[[ProblemsGraph, int, int], bool] - ) -> CompressedProblemsGraph: ... - @staticmethod - @typing.overload - def from_problems_graph(arg0: ProblemsGraph) -> CompressedProblemsGraph: ... - def graph( - self, - ) -> typing.Tuple[ - typing.Dict[ - int, - typing.Union[ - ProblemsGraph.RootNode, - CompressedProblemsGraph.PackageListNode, - CompressedProblemsGraph.UnresolvedDependencyListNode, - CompressedProblemsGraph.ConstraintListNode, - ], - ], - typing.Dict[typing.Tuple[int, int], CompressedProblemsGraph.DependencyList], - ]: ... - def root_node(self) -> int: ... - def tree_message(self) -> str: ... - pass - -class ContextOptions: - def __init__(self) -> None: ... - @property - def json(self) -> bool: - """ - :type: bool - """ - @json.setter - def json(self, arg0: bool) -> None: - pass - @property - def enable_logging_and_signal_handling(self) -> bool: - """ - :type: bool - """ - @enable_logging_and_signal_handling.setter - def enable_logging_and_signal_handling(self, arg0: bool) -> None: - pass - pass - -class Context: - class OutputParams: - def __init__(self) -> None: ... - @property - def json(self) -> bool: - """ - :type: bool - """ - @json.setter - def json(self, arg0: bool) -> None: - pass - @property - def quiet(self) -> bool: - """ - :type: bool - """ - @quiet.setter - def quiet(self, arg0: bool) -> None: - pass - @property - def verbosity(self) -> int: - """ - :type: int - """ - @verbosity.setter - def verbosity(self, arg0: int) -> None: - pass - pass - - class PrefixParams: - def __init__(self) -> None: ... - @property - def conda_prefix(self) -> Path: - """ - :type: Path - """ - @conda_prefix.setter - def conda_prefix(self, arg0: Path) -> None: - pass - @property - def root_prefix(self) -> Path: - """ - :type: Path - """ - @root_prefix.setter - def root_prefix(self, arg0: Path) -> None: - pass - @property - def target_prefix(self) -> Path: - """ - :type: Path - """ - @target_prefix.setter - def target_prefix(self, arg0: Path) -> None: - pass - pass - - class RemoteFetchParams: - def __init__(self) -> None: ... - @property - def connect_timeout_secs(self) -> float: - """ - :type: float - """ - @connect_timeout_secs.setter - def connect_timeout_secs(self, arg0: float) -> None: - pass - @property - def max_retries(self) -> int: - """ - :type: int - """ - @max_retries.setter - def max_retries(self, arg0: int) -> None: - pass - @property - def proxy_servers(self) -> typing.Dict[str, str]: - """ - :type: typing.Dict[str, str] - """ - @proxy_servers.setter - def proxy_servers(self, arg0: typing.Dict[str, str]) -> None: - pass - @property - def retry_backoff(self) -> int: - """ - :type: int - """ - @retry_backoff.setter - def retry_backoff(self, arg0: int) -> None: - pass - @property - def retry_timeout(self) -> int: - """ - :type: int - """ - @retry_timeout.setter - def retry_timeout(self, arg0: int) -> None: - pass - @property - def ssl_verify(self) -> str: - """ - :type: str - """ - @ssl_verify.setter - def ssl_verify(self, arg0: str) -> None: - pass - @property - def user_agent(self) -> str: - """ - :type: str - """ - @user_agent.setter - def user_agent(self, arg0: str) -> None: - pass - pass - - class ThreadsParams: - def __init__(self) -> None: ... - @property - def download_threads(self) -> int: - """ - :type: int - """ - @download_threads.setter - def download_threads(self, arg0: int) -> None: - pass - @property - def extract_threads(self) -> int: - """ - :type: int - """ - @extract_threads.setter - def extract_threads(self, arg0: int) -> None: - pass - pass - - def __init__(self, options: ContextOptions = ContextOptions()) -> None: ... - def set_log_level(self, arg0: LogLevel) -> None: ... - def set_verbosity(self, arg0: int) -> None: ... - @property - def add_pip_as_python_dependency(self) -> bool: - """ - :type: bool - """ - @add_pip_as_python_dependency.setter - def add_pip_as_python_dependency(self, arg0: bool) -> None: - pass - @property - def always_yes(self) -> bool: - """ - :type: bool - """ - @always_yes.setter - def always_yes(self, arg0: bool) -> None: - pass - @property - def channel_alias(self) -> str: - """ - :type: str - """ - @channel_alias.setter - def channel_alias(self, arg0: str) -> None: - pass - @property - def channel_priority(self) -> ChannelPriority: - """ - :type: ChannelPriority - """ - @channel_priority.setter - def channel_priority(self, arg0: ChannelPriority) -> None: - pass - @property - def channels(self) -> typing.List[str]: - """ - :type: typing.List[str] - """ - @channels.setter - def channels(self, arg0: typing.List[str]) -> None: - pass - @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) -> float: - """ - :type: float - """ - @connect_timeout_secs.setter - def connect_timeout_secs(self, arg1: float) -> None: - pass - @property - def custom_channels(self) -> typing.Dict[str, str]: - """ - :type: typing.Dict[str, str] - """ - @custom_channels.setter - def custom_channels(self, arg0: typing.Dict[str, str]) -> None: - pass - @property - def custom_multichannels(self) -> typing.Dict[str, typing.List[str]]: - """ - :type: typing.Dict[str, typing.List[str]] - """ - @custom_multichannels.setter - def custom_multichannels(self, arg0: typing.Dict[str, typing.List[str]]) -> None: - pass - @property - def default_channels(self) -> typing.List[str]: - """ - :type: typing.List[str] - """ - @default_channels.setter - def default_channels(self, arg0: typing.List[str]) -> None: - pass - @property - def download_only(self) -> bool: - """ - :type: bool - """ - @download_only.setter - def download_only(self, arg0: bool) -> None: - pass - @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: - """ - :type: bool - """ - @dry_run.setter - def dry_run(self, arg0: bool) -> None: - pass - @property - def envs_dirs(self) -> typing.List[Path]: - """ - :type: typing.List[Path] - """ - @envs_dirs.setter - def envs_dirs(self, arg0: typing.List[Path]) -> None: - pass - @property - def experimental_sat_error_message(self) -> bool: - """ - :type: bool - """ - @experimental_sat_error_message.setter - def experimental_sat_error_message(self, arg1: bool) -> None: - pass - @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: - """ - :type: int - """ - @local_repodata_ttl.setter - def local_repodata_ttl(self, arg0: int) -> None: - pass - @property - def max_retries(self) -> int: - """ - :type: int - """ - @max_retries.setter - def max_retries(self, arg1: int) -> None: - pass - @property - def offline(self) -> bool: - """ - :type: bool - """ - @offline.setter - def offline(self, arg0: bool) -> None: - pass - @property - def output_params(self) -> Context.OutputParams: - """ - :type: Context.OutputParams - """ - @output_params.setter - def output_params(self, arg0: Context.OutputParams) -> None: - pass - @property - def pkgs_dirs(self) -> typing.List[Path]: - """ - :type: typing.List[Path] - """ - @pkgs_dirs.setter - def pkgs_dirs(self, arg0: typing.List[Path]) -> None: - pass - @property - def platform(self) -> str: - """ - :type: str - """ - @platform.setter - def platform(self, arg0: str) -> None: - pass - @property - def prefix_params(self) -> Context.PrefixParams: - """ - :type: Context.PrefixParams - """ - @prefix_params.setter - def prefix_params(self, arg0: Context.PrefixParams) -> None: - pass - @property - def proxy_servers(self) -> typing.Dict[str, str]: - """ - :type: typing.Dict[str, str] - """ - @proxy_servers.setter - def proxy_servers(self, arg1: typing.Dict[str, str]) -> None: - pass - @property - def quiet(self) -> bool: - """ - :type: bool - """ - @quiet.setter - def quiet(self, arg1: bool) -> None: - pass - @property - def remote_fetch_params(self) -> Context.RemoteFetchParams: - """ - :type: Context.RemoteFetchParams - """ - @remote_fetch_params.setter - def remote_fetch_params(self, arg0: Context.RemoteFetchParams) -> None: - pass - @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: - """ - :type: Context.ThreadsParams - """ - @threads_params.setter - def threads_params(self, arg0: Context.ThreadsParams) -> None: - pass - @property - def use_index_cache(self) -> bool: - """ - :type: bool - """ - @use_index_cache.setter - def use_index_cache(self, arg0: bool) -> None: - pass - @property - def use_lockfiles(self) -> bool: - """ - :type: bool - """ - @use_lockfiles.setter - def use_lockfiles(self, arg1: bool) -> None: - pass - @property - def use_only_tar_bz2(self) -> bool: - """ - :type: bool - """ - @use_only_tar_bz2.setter - def use_only_tar_bz2(self, arg0: bool) -> None: - 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 - -class ExtraPkgInfo: - def __init__(self) -> None: ... - @property - def noarch(self) -> str: - """ - :type: str - """ - @noarch.setter - def noarch(self, arg0: str) -> None: - pass - @property - def repo_url(self) -> str: - """ - :type: str - """ - @repo_url.setter - def repo_url(self, arg0: str) -> None: - pass - pass - -class History: - def __init__(self, arg0: Path) -> None: ... - def get_requested_specs_map(self) -> typing.Dict[str, MatchSpec]: ... - pass - -class Key: - @staticmethod - def from_ed25519(arg0: str) -> Key: ... - @property - def json_str(self) -> str: - """ - :type: str - """ - @property - def keytype(self) -> str: - """ - :type: str - """ - @keytype.setter - def keytype(self, arg0: str) -> None: - pass - @property - def keyval(self) -> str: - """ - :type: str - """ - @keyval.setter - def keyval(self, arg0: str) -> None: - pass - @property - def scheme(self) -> str: - """ - :type: str - """ - @scheme.setter - def scheme(self, arg0: str) -> None: - pass - pass - -class RoleBase: - def all_keys(self) -> typing.Dict[str, RoleFullKeys]: ... - @property - def expired(self) -> bool: - """ - :type: bool - """ - @property - def expires(self) -> str: - """ - :type: str - """ - @property - def file_ext(self) -> str: - """ - :type: str - """ - @property - def spec_version(self) -> SpecBase: - """ - :type: SpecBase - """ - @property - def type(self) -> str: - """ - :type: str - """ - @property - def version(self) -> int: - """ - :type: int - """ - pass - -class LockFile: - def __init__(self, arg0: Path) -> None: ... - pass - -class LogLevel: - """ - Members: - - TRACE - - DEBUG - - INFO - - WARNING - - ERROR - - CRITICAL - - OFF - """ - - def __eq__(self, other: object) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: object) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - @property - def name(self) -> str: - """ - :type: str - """ - @property - def value(self) -> int: - """ - :type: int - """ - CRITICAL: libmambapy.core.bindings.LogLevel # value = - DEBUG: libmambapy.core.bindings.LogLevel # value = - ERROR: libmambapy.core.bindings.LogLevel # value = - INFO: libmambapy.core.bindings.LogLevel # value = - OFF: libmambapy.core.bindings.LogLevel # value = - TRACE: libmambapy.core.bindings.LogLevel # value = - WARNING: libmambapy.core.bindings.LogLevel # value = - __members__: dict # value = {'TRACE': , 'DEBUG': , 'INFO': , 'WARNING': , 'ERROR': , 'CRITICAL': , 'OFF': } - pass - -class MambaNativeException(Exception, BaseException): - pass - -class MatchSpec: - @typing.overload - def __init__(self) -> None: ... - @typing.overload - def __init__(self, arg0: str) -> None: ... - def conda_build_form(self) -> str: ... - pass - -class MultiPackageCache: - def __init__(self, context: Context, arg0: typing.List[Path]) -> None: ... - def get_tarball_path(self, arg0: PackageInfo, arg1: bool) -> Path: ... - @property - def first_writable_path(self) -> Path: - """ - :type: Path - """ - pass - -class PackageInfo: - @typing.overload - def __init__(self, name: str) -> None: ... - @typing.overload - def __init__(self, name: str, version: str, build_string: str, build_number: int) -> None: ... - @property - def build_number(self) -> int: - """ - :type: int - """ - @build_number.setter - def build_number(self, arg0: int) -> None: - pass - @property - def build_string(self) -> str: - """ - :type: str - """ - @build_string.setter - def build_string(self, arg0: str) -> None: - pass - @property - def channel(self) -> str: - """ - :type: str - """ - @channel.setter - def channel(self, arg0: str) -> None: - pass - @property - def constrains(self) -> typing.List[str]: - """ - :type: typing.List[str] - """ - @constrains.setter - def constrains(self, arg0: typing.List[str]) -> None: - pass - @property - def defaulted_keys(self) -> typing.Set[str]: - """ - :type: typing.Set[str] - """ - @defaulted_keys.setter - def defaulted_keys(self, arg0: typing.Set[str]) -> None: - pass - @property - def depends(self) -> typing.List[str]: - """ - :type: typing.List[str] - """ - @depends.setter - def depends(self, arg0: typing.List[str]) -> None: - pass - @property - def fn(self) -> str: - """ - :type: str - """ - @fn.setter - def fn(self, arg0: str) -> None: - pass - @property - def license(self) -> str: - """ - :type: str - """ - @license.setter - def license(self, arg0: str) -> None: - pass - @property - def md5(self) -> str: - """ - :type: str - """ - @md5.setter - def md5(self, arg0: str) -> None: - pass - @property - def name(self) -> str: - """ - :type: str - """ - @name.setter - def name(self, arg0: str) -> None: - pass - @property - def noarch(self) -> str: - """ - :type: str - """ - @noarch.setter - def noarch(self, arg0: str) -> None: - pass - @property - def sha256(self) -> str: - """ - :type: str - """ - @sha256.setter - def sha256(self, arg0: str) -> None: - pass - @property - def signatures(self) -> str: - """ - :type: str - """ - @signatures.setter - def signatures(self, arg0: str) -> None: - pass - @property - def size(self) -> int: - """ - :type: int - """ - @size.setter - def size(self, arg0: int) -> None: - pass - @property - def subdir(self) -> str: - """ - :type: str - """ - @subdir.setter - def subdir(self, arg0: str) -> None: - pass - @property - def timestamp(self) -> int: - """ - :type: int - """ - @timestamp.setter - def timestamp(self, arg0: int) -> None: - pass - @property - def track_features(self) -> str: - """ - :type: str - """ - @track_features.setter - def track_features(self, arg1: str) -> None: - pass - @property - def url(self) -> str: - """ - :type: str - """ - @url.setter - def url(self, arg0: str) -> None: - pass - @property - def version(self) -> str: - """ - :type: str - """ - @version.setter - def version(self, arg0: str) -> None: - pass - pass - -class Path: - def __init__(self, arg0: str) -> None: ... - def __repr__(self) -> str: ... - def __str__(self) -> str: ... - pass - -class RoleBaseExtension: - @property - def timestamp(self) -> str: - """ - :type: str - """ - pass - -class Pool: - def __init__(self) -> None: ... - def create_whatprovides(self) -> None: ... - def id2pkginfo(self, id: int) -> typing.Optional[PackageInfo]: ... - @typing.overload - def matchspec2id(self, ms: MatchSpec) -> int: ... - @typing.overload - def matchspec2id(self, ms: str) -> int: ... - def select_solvables(self, id: int, sorted: bool = False) -> typing.List[int]: ... - def set_debuglevel(self) -> None: ... - pass - -class PrefixData: - def __init__(self, arg0: Path) -> None: ... - def add_packages(self, arg0: typing.List[PackageInfo]) -> None: ... - @property - def package_records(self) -> typing.Dict[str, PackageInfo]: - """ - :type: typing.Dict[str, PackageInfo] - """ - pass - -class ProblemsGraph: - class ConflictMap: - pass - - class ConstraintNode(MatchSpec): - pass - - class PackageNode(PackageInfo): - pass - - class RootNode: - pass - - class UnresolvedDependencyNode(MatchSpec): - pass - - def conflicts(self) -> ProblemsGraph.ConflictMap: ... - @staticmethod - def from_solver(arg0: Solver, arg1: Pool) -> ProblemsGraph: ... - def graph( - self, - ) -> typing.Tuple[ - typing.Dict[ - int, - typing.Union[ - ProblemsGraph.RootNode, - ProblemsGraph.PackageNode, - ProblemsGraph.UnresolvedDependencyNode, - ProblemsGraph.ConstraintNode, - ], - ], - typing.Dict[typing.Tuple[int, int], MatchSpec], - ]: ... - def root_node(self) -> int: ... - pass - -class Query: - def __init__(self, arg0: Pool) -> None: ... - def depends(self, arg0: str, arg1: QueryFormat) -> str: ... - @typing.overload - def find(self, arg0: str, arg1: QueryFormat) -> str: ... - @typing.overload - def find(self, arg0: typing.List[str], arg1: QueryFormat) -> str: ... - def whoneeds(self, arg0: str, arg1: QueryFormat) -> str: ... - pass - -class QueryFormat: - """ - Members: - - JSON - - TREE - - TABLE - - PRETTY - - RECURSIVETABLE - """ - - def __eq__(self, other: object) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: object) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - @property - def name(self) -> str: - """ - :type: str - """ - @property - def value(self) -> int: - """ - :type: int - """ - JSON: libmambapy.core.bindings.QueryFormat # value = - PRETTY: libmambapy.core.bindings.QueryFormat # value = - RECURSIVETABLE: libmambapy.core.bindings.QueryFormat # value = - TABLE: libmambapy.core.bindings.QueryFormat # value = - TREE: libmambapy.core.bindings.QueryFormat # value = - __members__: dict # value = {'JSON': , 'TREE': , 'TABLE': , 'PRETTY': , 'RECURSIVETABLE': } - pass - -class Repo: - @typing.overload - def __init__(self, arg0: Pool, arg1: str, arg2: str, arg3: str) -> None: ... - @typing.overload - def __init__(self, arg0: Pool, arg1: PrefixData) -> None: ... - def add_extra_pkg_info(self, arg0: typing.Dict[str, ExtraPkgInfo]) -> None: ... - def clear(self, arg0: bool) -> bool: ... - def name(self) -> str: ... - def priority(self) -> typing.Tuple[int, int]: ... - def set_installed(self) -> None: ... - def set_priority(self, arg0: int, arg1: int) -> None: ... - def size(self) -> int: ... - pass - -class KeyMgr(RoleBase, RoleBaseExtension): - def __init__(self, arg0: str, arg1: RoleFullKeys, arg2: SpecBase) -> None: ... - pass - -class PkgMgr(RoleBase, RoleBaseExtension): - def __init__(self, arg0: str, arg1: RoleFullKeys, arg2: SpecBase) -> None: ... - pass - -class RoleFullKeys: - @typing.overload - def __init__(self) -> None: ... - @typing.overload - def __init__(self, keys: typing.Dict[str, Key], threshold: int) -> None: ... - @property - def keys(self) -> typing.Dict[str, Key]: - """ - :type: typing.Dict[str, Key] - """ - @keys.setter - def keys(self, arg0: typing.Dict[str, Key]) -> None: - pass - @property - def threshold(self) -> int: - """ - :type: int - """ - @threshold.setter - def threshold(self, arg0: int) -> None: - pass - pass - -class RootImpl(RoleBase, RoleBaseExtension): - def __init__(self, json_str: str) -> None: ... - def create_key_mgr(self, json_str: str) -> KeyMgr: ... - def update(self, json_str: str) -> RootRole: ... - pass - -class RootRole: - pass - -class Solver: - def __init__(self, arg0: Pool, arg1: typing.List[typing.Tuple[int, int]]) -> None: ... - def add_constraint(self, arg0: str) -> None: ... - def add_global_job(self, arg0: int) -> None: ... - def add_jobs(self, arg0: typing.List[str], arg1: int) -> None: ... - def add_pin(self, arg0: str) -> None: ... - def all_problems_structured(self) -> typing.List[SolverProblem]: ... - def all_problems_to_str(self) -> str: ... - def explain_problems(self) -> str: ... - def is_solved(self) -> bool: ... - def must_solve(self) -> None: ... - def problems_to_str(self) -> str: ... - def set_flags(self, arg0: typing.List[typing.Tuple[int, int]]) -> None: ... - def set_postsolve_flags(self, arg0: typing.List[typing.Tuple[int, int]]) -> None: ... - def solve(self) -> bool: ... - def try_solve(self) -> bool: ... - pass - -class SolverProblem: - def __str__(self) -> str: ... - @property - def dep(self) -> typing.Optional[str]: - """ - :type: typing.Optional[str] - """ - @dep.setter - def dep(self, arg0: typing.Optional[str]) -> None: - pass - @property - def dep_id(self) -> int: - """ - :type: int - """ - @dep_id.setter - def dep_id(self, arg0: int) -> None: - pass - @property - def description(self) -> str: - """ - :type: str - """ - @description.setter - def description(self, arg0: str) -> None: - pass - @property - def source(self) -> typing.Optional[PackageInfo]: - """ - :type: typing.Optional[PackageInfo] - """ - @source.setter - def source(self, arg0: typing.Optional[PackageInfo]) -> None: - pass - @property - def source_id(self) -> int: - """ - :type: int - """ - @source_id.setter - def source_id(self, arg0: int) -> None: - pass - @property - def target(self) -> typing.Optional[PackageInfo]: - """ - :type: typing.Optional[PackageInfo] - """ - @target.setter - def target(self, arg0: typing.Optional[PackageInfo]) -> None: - pass - @property - def target_id(self) -> int: - """ - :type: int - """ - @target_id.setter - def target_id(self, arg0: int) -> None: - pass - @property - def type(self) -> SolverRuleinfo: - """ - :type: SolverRuleinfo - """ - @type.setter - def type(self, arg0: SolverRuleinfo) -> None: - pass - pass - -class SolverRuleinfo: - """ - Members: - - SOLVER_RULE_UNKNOWN - - SOLVER_RULE_PKG - - SOLVER_RULE_PKG_NOT_INSTALLABLE - - SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP - - SOLVER_RULE_PKG_REQUIRES - - SOLVER_RULE_PKG_SELF_CONFLICT - - SOLVER_RULE_PKG_CONFLICTS - - SOLVER_RULE_PKG_SAME_NAME - - SOLVER_RULE_PKG_OBSOLETES - - SOLVER_RULE_PKG_IMPLICIT_OBSOLETES - - SOLVER_RULE_PKG_INSTALLED_OBSOLETES - - SOLVER_RULE_PKG_RECOMMENDS - - SOLVER_RULE_PKG_CONSTRAINS - - SOLVER_RULE_UPDATE - - SOLVER_RULE_FEATURE - - SOLVER_RULE_JOB - - SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP - - SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM - - SOLVER_RULE_JOB_UNKNOWN_PACKAGE - - SOLVER_RULE_JOB_UNSUPPORTED - - SOLVER_RULE_DISTUPGRADE - - SOLVER_RULE_INFARCH - - SOLVER_RULE_CHOICE - - SOLVER_RULE_LEARNT - - SOLVER_RULE_BEST - - SOLVER_RULE_YUMOBS - - SOLVER_RULE_RECOMMENDS - - SOLVER_RULE_BLACK - - SOLVER_RULE_STRICT_REPO_PRIORITY - """ - - def __eq__(self, other: object) -> bool: ... - def __getstate__(self) -> int: ... - def __hash__(self) -> int: ... - def __index__(self) -> int: ... - def __init__(self, value: int) -> None: ... - def __int__(self) -> int: ... - def __ne__(self, other: object) -> bool: ... - def __repr__(self) -> str: ... - def __setstate__(self, state: int) -> None: ... - @property - def name(self) -> str: - """ - :type: str - """ - @property - def value(self) -> int: - """ - :type: int - """ - SOLVER_RULE_BEST: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_BLACK: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_CHOICE: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_DISTUPGRADE: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_FEATURE: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_INFARCH: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_JOB: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_JOB_UNKNOWN_PACKAGE: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_JOB_UNSUPPORTED: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_LEARNT: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_CONFLICTS: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_CONSTRAINS: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_INSTALLED_OBSOLETES: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_NOT_INSTALLABLE: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_OBSOLETES: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_RECOMMENDS: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_REQUIRES: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_SAME_NAME: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_PKG_SELF_CONFLICT: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_RECOMMENDS: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_STRICT_REPO_PRIORITY: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_UNKNOWN: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_UPDATE: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - SOLVER_RULE_YUMOBS: ( - libmambapy.core.bindings.SolverRuleinfo - ) # value = - __members__: dict # value = {'SOLVER_RULE_UNKNOWN': , 'SOLVER_RULE_PKG': , 'SOLVER_RULE_PKG_NOT_INSTALLABLE': , 'SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP': , 'SOLVER_RULE_PKG_REQUIRES': , 'SOLVER_RULE_PKG_SELF_CONFLICT': , 'SOLVER_RULE_PKG_CONFLICTS': , 'SOLVER_RULE_PKG_SAME_NAME': , 'SOLVER_RULE_PKG_OBSOLETES': , 'SOLVER_RULE_PKG_IMPLICIT_OBSOLETES': , 'SOLVER_RULE_PKG_INSTALLED_OBSOLETES': , 'SOLVER_RULE_PKG_RECOMMENDS': , 'SOLVER_RULE_PKG_CONSTRAINS': , 'SOLVER_RULE_UPDATE': , 'SOLVER_RULE_FEATURE': , 'SOLVER_RULE_JOB': , 'SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP': , 'SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM': , 'SOLVER_RULE_JOB_UNKNOWN_PACKAGE': , 'SOLVER_RULE_JOB_UNSUPPORTED': , 'SOLVER_RULE_DISTUPGRADE': , 'SOLVER_RULE_INFARCH': , 'SOLVER_RULE_CHOICE': , 'SOLVER_RULE_LEARNT': , 'SOLVER_RULE_BEST': , 'SOLVER_RULE_YUMOBS': , 'SOLVER_RULE_RECOMMENDS': , 'SOLVER_RULE_BLACK': , 'SOLVER_RULE_STRICT_REPO_PRIORITY': } - pass - -class SpecBase: - pass - -class SpecImpl(SpecBase): - def __init__(self) -> None: ... - pass - -class SubdirData: - def cache_path(self) -> str: ... - def create_repo(self, context: Context, arg0: Pool) -> Repo: ... - def loaded(self) -> bool: ... - pass - -class SubdirIndex: - def __getitem__(self, arg0: int) -> SubdirIndexEntry: ... - def __init__(self) -> None: ... - def __iter__(self) -> typing.Iterator: ... - def __len__(self) -> int: ... - def create( - self, - context: Context, - arg0: Channel, - arg1: str, - arg2: str, - arg3: MultiPackageCache, - arg4: str, - arg5: str, - ) -> None: ... - def download(self, context: Context) -> bool: ... - pass - -class SubdirIndexEntry: - def __init__(self) -> None: ... - @property - def channel(self) -> Channel: - """ - :type: Channel - """ - @property - def platform(self) -> str: - """ - :type: str - """ - @property - def subdir(self) -> SubdirData: - """ - :type: SubdirData - """ - @property - def url(self) -> str: - """ - :type: str - """ - pass - -class TimeRef: - @typing.overload - def __init__(self) -> None: ... - @typing.overload - def __init__(self, arg0: int) -> None: ... - def set(self, arg0: int) -> None: ... - def set_now(self) -> None: ... - def timestamp(self) -> str: ... - pass - -class Transaction: - @typing.overload - def __init__(self, arg0: Solver, arg1: MultiPackageCache) -> None: ... - @typing.overload - def __init__(self, arg0: Pool, arg1: Solver, arg2: MultiPackageCache) -> None: ... - def execute(self, arg0: PrefixData) -> bool: ... - def fetch_extract_packages(self) -> bool: ... - def find_python_version(self) -> typing.Tuple[str, str]: ... - def log_json(self) -> None: ... - def print(self) -> None: ... - def prompt(self) -> bool: ... - def to_conda( - self, - ) -> typing.Tuple[ - typing.Tuple[typing.List[str], typing.List[str]], - typing.List[typing.Tuple[str, str, str]], - typing.List[typing.Tuple[str, str]], - ]: ... - pass - -class Version: - def __str__(self) -> str: ... - @staticmethod - def parse(arg0: str) -> Version: ... - pass - -class ostream_redirect: - def __enter__(self) -> None: ... - def __exit__(self, *args) -> None: ... - def __init__(self, stdout: bool = True, stderr: bool = True) -> None: ... - pass - -def cache_fn_url(arg0: str) -> str: - pass - -def cancel_json_output(context: Context) -> None: - pass - -def clean(context: Context, arg0: int) -> None: - pass - -def create_cache_dir(arg0: Path) -> str: - pass - -def generate_ed25519_keypair() -> typing.Tuple[str, str]: - pass - -def get_channels(arg0: typing.List[str]) -> typing.List[Channel]: - pass - -def get_virtual_packages(context: Context) -> typing.List[PackageInfo]: - pass - -def init_console() -> None: - pass - -def sign(data: str, secret_key: str) -> str: - pass - -def simplify_conflicts(arg0: ProblemsGraph) -> ProblemsGraph: - pass - -def transmute( - context: Context, - source_package: Path, - destination_package: Path, - compression_level: int, - compression_threads: int = 1, -) -> bool: - pass - -MAMBA_CLEAN_ALL = 1 -MAMBA_CLEAN_INDEX = 2 -MAMBA_CLEAN_LOCKS = 16 -MAMBA_CLEAN_PKGS = 4 -MAMBA_CLEAN_TARBALLS = 8 -MAMBA_FORCE_REINSTALL = 4 -MAMBA_NO_DEPS = 1 -MAMBA_ONLY_DEPS = 2 -SOLVER_ALLOWUNINSTALL = 2816 -SOLVER_CLEANDEPS = 262144 -SOLVER_DISFAVOR = 3328 -SOLVER_DISTUPGRADE = 1792 -SOLVER_DROP_ORPHANED = 2304 -SOLVER_ERASE = 512 -SOLVER_ESSENTIAL = 131072 -SOLVER_FAVOR = 3072 -SOLVER_FLAG_ADD_ALREADY_RECOMMENDED = 8 -SOLVER_FLAG_ALLOW_ARCHCHANGE = 2 -SOLVER_FLAG_ALLOW_DOWNGRADE = 1 -SOLVER_FLAG_ALLOW_NAMECHANGE = 10 -SOLVER_FLAG_ALLOW_UNINSTALL = 4 -SOLVER_FLAG_ALLOW_VENDORCHANGE = 3 -SOLVER_FLAG_BEST_OBEY_POLICY = 12 -SOLVER_FLAG_BREAK_ORPHANS = 19 -SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE = 15 -SOLVER_FLAG_DUP_ALLOW_DOWNGRADE = 14 -SOLVER_FLAG_DUP_ALLOW_NAMECHANGE = 17 -SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE = 16 -SOLVER_FLAG_FOCUS_BEST = 24 -SOLVER_FLAG_FOCUS_INSTALLED = 20 -SOLVER_FLAG_IGNORE_RECOMMENDED = 7 -SOLVER_FLAG_INSTALL_ALSO_UPDATES = 26 -SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES = 11 -SOLVER_FLAG_KEEP_ORPHANS = 18 -SOLVER_FLAG_NEED_UPDATEPROVIDE = 22 -SOLVER_FLAG_NO_AUTOTARGET = 13 -SOLVER_FLAG_NO_INFARCHCHECK = 9 -SOLVER_FLAG_NO_UPDATEPROVIDE = 5 -SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED = 27 -SOLVER_FLAG_SPLITPROVIDES = 6 -SOLVER_FLAG_STRICT_REPO_PRIORITY = 28 -SOLVER_FLAG_STRONG_RECOMMENDS = 25 -SOLVER_FLAG_URPM_REORDER = 23 -SOLVER_FLAG_YUM_OBSOLETES = 21 -SOLVER_FORCEBEST = 1048576 -SOLVER_INSTALL = 256 -SOLVER_JOBMASK = 65280 -SOLVER_LOCK = 1536 -SOLVER_MULTIVERSION = 1280 -SOLVER_NOAUTOSET = 536870912 -SOLVER_NOOP = 0 -SOLVER_NOTBYUSER = 4194304 -SOLVER_ORUPDATE = 524288 -SOLVER_SELECTMASK = 255 -SOLVER_SETARCH = 67108864 -SOLVER_SETEV = 16777216 -SOLVER_SETEVR = 33554432 -SOLVER_SETMASK = 2130706432 -SOLVER_SETNAME = 1073741824 -SOLVER_SETREPO = 268435456 -SOLVER_SETVENDOR = 134217728 -SOLVER_SOLVABLE = 1 -SOLVER_SOLVABLE_ALL = 6 -SOLVER_SOLVABLE_NAME = 2 -SOLVER_SOLVABLE_ONE_OF = 4 -SOLVER_SOLVABLE_PROVIDES = 3 -SOLVER_SOLVABLE_REPO = 5 -SOLVER_TARGETED = 2097152 -SOLVER_UPDATE = 768 -SOLVER_USERINSTALLED = 2560 -SOLVER_VERIFY = 2048 -SOLVER_WEAK = 65536 -SOLVER_WEAKENDEPS = 1024 +__version__: Incomplete diff --git a/libmambapy/src/libmambapy/bindings/__init__.pyi b/libmambapy/src/libmambapy/bindings/__init__.pyi new file mode 100644 index 000000000..cbc8d9837 --- /dev/null +++ b/libmambapy/src/libmambapy/bindings/__init__.pyi @@ -0,0 +1 @@ +from . import legacy as legacy, solver as solver, specs as specs, utils as utils diff --git a/libmambapy/src/libmambapy/bindings/expected_caster.hpp b/libmambapy/src/libmambapy/bindings/expected_caster.hpp index 6a23c427a..b8c941c48 100644 --- a/libmambapy/src/libmambapy/bindings/expected_caster.hpp +++ b/libmambapy/src/libmambapy/bindings/expected_caster.hpp @@ -57,7 +57,7 @@ namespace PYBIND11_NAMESPACE } } - PYBIND11_TYPE_CASTER(value_type, detail::concat(make_caster::name, make_caster::name)); + PYBIND11_TYPE_CASTER(value_type, make_caster::name); }; template diff --git a/libmambapy/src/libmambapy/bindings/legacy.cpp b/libmambapy/src/libmambapy/bindings/legacy.cpp index f0412d9a2..f725c6028 100644 --- a/libmambapy/src/libmambapy/bindings/legacy.cpp +++ b/libmambapy/src/libmambapy/bindings/legacy.cpp @@ -412,16 +412,30 @@ bind_submodule_impl(pybind11::module_ m) } )); - /************** - * Bindings * - **************/ + /****************************************************** + * Forward bindings to avoid C++ name in Python doc * + ******************************************************/ + + // The lifetime of the unique Context instance will determine the lifetime of the other + // singletons. + using context_ptr = std::unique_ptr; + auto pyContext = py::class_(m, "Context"); + + auto pyChannelContext = py::class_(m, "ChannelContext"); + + py::register_exception(m, "MambaNativeException"); - // declare earlier to avoid C++ types in docstrings auto pyPrefixData = py::class_(m, "PrefixData"); + auto pySubdirIndexLoader = py::class_(m, "SubdirIndexLoader"); + // only used in a return type; does it belong in the module? auto pyRootRole = py::class_(m, "RootRole"); + /************** + * Bindings * + **************/ + py::class_(m, "Path") .def(py::init()) .def("__str__", [](fs::u8path& self) -> std::string { return self.string(); }) @@ -434,8 +448,6 @@ bind_submodule_impl(pybind11::module_ m) py::class_(m, "LockFile").def(py::init()); - py::register_exception(m, "MambaNativeException"); - py::add_ostream_redirect(m, "ostream_redirect"); py::class_(m, "RemoteFetchParams") @@ -514,47 +526,6 @@ bind_submodule_impl(pybind11::module_ m) ) .def("get_requested_specs_map", &History::get_requested_specs_map); - py::enum_(m, "QueryType") - .value("Search", QueryType::Search) - .value("Depends", QueryType::Depends) - .value("WhoNeeds", QueryType::WhoNeeds) - .def(py::init(&mambapy::enum_from_str)) - .def_static("parse", &query_type_parse); - py::implicitly_convertible(); - - py::enum_(m, "QueryResultFormat") - .value("Json", QueryResultFormat::Json) - .value("Tree", QueryResultFormat::Tree) - .value("Table", QueryResultFormat::Table) - .value("Pretty", QueryResultFormat::Pretty) - .value("RecursiveTable", QueryResultFormat::RecursiveTable) - .def(py::init(&mambapy::enum_from_str)); - py::implicitly_convertible(); - - py::class_(m, "QueryResult") - .def_property_readonly("type", &QueryResult::type) - .def_property_readonly("query", &QueryResult::query) - .def("sort", &QueryResult::sort, py::return_value_policy::reference) - .def("groupby", &QueryResult::groupby, py::return_value_policy::reference) - .def("reset", &QueryResult::reset, py::return_value_policy::reference) - .def("table", &QueryResult::table_to_str) - .def("tree", &QueryResult::tree_to_str) - .def("pretty", &QueryResult::pretty_to_str, py::arg("show_all_builds") = true) - .def("json", [](const QueryResult& query) { return query.json().dump(); }) - .def( - "to_dict", - [](const QueryResult& query) - { - auto json_module = pybind11::module_::import("json"); - return json_module.attr("loads")(query.json().dump()); - } - ); - - py::class_(m, "Query") - .def_static("find", &Query::find) - .def_static("whoneeds", &Query::whoneeds) - .def_static("depends", &Query::depends); - py::class_(m, "SubdirParams") .def_readwrite("local_repodata_ttl_s", &SubdirParams::local_repodata_ttl_s) .def_readwrite("offline", &SubdirParams::offline) @@ -586,7 +557,7 @@ bind_submodule_impl(pybind11::module_ m) .def("store_file_metadata", &SubdirMetadata::store_file_metadata) .def("write_state_file", &SubdirMetadata::write_state_file); - py::class_(m, "SubdirIndexLoader") + pySubdirIndexLoader .def_static( "create", SubdirIndexLoader::create, @@ -801,8 +772,7 @@ bind_submodule_impl(pybind11::module_ m) .value("CRITICAL", mamba::log_level::critical) .value("OFF", mamba::log_level::off); - py::class_(m, "ChannelContext") - .def_static("make_simple", &ChannelContext::make_simple) + pyChannelContext.def_static("make_simple", &ChannelContext::make_simple) .def_static("make_conda_compatible", &ChannelContext::make_conda_compatible) .def( py::init>(), @@ -846,11 +816,21 @@ bind_submodule_impl(pybind11::module_ m) py::arg("enable_signal_handling") = true ) .def_readwrite("enable_logging", &ContextOptions::enable_logging) - .def_readwrite("enable_signal_handling", &ContextOptions::enable_signal_handling); + .def_readwrite("enable_signal_handling", &ContextOptions::enable_signal_handling) + .def( + "__repr__", + [](const ContextOptions& self) + { + return fmt::format( + "ContextOptions(enable_logging={}, enable_signal_handling={})", + self.enable_logging, + self.enable_signal_handling + ); + } + ); // The lifetime of the unique Context instance will determine the lifetime of the other // singletons. - using context_ptr = std::unique_ptr; auto context_constructor = [](ContextOptions options = mambapy::default_context_options ) -> context_ptr { @@ -864,9 +844,8 @@ bind_submodule_impl(pybind11::module_ m) return context_ptr(&mambapy::singletons().context()); }; - py::class_ ctx(m, "Context"); - - ctx.def(py::init(context_constructor), py::arg("options") = mambapy::default_context_options) + pyContext + .def(py::init(context_constructor), py::arg("options") = mambapy::default_context_options) .def_static("use_default_signal_handler", &Context::use_default_signal_handler) .def_readwrite("graphics_params", &Context::graphics_params) .def_readwrite("offline", &Context::offline) @@ -918,36 +897,36 @@ bind_submodule_impl(pybind11::module_ m) .def("set_verbosity", &Context::set_verbosity) .def("set_log_level", &Context::set_log_level); - ctx.def_property_readonly_static( + pyContext.def_property_readonly_static( "RemoteFetchParams", [](py::handle) { return py::type::of(); } ); - py::class_(ctx, "OutputParams") + py::class_(pyContext, "OutputParams") .def(py::init<>()) .def_readwrite("verbosity", &Context::OutputParams::verbosity) .def_readwrite("json", &Context::OutputParams::json) .def_readwrite("quiet", &Context::OutputParams::quiet); - py::class_(ctx, "ThreadsParams") + py::class_(pyContext, "ThreadsParams") .def(py::init<>()) .def_readwrite("download_threads", &ThreadsParams::download_threads) .def_readwrite("extract_threads", &ThreadsParams::extract_threads); - py::class_(ctx, "PrefixParams") + py::class_(pyContext, "PrefixParams") .def(py::init<>()) .def_readwrite("target_prefix", &PrefixParams::target_prefix) .def_readwrite("conda_prefix", &PrefixParams::conda_prefix) .def_readwrite("root_prefix", &PrefixParams::root_prefix); - py::class_(ctx, "ValidationParams") + py::class_(pyContext, "ValidationParams") .def(py::init<>()) .def_readwrite("safety_checks", &ValidationParams::safety_checks) .def_readwrite("extra_safety_checks", &ValidationParams::extra_safety_checks) .def_readwrite("verify_artifacts", &ValidationParams::verify_artifacts) .def_readwrite("trusted_channels", &ValidationParams::trusted_channels); - ctx.def_readwrite("remote_fetch_params", &Context::remote_fetch_params) + pyContext.def_readwrite("remote_fetch_params", &Context::remote_fetch_params) .def_readwrite("output_params", &Context::output_params) .def_readwrite("threads_params", &Context::threads_params) .def_readwrite("prefix_params", &Context::prefix_params) @@ -957,19 +936,20 @@ bind_submodule_impl(pybind11::module_ m) // 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; - } - ) + pyContext + .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) @@ -1050,19 +1030,20 @@ bind_submodule_impl(pybind11::module_ m) ); // 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; - } - ) + pyContext + .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) @@ -1091,19 +1072,20 @@ bind_submodule_impl(pybind11::module_ m) ); // 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; - } - ) + pyContext + .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) @@ -1119,19 +1101,20 @@ bind_submodule_impl(pybind11::module_ m) ); // 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; - } - ) + pyContext + .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) @@ -1160,19 +1143,20 @@ bind_submodule_impl(pybind11::module_ m) ); // ValidationParams - ctx.def_property( - "safety_checks", - [](const Context& self) - { - deprecated("Use `validation_params.safety_checks` instead."); - return self.validation_params.safety_checks; - }, - [](Context& self, VerificationLevel sc) - { - deprecated("Use `validation_params.safety_checks` instead."); - self.validation_params.safety_checks = sc; - } - ) + pyContext + .def_property( + "safety_checks", + [](const Context& self) + { + deprecated("Use `validation_params.safety_checks` instead."); + return self.validation_params.safety_checks; + }, + [](Context& self, VerificationLevel sc) + { + deprecated("Use `validation_params.safety_checks` instead."); + self.validation_params.safety_checks = sc; + } + ) .def_property( "extra_safety_checks", [](const Context& self) @@ -1215,6 +1199,47 @@ bind_submodule_impl(pybind11::module_ m) //////////////////////////////////////////// + py::enum_(m, "QueryType") + .value("Search", QueryType::Search) + .value("Depends", QueryType::Depends) + .value("WhoNeeds", QueryType::WhoNeeds) + .def(py::init(&mambapy::enum_from_str)) + .def_static("parse", &query_type_parse); + py::implicitly_convertible(); + + py::enum_(m, "QueryResultFormat") + .value("Json", QueryResultFormat::Json) + .value("Tree", QueryResultFormat::Tree) + .value("Table", QueryResultFormat::Table) + .value("Pretty", QueryResultFormat::Pretty) + .value("RecursiveTable", QueryResultFormat::RecursiveTable) + .def(py::init(&mambapy::enum_from_str)); + py::implicitly_convertible(); + + py::class_(m, "QueryResult") + .def_property_readonly("type", &QueryResult::type) + .def_property_readonly("query", &QueryResult::query) + .def("sort", &QueryResult::sort, py::return_value_policy::reference) + .def("groupby", &QueryResult::groupby, py::return_value_policy::reference) + .def("reset", &QueryResult::reset, py::return_value_policy::reference) + .def("table", &QueryResult::table_to_str) + .def("tree", &QueryResult::tree_to_str) + .def("pretty", &QueryResult::pretty_to_str, py::arg("show_all_builds") = true) + .def("json", [](const QueryResult& query) { return query.json().dump(); }) + .def( + "to_dict", + [](const QueryResult& query) + { + auto json_module = pybind11::module_::import("json"); + return json_module.attr("loads")(query.json().dump()); + } + ); + + py::class_(m, "Query") + .def_static("find", &Query::find) + .def_static("whoneeds", &Query::whoneeds) + .def_static("depends", &Query::depends); + pyPrefixData .def( py::init( diff --git a/libmambapy/src/libmambapy/bindings/legacy.pyi b/libmambapy/src/libmambapy/bindings/legacy.pyi new file mode 100644 index 000000000..b57b58235 --- /dev/null +++ b/libmambapy/src/libmambapy/bindings/legacy.pyi @@ -0,0 +1,658 @@ +import libmambapy.bindings.solver +import libmambapy.bindings.solver.libsolv +import libmambapy.bindings.specs +import libmambapy.bindings.utils +import os +from typing import Any, ClassVar, Iterable, Iterator, overload + +MAMBA_CLEAN_ALL: int +MAMBA_CLEAN_INDEX: int +MAMBA_CLEAN_LOCKS: int +MAMBA_CLEAN_PKGS: int +MAMBA_CLEAN_TARBALLS: int +MAMBA_FORCE_REINSTALL: str +MAMBA_NO_DEPS: str +MAMBA_ONLY_DEPS: str +SOLVER_ALLOWUNINSTALL: str +SOLVER_CLEANDEPS: str +SOLVER_DISFAVOR: str +SOLVER_DISTUPGRADE: str +SOLVER_DROP_ORPHANED: str +SOLVER_ERASE: str +SOLVER_ESSENTIAL: str +SOLVER_FAVOR: str +SOLVER_FLAG_ADD_ALREADY_RECOMMENDED: str +SOLVER_FLAG_ALLOW_ARCHCHANGE: str +SOLVER_FLAG_ALLOW_DOWNGRADE: str +SOLVER_FLAG_ALLOW_NAMECHANGE: str +SOLVER_FLAG_ALLOW_UNINSTALL: str +SOLVER_FLAG_ALLOW_VENDORCHANGE: str +SOLVER_FLAG_BEST_OBEY_POLICY: str +SOLVER_FLAG_BREAK_ORPHANS: str +SOLVER_FLAG_DUP_ALLOW_ARCHCHANGE: str +SOLVER_FLAG_DUP_ALLOW_DOWNGRADE: str +SOLVER_FLAG_DUP_ALLOW_NAMECHANGE: str +SOLVER_FLAG_DUP_ALLOW_VENDORCHANGE: str +SOLVER_FLAG_FOCUS_BEST: str +SOLVER_FLAG_FOCUS_INSTALLED: str +SOLVER_FLAG_IGNORE_RECOMMENDED: str +SOLVER_FLAG_INSTALL_ALSO_UPDATES: str +SOLVER_FLAG_KEEP_EXPLICIT_OBSOLETES: str +SOLVER_FLAG_KEEP_ORPHANS: str +SOLVER_FLAG_NEED_UPDATEPROVIDE: str +SOLVER_FLAG_NO_AUTOTARGET: str +SOLVER_FLAG_NO_INFARCHCHECK: str +SOLVER_FLAG_NO_UPDATEPROVIDE: str +SOLVER_FLAG_ONLY_NAMESPACE_RECOMMENDED: str +SOLVER_FLAG_SPLITPROVIDES: str +SOLVER_FLAG_STRICT_REPO_PRIORITY: str +SOLVER_FLAG_STRONG_RECOMMENDS: str +SOLVER_FLAG_URPM_REORDER: str +SOLVER_FLAG_YUM_OBSOLETES: str +SOLVER_FORCEBEST: str +SOLVER_INSTALL: str +SOLVER_JOBMASK: str +SOLVER_LOCK: str +SOLVER_MULTIVERSION: str +SOLVER_NOAUTOSET: str +SOLVER_NOOP: str +SOLVER_NOTBYUSER: str +SOLVER_ORUPDATE: str +SOLVER_SELECTMASK: str +SOLVER_SETARCH: str +SOLVER_SETEV: str +SOLVER_SETEVR: str +SOLVER_SETMASK: str +SOLVER_SETNAME: str +SOLVER_SETREPO: str +SOLVER_SETVENDOR: str +SOLVER_SOLVABLE: str +SOLVER_SOLVABLE_ALL: str +SOLVER_SOLVABLE_NAME: str +SOLVER_SOLVABLE_ONE_OF: str +SOLVER_SOLVABLE_PROVIDES: str +SOLVER_SOLVABLE_REPO: str +SOLVER_TARGETED: str +SOLVER_UPDATE: str +SOLVER_USERINSTALLED: str +SOLVER_VERIFY: str +SOLVER_WEAK: str +SOLVER_WEAKENDEPS: str + +class ChannelContext: + def __init__( + self, + params: libmambapy.bindings.specs.ChannelResolveParams, + has_zst: list[libmambapy.bindings.specs.Channel], + ) -> None: ... + def has_zst(self, arg0: libmambapy.bindings.specs.Channel) -> bool: ... + @overload + def make_channel(self, arg0: str) -> list[libmambapy.bindings.specs.Channel]: ... + @overload + def make_channel( + self, arg0: libmambapy.bindings.specs.UnresolvedChannel + ) -> list[libmambapy.bindings.specs.Channel]: ... + @staticmethod + def make_conda_compatible(arg0: Context) -> ChannelContext: ... + @staticmethod + def make_simple(arg0: Context) -> ChannelContext: ... + def params(self) -> libmambapy.bindings.specs.ChannelResolveParams: ... + +class ChannelPriority: + __members__: ClassVar[dict] = ... # read-only + Disabled: ClassVar[ChannelPriority] = ... + Flexible: ClassVar[ChannelPriority] = ... + Strict: ClassVar[ChannelPriority] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class Context: + class OutputParams: + json: bool + quiet: bool + verbosity: int + def __init__(self) -> None: ... + + class PrefixParams: + conda_prefix: os.PathLike + root_prefix: os.PathLike + target_prefix: os.PathLike + def __init__(self) -> None: ... + + class ThreadsParams: + download_threads: int + extract_threads: int + def __init__(self) -> None: ... + + class ValidationParams: + extra_safety_checks: bool + safety_checks: VerificationLevel + trusted_channels: list[str] + verify_artifacts: bool + def __init__(self) -> None: ... + + RemoteFetchParams: ClassVar[type] = ... # read-only + add_pip_as_python_dependency: bool + always_yes: bool + channel_alias: str + channel_priority: ChannelPriority + channels: list[str] + conda_prefix: os.PathLike + connect_timeout_secs: float + custom_channels: dict[str, str] + custom_multichannels: dict[str, list[str]] + default_channels: list[str] + download_only: bool + download_threads: int + dry_run: bool + envs_dirs: list[os.PathLike] + experimental_repodata_parsing: bool + experimental_sat_error_message: bool + extra_safety_checks: bool + extract_threads: int + graphics_params: GraphicsParams + json: bool + local_repodata_ttl: int + max_retries: int + offline: bool + output_params: Context.OutputParams + pkgs_dirs: list[os.PathLike] + platform: str + prefix_params: Context.PrefixParams + proxy_servers: dict[str, str] + quiet: bool + remote_fetch_params: RemoteFetchParams + retry_backoff: int + retry_timeout: int + root_prefix: os.PathLike + safety_checks: VerificationLevel + show_anaconda_channel_warnings: bool + solver_flags: libmambapy.bindings.solver.Request.Flags + ssl_verify: str + target_prefix: os.PathLike + threads_params: Context.ThreadsParams + trusted_channels: list[str] + use_index_cache: bool + use_lockfiles: bool + use_only_tar_bz2: bool + user_agent: str + validation_params: Context.ValidationParams + verbosity: int + verify_artifacts: bool + def __init__(self, options: ContextOptions = ...) -> None: ... + def set_log_level(self, arg0: LogLevel) -> None: ... + def set_verbosity(self, arg0: int) -> None: ... + @staticmethod + def use_default_signal_handler(arg0: bool) -> None: ... + +class ContextOptions: + enable_logging: bool + enable_signal_handling: bool + def __init__(self, enable_logging: bool = ..., enable_signal_handling: bool = ...) -> None: ... + +class DownloadOptions: + download_threads: int + fail_fast: bool + sort: bool + verbose: bool + def __init__(self) -> None: ... + +class GraphicsParams: + no_progress_bars: bool + palette: Palette + def __init__(self) -> None: ... + +class History: + def __init__(self, path: os.PathLike, channel_context: ChannelContext) -> None: ... + def get_requested_specs_map(self) -> dict[str, libmambapy.bindings.specs.MatchSpec]: ... + +class Key: + keytype: str + keyval: str + scheme: str + def __init__(self, *args, **kwargs) -> None: ... + @staticmethod + def from_ed25519(arg0: str) -> Key: ... + @property + def json_str(self) -> str: ... + +class KeyMgr(RoleBase, RoleBaseExtension): + def __init__(self, arg0: str, arg1: RoleFullKeys, arg2: SpecBase) -> None: ... + +class LockFile: + def __init__(self, arg0: os.PathLike) -> None: ... + +class LogLevel: + __members__: ClassVar[dict] = ... # read-only + CRITICAL: ClassVar[LogLevel] = ... + DEBUG: ClassVar[LogLevel] = ... + ERROR: ClassVar[LogLevel] = ... + INFO: ClassVar[LogLevel] = ... + OFF: ClassVar[LogLevel] = ... + TRACE: ClassVar[LogLevel] = ... + WARNING: ClassVar[LogLevel] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class MambaNativeException(Exception): ... + +class MatchSpec: + def __init__(self, *args, **kwargs) -> None: ... + +class MirrorMap: + def __init__(self) -> None: ... + def has_mirrors(self, mirror_name: str) -> bool: ... + def __contains__(self, arg0: str) -> bool: ... + def __len__(self) -> int: ... + +class MultiPackageCache: + def __init__(self, context: Context, pkgs_dirs: list[os.PathLike]) -> None: ... + def get_tarball_path( + self, arg0: libmambapy.bindings.specs.PackageInfo, arg1: bool + ) -> os.PathLike: ... + @property + def first_writable_path(self) -> os.PathLike: ... + +class PackageInfo: + def __init__(self, *args, **kwargs) -> None: ... + +class Palette: + addition: libmambapy.bindings.utils.TextStyle + deletion: libmambapy.bindings.utils.TextStyle + external: libmambapy.bindings.utils.TextStyle + failure: libmambapy.bindings.utils.TextStyle + ignored: libmambapy.bindings.utils.TextStyle + progress_bar_downloaded: libmambapy.bindings.utils.TextStyle + progress_bar_extracted: libmambapy.bindings.utils.TextStyle + progress_bar_none: libmambapy.bindings.utils.TextStyle + safe: libmambapy.bindings.utils.TextStyle + shown: libmambapy.bindings.utils.TextStyle + success: libmambapy.bindings.utils.TextStyle + unsafe: libmambapy.bindings.utils.TextStyle + user: libmambapy.bindings.utils.TextStyle + def __init__(self, *args, **kwargs) -> None: ... + @staticmethod + def no_color() -> Palette: ... + @staticmethod + def terminal() -> Palette: ... + +class Path: + def __init__(self, arg0: str) -> None: ... + +class PkgMgr(RoleBase, RoleBaseExtension): + def __init__(self, arg0: str, arg1: RoleFullKeys, arg2: SpecBase) -> None: ... + +class Pool: + def __init__(self, *args, **kwargs) -> None: ... + +class PrefixData: + def __init__(self, path: os.PathLike, channel_context: ChannelContext) -> None: ... + def add_packages(self, arg0: list[libmambapy.bindings.specs.PackageInfo]) -> None: ... + @property + def package_records(self) -> dict[str, libmambapy.bindings.specs.PackageInfo]: ... + +class Query: + def __init__(self, *args, **kwargs) -> None: ... + @staticmethod + def depends( + arg0: libmambapy.bindings.solver.libsolv.Database, arg1: str, arg2: bool + ) -> QueryResult: ... + @staticmethod + def find(arg0: libmambapy.bindings.solver.libsolv.Database, arg1: list[str]) -> QueryResult: ... + @staticmethod + def whoneeds( + arg0: libmambapy.bindings.solver.libsolv.Database, arg1: str, arg2: bool + ) -> QueryResult: ... + +class QueryResult: + def __init__(self, *args, **kwargs) -> None: ... + def groupby(self, arg0: str) -> QueryResult: ... + def json(self) -> str: ... + def pretty(self, show_all_builds: bool = ...) -> str: ... + def reset(self) -> QueryResult: ... + def sort(self, arg0: str) -> QueryResult: ... + def table(self) -> str: ... + def to_dict(self) -> object: ... + def tree(self, arg0: GraphicsParams) -> str: ... + @property + def query(self) -> str: ... + @property + def type(self) -> QueryType: ... + +class QueryResultFormat: + __members__: ClassVar[dict] = ... # read-only + Json: ClassVar[QueryResultFormat] = ... + Pretty: ClassVar[QueryResultFormat] = ... + RecursiveTable: ClassVar[QueryResultFormat] = ... + Table: ClassVar[QueryResultFormat] = ... + Tree: ClassVar[QueryResultFormat] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class QueryType: + __members__: ClassVar[dict] = ... # read-only + Depends: ClassVar[QueryType] = ... + Search: ClassVar[QueryType] = ... + WhoNeeds: ClassVar[QueryType] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + @staticmethod + def parse(arg0: str) -> QueryType: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class RemoteFetchParams: + connect_timeout_secs: float + max_retries: int + proxy_servers: dict[str, str] + retry_backoff: int + retry_timeout: int + ssl_verify: str + user_agent: str + def __init__(self) -> None: ... + +class Repo: + def __init__(self, *args, **kwargs) -> None: ... + +class RoleBase: + def __init__(self, *args, **kwargs) -> None: ... + def all_keys(self) -> dict[str, RoleFullKeys]: ... + @property + def expired(self) -> bool: ... + @property + def expires(self) -> str: ... + @property + def file_ext(self) -> str: ... + @property + def spec_version(self) -> SpecBase: ... + @property + def type(self) -> str: ... + @property + def version(self) -> int: ... + +class RoleBaseExtension: + def __init__(self, *args, **kwargs) -> None: ... + @property + def timestamp(self) -> str: ... + +class RoleFullKeys: + keys: dict[str, Key] + threshold: int + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, keys: dict[str, Key], threshold: int) -> None: ... + +class RootImpl(RoleBase, RoleBaseExtension): + def __init__(self, json_str: str) -> None: ... + def create_key_mgr(self, json_str: str) -> KeyMgr: ... + def update(self, json_str: str) -> RootRole: ... + +class RootRole: + def __init__(self, *args, **kwargs) -> None: ... + +class Solver: + __members__: ClassVar[dict] = ... # read-only + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, *args, **kwargs) -> Any: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SolverRuleinfo: + __members__: ClassVar[dict] = ... # read-only + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, *args, **kwargs) -> Any: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class SpecBase: + def __init__(self, *args, **kwargs) -> None: ... + +class SpecImpl(SpecBase): + def __init__(self) -> None: ... + +class SubdirData: + def __init__(self, *args, **kwargs) -> None: ... + def cache_path(self) -> str: ... + def create_repo( + self, context: Context, db: libmambapy.bindings.solver.libsolv.Database + ) -> libmambapy.bindings.solver.libsolv.RepoInfo: ... + def loaded(self) -> bool: ... + def valid_json_cache(self) -> os.PathLike | None: ... + def valid_solv_cache(self) -> os.PathLike | None: ... + +class SubdirDownloadParams: + offline: bool + repodata_check_zst: bool + def __init__(self, *args, **kwargs) -> None: ... + +class SubdirIndex: + def __init__(self) -> None: ... + def create( + self, + context: Context, + channel_context: ChannelContext, + channel: libmambapy.bindings.specs.Channel, + platform: str, + full_url: str, + caches: MultiPackageCache, + repodata_fn: str, + url: str, + ) -> None: ... + def download(self, arg0: Context) -> bool: ... + def __getitem__(self, arg0: int) -> SubdirIndexEntry: ... + def __iter__(self) -> Iterator[SubdirIndexEntry]: ... + def __len__(self) -> int: ... + +class SubdirIndexEntry: + def __init__(self) -> None: ... + @property + def channel(self) -> libmambapy.bindings.specs.Channel: ... + @property + def platform(self) -> str: ... + @property + def subdir(self) -> SubdirData: ... + @property + def url(self) -> str: ... + +class SubdirIndexLoader: + def __init__(self, *args, **kwargs) -> None: ... + def caching_is_forbidden(self) -> bool: ... + def channel(self) -> libmambapy.bindings.specs.Channel: ... + def channel_id(self) -> str: ... + def clear_valid_cache_files(self) -> None: ... + @staticmethod + def create( + params: SubdirParams, + channel: libmambapy.bindings.specs.Channel, + platform: str, + caches: MultiPackageCache, + repodata_filename: str = ..., + ) -> SubdirIndexLoader: ... + @staticmethod + def download_required_indexes( + subdir_indices: Iterable, + subdir_params: SubdirDownloadParams, + auth_info: libmambapy.bindings.specs.AuthenticationDataBase, + mirrors: MirrorMap, + download_options: DownloadOptions, + remote_fetch_params: RemoteFetchParams, + ) -> None: ... + def is_local(self) -> bool: ... + def is_noarch(self) -> bool: ... + def metadata(self) -> SubdirMetadata: ... + def name(self) -> str: ... + def platform(self) -> str: ... + def repodata_url(self) -> libmambapy.bindings.specs.CondaURL: ... + def valid_cache_found(self) -> bool: ... + def valid_json_cache_path(self) -> os.PathLike: ... + def valid_libsolv_cache_path(self) -> os.PathLike: ... + def writable_libsolv_cache_path(self) -> os.PathLike: ... + +class SubdirMetadata: + class HttpMetadata: + cache_control: str + etag: str + last_modified: str + url: str + def __init__(self, *args, **kwargs) -> None: ... + + def __init__(self, *args, **kwargs) -> None: ... + def cache_control(self) -> str: ... + def etag(self) -> str: ... + def has_up_to_date_zst(self) -> bool: ... + def is_valid_metadata(self, arg0: os.PathLike) -> bool: ... + def last_modified(self) -> str: ... + @staticmethod + def read(arg0: os.PathLike) -> SubdirMetadata: ... + @staticmethod + def read_from_repodata_json(arg0: os.PathLike) -> SubdirMetadata: ... + @staticmethod + def read_state_file(arg0: os.PathLike, arg1: os.PathLike) -> SubdirMetadata: ... + def set_http_metadata(self, arg0: SubdirMetadata.HttpMetadata) -> None: ... + def set_zst(self, arg0: bool) -> None: ... + def store_file_metadata(self, arg0: os.PathLike) -> None: ... + def url(self) -> str: ... + def write_state_file(self, arg0: os.PathLike) -> None: ... + +class SubdirParams: + local_repodata_ttl_s: int | None + offline: bool + repodata_force_use_zst: bool + def __init__(self, *args, **kwargs) -> None: ... + +class TimeRef: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, arg0: int) -> None: ... + def set(self, arg0: int) -> None: ... + def set_now(self) -> None: ... + def timestamp(self) -> str: ... + +class Transaction: + def __init__( + self, + arg0: Context, + arg1: libmambapy.bindings.solver.libsolv.Database, + arg2: libmambapy.bindings.solver.Request, + arg3: libmambapy.bindings.solver.Solution, + arg4: MultiPackageCache, + ) -> None: ... + def execute(self, arg0: Context, arg1: ChannelContext, arg2: PrefixData) -> bool: ... + def fetch_extract_packages(self, arg0: Context, arg1: ChannelContext) -> bool: ... + def log_json(self) -> None: ... + def print(self, arg0: Context, arg1: ChannelContext) -> None: ... + def prompt(self, arg0: Context, arg1: ChannelContext) -> bool: ... + def to_conda( + self, + ) -> tuple[tuple[list[str], list[str]], list[tuple[str, str, str]], list[tuple[str, str]]]: ... + +class VerificationLevel: + __members__: ClassVar[dict] = ... # read-only + Disabled: ClassVar[VerificationLevel] = ... + Enabled: ClassVar[VerificationLevel] = ... + Warn: ClassVar[VerificationLevel] = ... + __entries: ClassVar[dict] = ... + def __init__(self, value: int) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class ostream_redirect: + def __init__(self, stdout: bool = ..., stderr: bool = ...) -> None: ... + def __enter__(self) -> None: ... + def __exit__(self, *args) -> None: ... + +def cache_filename_from_url(arg0: str) -> str: ... +def cache_fn_url(arg0: str) -> str: ... +def cache_name_from_url(arg0: str) -> str: ... +def cancel_json_output(arg0: Context) -> None: ... +def clean(context: Context, flags: int) -> None: ... +def create_cache_dir(arg0: os.PathLike) -> str: ... +def extract_package(arg0: os.PathLike, arg1: os.PathLike, arg2: bool) -> None: ... +def generate_ed25519_keypair() -> tuple[str, str]: ... +def get_virtual_packages(arg0: Context) -> list[libmambapy.bindings.specs.PackageInfo]: ... +def init_console() -> None: ... +def load_installed_packages_in_database( + context: Context, database: libmambapy.bindings.solver.libsolv.Database, prefix_data: PrefixData +) -> libmambapy.bindings.solver.libsolv.RepoInfo: ... +def load_subdir_in_database( + context: Context, + database: libmambapy.bindings.solver.libsolv.Database, + subdir: SubdirIndexLoader, +) -> libmambapy.bindings.solver.libsolv.RepoInfo: ... +def sign(data: str, secret_key: str) -> str: ... +def transmute( + context: Context, + source_package: os.PathLike, + destination_package: os.PathLike, + compression_level: int, + compression_threads: int = ..., +) -> bool: ... diff --git a/libmambapy/src/libmambapy/bindings/solver/__init__.pyi b/libmambapy/src/libmambapy/bindings/solver/__init__.pyi new file mode 100644 index 000000000..37910c08e --- /dev/null +++ b/libmambapy/src/libmambapy/bindings/solver/__init__.pyi @@ -0,0 +1,570 @@ +import libmambapy.bindings.specs +import libmambapy.bindings.utils +from . import libsolv as libsolv +from _typeshed import Incomplete +from typing import ClassVar, Iterable, Iterator, overload + +class CompressedProblemsGraph: + class ConstraintListNode: + def __init__(self) -> None: ... + def add(self, arg0: ProblemsGraph.ConstraintNode) -> None: ... + def build_strings_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def clear(self) -> None: ... + def name(self) -> str: ... + def versions_and_build_strings_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def versions_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def __bool__(self) -> bool: ... + def __iter__(self) -> Iterator[ProblemsGraph.ConstraintNode]: ... + def __len__(self) -> int: ... + + class DependencyList: + def __init__(self) -> None: ... + def add(self, arg0: libmambapy.bindings.specs.MatchSpec) -> None: ... + def build_strings_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def clear(self) -> None: ... + def name(self) -> str: ... + def versions_and_build_strings_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def versions_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def __bool__(self) -> bool: ... + def __iter__(self) -> Iterator[libmambapy.bindings.specs.MatchSpec]: ... + def __len__(self) -> int: ... + + class PackageListNode: + def __init__(self) -> None: ... + def add(self, arg0: ProblemsGraph.PackageNode) -> None: ... + def build_strings_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def clear(self) -> None: ... + def name(self) -> str: ... + def versions_and_build_strings_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def versions_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def __bool__(self) -> bool: ... + def __iter__(self) -> Iterator[ProblemsGraph.PackageNode]: ... + def __len__(self) -> int: ... + + class UnresolvedDependencyListNode: + def __init__(self) -> None: ... + def add(self, arg0: ProblemsGraph.UnresolvedDependencyNode) -> None: ... + def build_strings_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def clear(self) -> None: ... + def name(self) -> str: ... + def versions_and_build_strings_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def versions_trunc( + self, + sep: str = ..., + etc: str = ..., + threshold: int = ..., + remove_duplicates: bool = ..., + ) -> tuple[str, int]: ... + def __bool__(self) -> bool: ... + def __iter__(self) -> Iterator[ProblemsGraph.UnresolvedDependencyNode]: ... + def __len__(self) -> int: ... + + ConflictMap: ClassVar[type] = ... # read-only + RootNode: ClassVar[type] = ... # read-only + def __init__(self, *args, **kwargs) -> None: ... + def conflicts(self) -> ProblemsGraph.ConflictMap: ... + @overload + @staticmethod + def from_problems_graph( + problems_graph: ProblemsGraph, merge_criteria + ) -> CompressedProblemsGraph: ... + @overload + @staticmethod + def from_problems_graph(problems_graph: ProblemsGraph) -> CompressedProblemsGraph: ... + def graph( + self, + ) -> tuple[ + dict[ + int, + ProblemsGraph.RootNode + | CompressedProblemsGraph.PackageListNode + | CompressedProblemsGraph.UnresolvedDependencyListNode + | CompressedProblemsGraph.ConstraintListNode, + ], + dict[tuple[int, int], CompressedProblemsGraph.DependencyList], + ]: ... + def root_node(self) -> int: ... + def tree_message(self, format: ProblemsMessageFormat = ...) -> str: ... + +class ProblemsGraph: + class ConflictMap: + def __init__(self) -> None: ... + def add(self, arg0: int, arg1: int) -> bool: ... + def clear(self) -> None: ... + def conflicts(self, arg0: int) -> set[int]: ... + def has_conflict(self, arg0: int) -> bool: ... + def in_conflict(self, arg0: int, arg1: int) -> bool: ... + def __bool__(self) -> bool: ... + def __contains__(self, arg0: int) -> bool: ... + def __copy__(self) -> ProblemsGraph.ConflictMap: ... + def __deepcopy__(self, memo: dict) -> ProblemsGraph.ConflictMap: ... + def __eq__(self, arg0: ProblemsGraph.ConflictMap) -> bool: ... + def __iter__(self) -> Iterator[tuple[int, set[int]]]: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: ProblemsGraph.ConflictMap) -> bool: ... + + class ConstraintNode(libmambapy.bindings.specs.MatchSpec): + def __init__(self, arg0: libmambapy.bindings.specs.MatchSpec) -> None: ... + + class PackageNode(libmambapy.bindings.specs.PackageInfo): + def __init__(self, arg0: libmambapy.bindings.specs.PackageInfo) -> None: ... + + class RootNode: + def __init__(self) -> None: ... + + class UnresolvedDependencyNode(libmambapy.bindings.specs.MatchSpec): + def __init__(self, arg0: libmambapy.bindings.specs.MatchSpec) -> None: ... + + def __init__(self, *args, **kwargs) -> None: ... + def conflicts(self) -> ProblemsGraph.ConflictMap: ... + def graph( + self, + ) -> tuple[ + dict[ + int, + ProblemsGraph.RootNode + | ProblemsGraph.PackageNode + | ProblemsGraph.UnresolvedDependencyNode + | ProblemsGraph.ConstraintNode, + ], + dict[tuple[int, int], libmambapy.bindings.specs.MatchSpec], + ]: ... + def root_node(self) -> int: ... + @staticmethod + def simplify_conflicts(arg0: ProblemsGraph) -> ProblemsGraph: ... + +class ProblemsMessageFormat: + available: libmambapy.bindings.utils.TextStyle + indents: Incomplete + unavailable: libmambapy.bindings.utils.TextStyle + @overload + def __init__(self) -> None: ... + @overload + def __init__( + self, + unavailable: libmambapy.bindings.utils.TextStyle, + available: libmambapy.bindings.utils.TextStyle, + indents, + ) -> None: ... + def __copy__(self) -> ProblemsMessageFormat: ... + def __deepcopy__(self, memo: dict) -> ProblemsMessageFormat: ... + +class Request: + class Flags: + allow_downgrade: bool + allow_uninstall: bool + force_reinstall: bool + keep_dependencies: bool + keep_user_specs: bool + order_request: bool + strict_repo_priority: bool + def __init__( + self, + keep_dependencies: bool = ..., + keep_user_specs: bool = ..., + force_reinstall: bool = ..., + allow_downgrade: bool = ..., + allow_uninstall: bool = ..., + strict_repo_priority: bool = ..., + order_request: bool = ..., + ) -> None: ... + def __copy__(self) -> Request.Flags: ... + def __deepcopy__(self, memo: dict) -> Request.Flags: ... + + class Freeze: + spec: libmambapy.bindings.specs.MatchSpec + def __init__(self, spec: libmambapy.bindings.specs.MatchSpec) -> None: ... + def __copy__(self) -> Request.Freeze: ... + def __deepcopy__(self, memo: dict) -> Request.Freeze: ... + + class Install: + spec: libmambapy.bindings.specs.MatchSpec + def __init__(self, spec: libmambapy.bindings.specs.MatchSpec) -> None: ... + def __copy__(self) -> Request.Install: ... + def __deepcopy__(self, memo: dict) -> Request.Install: ... + + class JobList: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, arg0: Request.JobList) -> None: ... + @overload + def __init__(self, arg0: Iterable) -> None: ... + def append( + self, + x: Request.Install + | Request.Remove + | Request.Update + | Request.UpdateAll + | Request.Keep + | Request.Freeze + | Request.Pin, + ) -> None: ... + def clear(self) -> None: ... + @overload + def extend(self, L: Request.JobList) -> None: ... + @overload + def extend(self, L: Iterable) -> None: ... + def insert( + self, + i: int, + x: Request.Install + | Request.Remove + | Request.Update + | Request.UpdateAll + | Request.Keep + | Request.Freeze + | Request.Pin, + ) -> None: ... + @overload + def pop( + self, + ) -> ( + Request.Install + | Request.Remove + | Request.Update + | Request.UpdateAll + | Request.Keep + | Request.Freeze + | Request.Pin + ): ... + @overload + def pop( + self, i: int + ) -> ( + Request.Install + | Request.Remove + | Request.Update + | Request.UpdateAll + | Request.Keep + | Request.Freeze + | Request.Pin + ): ... + def __bool__(self) -> bool: ... + @overload + def __delitem__(self, arg0: int) -> None: ... + @overload + def __delitem__(self, arg0: slice) -> None: ... + @overload + def __getitem__(self, s: slice) -> Request.JobList: ... + @overload + def __getitem__( + self, arg0: int + ) -> ( + Request.Install + | Request.Remove + | Request.Update + | Request.UpdateAll + | Request.Keep + | Request.Freeze + | Request.Pin + ): ... + def __iter__( + self, + ) -> Iterator[ + Request.Install + | Request.Remove + | Request.Update + | Request.UpdateAll + | Request.Keep + | Request.Freeze + | Request.Pin + ]: ... + def __len__(self) -> int: ... + @overload + def __setitem__( + self, + arg0: int, + arg1: Request.Install + | Request.Remove + | Request.Update + | Request.UpdateAll + | Request.Keep + | Request.Freeze + | Request.Pin, + ) -> None: ... + @overload + def __setitem__(self, arg0: slice, arg1: Request.JobList) -> None: ... + + class Keep: + spec: libmambapy.bindings.specs.MatchSpec + def __init__(self, spec: libmambapy.bindings.specs.MatchSpec) -> None: ... + def __copy__(self) -> Request.Keep: ... + def __deepcopy__(self, memo: dict) -> Request.Keep: ... + + class Pin: + spec: libmambapy.bindings.specs.MatchSpec + def __init__(self, spec: libmambapy.bindings.specs.MatchSpec) -> None: ... + def __copy__(self) -> Request.Pin: ... + def __deepcopy__(self, memo: dict) -> Request.Pin: ... + + class Remove: + clean_dependencies: bool + spec: libmambapy.bindings.specs.MatchSpec + def __init__( + self, spec: libmambapy.bindings.specs.MatchSpec, clean_dependencies: bool = ... + ) -> None: ... + def __copy__(self) -> Request.Remove: ... + def __deepcopy__(self, memo: dict) -> Request.Remove: ... + + class Update: + clean_dependencies: bool + spec: libmambapy.bindings.specs.MatchSpec + def __init__( + self, spec: libmambapy.bindings.specs.MatchSpec, clean_dependencies: bool = ... + ) -> None: ... + def __copy__(self) -> Request.Update: ... + def __deepcopy__(self, memo: dict) -> Request.Update: ... + + class UpdateAll: + clean_dependencies: bool + def __init__(self, clean_dependencies: bool = ...) -> None: ... + def __copy__(self) -> Request.UpdateAll: ... + def __deepcopy__(self, memo: dict) -> Request.UpdateAll: ... + + flags: Request.Flags + jobs: Request.JobList + @overload + def __init__(self, jobs: Request.JobList, flags: Request.Flags = ...) -> None: ... + @overload + def __init__(self, jobs: Iterable, flags: Request.Flags = ...) -> None: ... + def __copy__(self) -> Request: ... + def __deepcopy__(self, memo: dict) -> Request: ... + +class Solution: + class ActionList: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, arg0: Solution.ActionList) -> None: ... + @overload + def __init__(self, arg0: Iterable) -> None: ... + def append( + self, + x: Solution.Omit + | Solution.Upgrade + | Solution.Downgrade + | Solution.Change + | Solution.Reinstall + | Solution.Remove + | Solution.Install, + ) -> None: ... + def clear(self) -> None: ... + @overload + def extend(self, L: Solution.ActionList) -> None: ... + @overload + def extend(self, L: Iterable) -> None: ... + def insert( + self, + i: int, + x: Solution.Omit + | Solution.Upgrade + | Solution.Downgrade + | Solution.Change + | Solution.Reinstall + | Solution.Remove + | Solution.Install, + ) -> None: ... + @overload + def pop( + self, + ) -> ( + Solution.Omit + | Solution.Upgrade + | Solution.Downgrade + | Solution.Change + | Solution.Reinstall + | Solution.Remove + | Solution.Install + ): ... + @overload + def pop( + self, i: int + ) -> ( + Solution.Omit + | Solution.Upgrade + | Solution.Downgrade + | Solution.Change + | Solution.Reinstall + | Solution.Remove + | Solution.Install + ): ... + def __bool__(self) -> bool: ... + @overload + def __delitem__(self, arg0: int) -> None: ... + @overload + def __delitem__(self, arg0: slice) -> None: ... + @overload + def __getitem__(self, s: slice) -> Solution.ActionList: ... + @overload + def __getitem__( + self, arg0: int + ) -> ( + Solution.Omit + | Solution.Upgrade + | Solution.Downgrade + | Solution.Change + | Solution.Reinstall + | Solution.Remove + | Solution.Install + ): ... + def __iter__( + self, + ) -> Iterator[ + Solution.Omit + | Solution.Upgrade + | Solution.Downgrade + | Solution.Change + | Solution.Reinstall + | Solution.Remove + | Solution.Install + ]: ... + def __len__(self) -> int: ... + @overload + def __setitem__( + self, + arg0: int, + arg1: Solution.Omit + | Solution.Upgrade + | Solution.Downgrade + | Solution.Change + | Solution.Reinstall + | Solution.Remove + | Solution.Install, + ) -> None: ... + @overload + def __setitem__(self, arg0: slice, arg1: Solution.ActionList) -> None: ... + + class Change: + install: libmambapy.bindings.specs.PackageInfo + remove: libmambapy.bindings.specs.PackageInfo + def __init__( + self, + remove: libmambapy.bindings.specs.PackageInfo, + install: libmambapy.bindings.specs.PackageInfo, + ) -> None: ... + def __copy__(self) -> Solution.Change: ... + def __deepcopy__(self, memo: dict) -> Solution.Change: ... + + class Downgrade: + install: libmambapy.bindings.specs.PackageInfo + remove: libmambapy.bindings.specs.PackageInfo + def __init__( + self, + remove: libmambapy.bindings.specs.PackageInfo, + install: libmambapy.bindings.specs.PackageInfo, + ) -> None: ... + def __copy__(self) -> Solution.Downgrade: ... + def __deepcopy__(self, memo: dict) -> Solution.Downgrade: ... + + class Install: + install: libmambapy.bindings.specs.PackageInfo + def __init__(self, install: libmambapy.bindings.specs.PackageInfo) -> None: ... + def __copy__(self) -> Solution.Install: ... + def __deepcopy__(self, memo: dict) -> Solution.Install: ... + + class Omit: + what: libmambapy.bindings.specs.PackageInfo + def __init__(self, what: libmambapy.bindings.specs.PackageInfo) -> None: ... + def __copy__(self) -> Solution.Omit: ... + def __deepcopy__(self, memo: dict) -> Solution.Omit: ... + + class Reinstall: + what: libmambapy.bindings.specs.PackageInfo + def __init__(self, what: libmambapy.bindings.specs.PackageInfo) -> None: ... + def __copy__(self) -> Solution.Reinstall: ... + def __deepcopy__(self, memo: dict) -> Solution.Reinstall: ... + + class Remove: + remove: libmambapy.bindings.specs.PackageInfo + def __init__(self, remove: libmambapy.bindings.specs.PackageInfo) -> None: ... + def __copy__(self) -> Solution.Remove: ... + def __deepcopy__(self, memo: dict) -> Solution.Remove: ... + + class Upgrade: + install: libmambapy.bindings.specs.PackageInfo + remove: libmambapy.bindings.specs.PackageInfo + def __init__( + self, + remove: libmambapy.bindings.specs.PackageInfo, + install: libmambapy.bindings.specs.PackageInfo, + ) -> None: ... + def __copy__(self) -> Solution.Upgrade: ... + def __deepcopy__(self, memo: dict) -> Solution.Upgrade: ... + + actions: Solution.ActionList + @overload + def __init__(self, arg0: Solution.ActionList) -> None: ... + @overload + def __init__(self, arg0: Iterable) -> None: ... + def to_install(self) -> list[libmambapy.bindings.specs.PackageInfo]: ... + def to_omit(self) -> list[libmambapy.bindings.specs.PackageInfo]: ... + def to_remove(self) -> list[libmambapy.bindings.specs.PackageInfo]: ... + def __copy__(self) -> Solution: ... + def __deepcopy__(self, memo: dict) -> Solution: ... diff --git a/libmambapy/src/libmambapy/bindings/solver/libsolv.pyi b/libmambapy/src/libmambapy/bindings/solver/libsolv.pyi new file mode 100644 index 000000000..ca91e1723 --- /dev/null +++ b/libmambapy/src/libmambapy/bindings/solver/libsolv.pyi @@ -0,0 +1,227 @@ +import libmambapy.bindings.solver +import libmambapy.bindings.specs +import os +from typing import Callable, ClassVar, Iterable, overload + +class Database: + def __init__( + self, + channel_params: libmambapy.bindings.specs.ChannelResolveParams, + matchspec_parser: MatchSpecParser = ..., + ) -> None: ... + def add_repo_from_native_serialization( + self, + path: os.PathLike, + expected: RepodataOrigin, + channel_id: str, + add_pip_as_python_dependency: PipAsPythonDependency = ..., + ) -> RepoInfo: ... + def add_repo_from_packages( + self, + packages: Iterable, + name: str = ..., + add_pip_as_python_dependency: PipAsPythonDependency = ..., + ) -> RepoInfo: ... + def add_repo_from_repodata_json( + self, + path: os.PathLike, + url: str, + channel_id: str, + add_pip_as_python_dependency: PipAsPythonDependency = ..., + package_types: PackageTypes = ..., + verify_packages: VerifyPackages = ..., + repodata_parser: RepodataParser = ..., + ) -> RepoInfo: ... + def installed_repo(self) -> RepoInfo | None: ... + def native_serialize_repo( + self, repo: RepoInfo, path: os.PathLike, metadata: RepodataOrigin + ) -> RepoInfo: ... + def package_count(self) -> int: ... + def packages_depending_on(self, spec: libmambapy.bindings.specs.MatchSpec) -> list: ... + def packages_in_repo(self, repo: RepoInfo) -> list: ... + def packages_matching(self, spec: libmambapy.bindings.specs.MatchSpec) -> list: ... + def remove_repo(self, repo: RepoInfo) -> None: ... + def repo_count(self) -> int: ... + def set_installed_repo(self, repo: RepoInfo) -> None: ... + def set_logger(self, arg0: Callable[[LogLevel, str], None]) -> None: ... + def set_repo_priority(self, repo: RepoInfo, priorities: Priorities) -> None: ... + +class LogLevel: + __members__: ClassVar[dict] = ... # read-only + Debug: ClassVar[LogLevel] = ... + Error: ClassVar[LogLevel] = ... + Fatal: ClassVar[LogLevel] = ... + Warning: ClassVar[LogLevel] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class MatchSpecParser: + __members__: ClassVar[dict] = ... # read-only + Libsolv: ClassVar[MatchSpecParser] = ... + Mamba: ClassVar[MatchSpecParser] = ... + Mixed: ClassVar[MatchSpecParser] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class PackageTypes: + __members__: ClassVar[dict] = ... # read-only + CondaAndTarBz2: ClassVar[PackageTypes] = ... + CondaOnly: ClassVar[PackageTypes] = ... + CondaOrElseTarBz2: ClassVar[PackageTypes] = ... + TarBz2Only: ClassVar[PackageTypes] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class PipAsPythonDependency: + __members__: ClassVar[dict] = ... # read-only + No: ClassVar[PipAsPythonDependency] = ... + Yes: ClassVar[PipAsPythonDependency] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: bool) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class Priorities: + priority: int + subpriority: int + def __init__(self, priority: int = ..., subpriority: int = ...) -> None: ... + def __copy__(self) -> Priorities: ... + def __deepcopy__(self, memo: dict) -> Priorities: ... + def __eq__(self, arg0: Priorities) -> bool: ... + def __ne__(self, arg0: Priorities) -> bool: ... + +class RepoInfo: + def __init__(self, *args, **kwargs) -> None: ... + def package_count(self) -> int: ... + def __copy__(self) -> RepoInfo: ... + def __deepcopy__(self, memo: dict) -> RepoInfo: ... + def __eq__(self, arg0: RepoInfo) -> bool: ... + def __ne__(self, arg0: RepoInfo) -> bool: ... + @property + def id(self) -> int: ... + @property + def name(self) -> str: ... + @property + def priority(self) -> Priorities: ... + +class RepodataOrigin: + etag: str + mod: str + url: str + def __init__(self, url: str = ..., etag: str = ..., mod: str = ...) -> None: ... + def __copy__(self) -> RepodataOrigin: ... + def __deepcopy__(self, memo: dict) -> RepodataOrigin: ... + def __eq__(self, arg0: RepodataOrigin) -> bool: ... + def __ne__(self, arg0: RepodataOrigin) -> bool: ... + +class RepodataParser: + __members__: ClassVar[dict] = ... # read-only + Libsolv: ClassVar[RepodataParser] = ... + Mamba: ClassVar[RepodataParser] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class Solver: + def __init__(self) -> None: ... + def add_global_job(self, *args, **kwargs) -> None: ... + def add_jobs(self, *args, **kwargs) -> None: ... + def add_pin(self, *args, **kwargs) -> None: ... + def is_solved(self, *args, **kwargs) -> None: ... + def must_solve(self, *args, **kwargs) -> None: ... + def set_flags(self, *args, **kwargs) -> None: ... + def set_libsolv_flags(self, *args, **kwargs) -> None: ... + def set_postsolve_flags(self, *args, **kwargs) -> None: ... + def solve( + self, + database: Database, + request: libmambapy.bindings.solver.Request, + matchspec_parser: MatchSpecParser = ..., + ) -> libmambapy.bindings.solver.Solution | UnSolvable: ... + def try_solve(self, *args, **kwargs) -> None: ... + +class UnSolvable: + def __init__(self, *args, **kwargs) -> None: ... + def all_problems_to_str(self, database: Database) -> str: ... + def explain_problems( + self, database: Database, format: libmambapy.bindings.solver.ProblemsMessageFormat + ) -> str: ... + def problems(self, database: Database) -> list[str]: ... + def problems_graph(self, database: Database) -> libmambapy.bindings.solver.ProblemsGraph: ... + def problems_to_str(self, database: Database) -> str: ... + +class VerifyPackages: + __members__: ClassVar[dict] = ... # read-only + No: ClassVar[VerifyPackages] = ... + Yes: ClassVar[VerifyPackages] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: bool) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... diff --git a/libmambapy/src/libmambapy/bindings/specs.cpp b/libmambapy/src/libmambapy/bindings/specs.cpp index 49401ec3d..a2ebb9be1 100644 --- a/libmambapy/src/libmambapy/bindings/specs.cpp +++ b/libmambapy/src/libmambapy/bindings/specs.cpp @@ -790,8 +790,14 @@ namespace mambapy .def("__deepcopy__", &deepcopy, py::arg("memo")); py::class_(m, "MatchSpec") - .def_property_readonly_static("NameSpec", &py::type::of) - .def_property_readonly_static("BuildStringSpec", &py::type::of) + .def_property_readonly_static( + "NameSpec", + [](py::handle) { return py::type::of(); } + ) + .def_property_readonly_static( + "BuildStringSpec", + [](py::handle) { return py::type::of(); } + ) .def_readonly_static("url_md5_sep", &MatchSpec::url_md5_sep) .def_readonly_static("preferred_list_open", &MatchSpec::preferred_list_open) .def_readonly_static("preferred_list_close", &MatchSpec::preferred_list_close) diff --git a/libmambapy/src/libmambapy/bindings/specs.pyi b/libmambapy/src/libmambapy/bindings/specs.pyi new file mode 100644 index 000000000..3ea7e84a8 --- /dev/null +++ b/libmambapy/src/libmambapy/bindings/specs.pyi @@ -0,0 +1,713 @@ +import os +from _typeshed import Incomplete +from typing import ClassVar, Iterable, Iterator, overload + +class AuthenticationDataBase: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, arg0: dict) -> None: ... + def at_weaken(self, arg0: str) -> BasicHTTPAuthentication | BearerToken | CondaToken: ... + def contains_weaken(self, arg0: str) -> bool: ... + def items(self) -> ItemsView: ... + def keys(self) -> KeysView: ... + def values(self) -> ValuesView: ... + def __bool__(self) -> bool: ... + @overload + def __contains__(self, arg0: str) -> bool: ... + @overload + def __contains__(self, arg0: object) -> bool: ... + def __delitem__(self, arg0: str) -> None: ... + def __eq__(self, arg0: AuthenticationDataBase) -> bool: ... + def __getitem__(self, arg0: str) -> BasicHTTPAuthentication | BearerToken | CondaToken: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: AuthenticationDataBase) -> bool: ... + def __setitem__( + self, arg0: str, arg1: BasicHTTPAuthentication | BearerToken | CondaToken + ) -> None: ... + +class BasicHTTPAuthentication: + password: str + user: str + def __init__(self, user: str, password: str) -> None: ... + def __copy__(self) -> BasicHTTPAuthentication: ... + def __deepcopy__(self, memo: dict) -> BasicHTTPAuthentication: ... + def __eq__(self, arg0: BasicHTTPAuthentication) -> bool: ... + def __hash__(self) -> int: ... + def __ne__(self, arg0: BasicHTTPAuthentication) -> bool: ... + +class BearerToken: + token: str + def __init__(self, token: str) -> None: ... + def __copy__(self) -> BearerToken: ... + def __deepcopy__(self, memo: dict) -> BearerToken: ... + def __eq__(self, arg0: BearerToken) -> bool: ... + def __hash__(self) -> int: ... + def __ne__(self, arg0: BearerToken) -> bool: ... + +class Channel: + class Match: + __members__: ClassVar[dict] = ... # read-only + Full: ClassVar[Channel.Match] = ... + InOtherPlatform: ClassVar[Channel.Match] = ... + No: ClassVar[Channel.Match] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + + ChannelMap: ClassVar[type] = ... # read-only + MultiChannelMap: ClassVar[type] = ... # read-only + display_name: str + platforms: set[str] + url: CondaURL + def __init__(self, url: CondaURL, display_name: str, platforms: set[str]) -> None: ... + def contains_equivalent(self, arg0: Channel) -> bool: ... + def contains_package(self, arg0: CondaURL) -> Channel.Match: ... + def is_equivalent_to(self, arg0: Channel) -> bool: ... + def is_package(self) -> bool: ... + def platform_url(self, arg0: str) -> CondaURL: ... + def platform_urls(self) -> list[CondaURL]: ... + @overload + @staticmethod + def resolve(what: UnresolvedChannel, params: ChannelResolveParams) -> list[Channel]: ... + @overload + @staticmethod + def resolve( + what: UnresolvedChannel, + platforms: set[str] = ..., + channel_alias: CondaURL = ..., + custom_channels: ChannelResolveParams.ChannelMap = ..., + custom_multichannels: ChannelResolveParams.MultiChannelMap = ..., + authentication_db: AuthenticationDataBase = ..., + home_dir: str = ..., + current_working_dir: str = ..., + ) -> list[Channel]: ... + def url_equivalent_with(self, arg0: Channel) -> bool: ... + def __copy__(self) -> Channel: ... + def __deepcopy__(self, memo: dict) -> Channel: ... + def __eq__(self, arg0: Channel) -> bool: ... + def __hash__(self) -> int: ... + def __ne__(self, arg0: Channel) -> bool: ... + +class ChannelResolveParams: + class ChannelMap: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, arg0: dict) -> None: ... + def at_weaken(self, arg0: str) -> Channel: ... + def contains_weaken(self, arg0: str) -> bool: ... + def items(self) -> ItemsView: ... + def keys(self) -> KeysView: ... + def values(self) -> ValuesView: ... + def __bool__(self) -> bool: ... + @overload + def __contains__(self, arg0: str) -> bool: ... + @overload + def __contains__(self, arg0: object) -> bool: ... + def __delitem__(self, arg0: str) -> None: ... + def __eq__(self, arg0: ChannelResolveParams.ChannelMap) -> bool: ... + def __getitem__(self, arg0: str) -> Channel: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: ChannelResolveParams.ChannelMap) -> bool: ... + def __setitem__(self, arg0: str, arg1: Channel) -> None: ... + + class MultiChannelMap: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, arg0: dict) -> None: ... + def at_weaken(self, arg0: str) -> list[Channel]: ... + def contains_weaken(self, arg0: str) -> bool: ... + def items(self) -> ItemsView: ... + def keys(self) -> KeysView: ... + def values(self) -> ValuesView: ... + def __bool__(self) -> bool: ... + @overload + def __contains__(self, arg0: str) -> bool: ... + @overload + def __contains__(self, arg0: object) -> bool: ... + def __delitem__(self, arg0: str) -> None: ... + def __eq__(self, arg0: ChannelResolveParams.MultiChannelMap) -> bool: ... + def __getitem__(self, arg0: str) -> list[Channel]: ... + def __iter__(self) -> Iterator[str]: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: ChannelResolveParams.MultiChannelMap) -> bool: ... + def __setitem__(self, arg0: str, arg1: list[Channel]) -> None: ... + + authentication_db: AuthenticationDataBase + channel_alias: CondaURL + current_working_dir: str + custom_channels: ChannelResolveParams.ChannelMap + custom_multichannels: ChannelResolveParams.MultiChannelMap + home_dir: str + platforms: set[str] + def __init__( + self, + platforms: set[str] = ..., + channel_alias: CondaURL = ..., + custom_channels: ChannelResolveParams.ChannelMap = ..., + custom_multichannels: ChannelResolveParams.MultiChannelMap = ..., + authentication_db: AuthenticationDataBase = ..., + home_dir: str = ..., + current_working_dir: str = ..., + ) -> None: ... + def __copy__(self) -> BasicHTTPAuthentication: ... + def __deepcopy__(self, memo: dict) -> BasicHTTPAuthentication: ... + +class ChimeraStringSpec: + def __init__(self) -> None: ... + def contains(self, arg0: str) -> bool: ... + def is_exact(self) -> bool: ... + def is_explicitly_free(self) -> bool: ... + def is_glob(self) -> bool: ... + @staticmethod + def parse(arg0: str) -> ChimeraStringSpec: ... + def __copy__(self) -> ChimeraStringSpec: ... + def __deepcopy__(self, memo: dict) -> ChimeraStringSpec: ... + +class CommonVersion: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, arg0: CommonVersion) -> None: ... + @overload + def __init__(self, arg0: Iterable) -> None: ... + def append(self, x: VersionPart) -> None: ... + def clear(self) -> None: ... + def count(self, x: VersionPart) -> int: ... + @overload + def extend(self, L: CommonVersion) -> None: ... + @overload + def extend(self, L: Iterable) -> None: ... + def insert(self, i: int, x: VersionPart) -> None: ... + @overload + def pop(self) -> VersionPart: ... + @overload + def pop(self, i: int) -> VersionPart: ... + def remove(self, x: VersionPart) -> None: ... + def __bool__(self) -> bool: ... + def __contains__(self, x: VersionPart) -> bool: ... + @overload + def __delitem__(self, arg0: int) -> None: ... + @overload + def __delitem__(self, arg0: slice) -> None: ... + def __eq__(self, arg0: CommonVersion) -> bool: ... + @overload + def __getitem__(self, s: slice) -> CommonVersion: ... + @overload + def __getitem__(self, arg0: int) -> VersionPart: ... + def __iter__(self) -> Iterator[VersionPart]: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: CommonVersion) -> bool: ... + @overload + def __setitem__(self, arg0: int, arg1: VersionPart) -> None: ... + @overload + def __setitem__(self, arg0: slice, arg1: CommonVersion) -> None: ... + +class CondaToken: + token: str + def __init__(self, token: str) -> None: ... + def __copy__(self) -> CondaToken: ... + def __deepcopy__(self, memo: dict) -> CondaToken: ... + def __eq__(self, arg0: CondaToken) -> bool: ... + def __hash__(self) -> int: ... + def __ne__(self, arg0: CondaToken) -> bool: ... + +class CondaURL: + class Credentials: + __members__: ClassVar[dict] = ... # read-only + Hide: ClassVar[CondaURL.Credentials] = ... + Remove: ClassVar[CondaURL.Credentials] = ... + Show: ClassVar[CondaURL.Credentials] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + + def __init__(self) -> None: ... + def append_path(self, path: str, encode: bool = ...) -> None: ... + def authentication(self) -> str: ... + def authority(self) -> str: ... + def clear_host(self) -> str: ... + def clear_package(self) -> bool: ... + def clear_password(self) -> str: ... + def clear_path(self) -> str: ... + def clear_path_without_token(self) -> bool: ... + def clear_platform(self) -> bool: ... + def clear_port(self) -> str: ... + def clear_scheme(self) -> str: ... + def clear_token(self) -> bool: ... + def clear_user(self) -> str: ... + def has_password(self) -> bool: ... + def has_token(self) -> bool: ... + def has_user(self) -> bool: ... + def host(self, decode: bool = ...) -> str: ... + def host_is_defaulted(self) -> bool: ... + def package(self, decode: bool = ...) -> str: ... + @staticmethod + def parse(arg0: str) -> CondaURL: ... + def password(self, decode: bool = ...) -> str: ... + def path(self, decode: bool = ...) -> str: ... + def path_without_token(self, decode: bool = ...) -> str: ... + def platform(self) -> KnownPlatform | None: ... + def port(self) -> str: ... + def pretty_path(self) -> str: ... + def pretty_str( + self, + strip_scheme: bool = ..., + rstrip_path: str = ..., + credentials: CondaURL.Credentials = ..., + ) -> str: ... + def scheme(self) -> str: ... + def scheme_is_defaulted(self) -> bool: ... + def set_host(self, host: str, encode: bool = ...) -> None: ... + def set_package(self, package: str, encode: bool = ...) -> None: ... + def set_password(self, password: str, encode: bool = ...) -> None: ... + def set_path(self, path: str, encode: bool = ...) -> None: ... + def set_path_without_token(self, path_without_token: str, encode: bool = ...) -> None: ... + def set_platform(self, arg0: KnownPlatform) -> None: ... + def set_port(self, arg0: str) -> None: ... + def set_scheme(self, arg0: str) -> None: ... + def set_token(self, arg0: str) -> None: ... + def set_user(self, user: str, encode: bool = ...) -> None: ... + def str(self, credentials: CondaURL.Credentials = ...) -> str: ... + def token(self) -> str: ... + def user(self, decode: bool = ...) -> str: ... + def __copy__(self) -> CondaURL: ... + def __deepcopy__(self, memo: dict) -> CondaURL: ... + def __eq__(self, arg0: CondaURL) -> bool: ... + def __hash__(self) -> int: ... + def __ne__(self, arg0: CondaURL) -> bool: ... + def __truediv__(self, arg0: str) -> CondaURL: ... + +class GlobSpec: + free_pattern: ClassVar[str] = ... # read-only + glob_pattern: ClassVar[str] = ... # read-only + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, spec: str) -> None: ... + def contains(self, arg0: str) -> bool: ... + def is_exact(self) -> bool: ... + def is_free(self) -> bool: ... + def __copy__(self) -> GlobSpec: ... + def __deepcopy__(self, memo: dict) -> GlobSpec: ... + +class ItemsView: + def __init__(self, *args, **kwargs) -> None: ... + def __iter__(self) -> Iterator: ... + def __len__(self) -> int: ... + +class KeysView: + def __init__(self, *args, **kwargs) -> None: ... + def __contains__(self, arg0: object) -> bool: ... + def __iter__(self) -> Iterator: ... + def __len__(self) -> int: ... + +class KnownPlatform: + __members__: ClassVar[dict] = ... # read-only + __entries: ClassVar[dict] = ... + linux_32: ClassVar[KnownPlatform] = ... + linux_64: ClassVar[KnownPlatform] = ... + linux_aarch64: ClassVar[KnownPlatform] = ... + linux_armv6l: ClassVar[KnownPlatform] = ... + linux_armv7l: ClassVar[KnownPlatform] = ... + linux_ppc64: ClassVar[KnownPlatform] = ... + linux_ppc64le: ClassVar[KnownPlatform] = ... + linux_riscv32: ClassVar[KnownPlatform] = ... + linux_riscv64: ClassVar[KnownPlatform] = ... + linux_s390x: ClassVar[KnownPlatform] = ... + noarch: ClassVar[KnownPlatform] = ... + osx_64: ClassVar[KnownPlatform] = ... + osx_arm64: ClassVar[KnownPlatform] = ... + win_32: ClassVar[KnownPlatform] = ... + win_64: ClassVar[KnownPlatform] = ... + win_arm64: ClassVar[KnownPlatform] = ... + zos_z: ClassVar[KnownPlatform] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + @staticmethod + def build_platform() -> KnownPlatform: ... + @staticmethod + def count() -> int: ... + @staticmethod + def parse(arg0: str) -> KnownPlatform | None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class MatchSpec: + BuildStringSpec: ClassVar[type] = ... # read-only + NameSpec: ClassVar[type] = ... # read-only + alt_list_close: ClassVar[str] = ... # read-only + alt_list_open: ClassVar[str] = ... # read-only + alt_quote: ClassVar[str] = ... # read-only + attribute_assign: ClassVar[str] = ... # read-only + attribute_sep: ClassVar[str] = ... # read-only + channel_namespace_spec_sep: ClassVar[str] = ... # read-only + package_version_sep: ClassVar[list] = ... # read-only + preferred_list_close: ClassVar[str] = ... # read-only + preferred_list_open: ClassVar[str] = ... # read-only + preferred_quote: ClassVar[str] = ... # read-only + url_md5_sep: ClassVar[str] = ... # read-only + build_number: Incomplete + build_string: ChimeraStringSpec + channel: UnresolvedChannel | None + features: str + filename: str + license: str + license_family: str + md5: str + name: GlobSpec + name_space: str + optional: bool + platforms: set[str] | None + sha256: str + track_features: set[str] | None + version: VersionSpec + def __init__(self, spec: str) -> None: ... + def conda_build_form(self) -> str: ... + @overload + def contains_except_channel(self, arg0: PackageInfo) -> bool: ... + @overload + def contains_except_channel( + self, + name: str = ..., + version: Version = ..., + build_string: str = ..., + build_number: int = ..., + md5: str = ..., + sha256: str = ..., + license: str = ..., + platform: str = ..., + track_features: set[str] = ..., + ) -> bool: ... + def is_file(self) -> bool: ... + def is_only_package_name(self) -> bool: ... + def is_simple(self) -> bool: ... + @staticmethod + def parse(arg0: str) -> MatchSpec: ... + @staticmethod + def parse_url(arg0: str) -> MatchSpec: ... + def __copy__(self) -> MatchSpec: ... + def __deepcopy__(self, memo: dict) -> MatchSpec: ... + +class NoArchType: + __members__: ClassVar[dict] = ... # read-only + Generic: ClassVar[NoArchType] = ... + No: ClassVar[NoArchType] = ... + Python: ClassVar[NoArchType] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + @staticmethod + def count() -> int: ... + @staticmethod + def parse(arg0: str) -> NoArchType | None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class PackageInfo: + build_number: int + build_string: str + channel: str + constrains: list[str] + defaulted_keys: list[str] + dependencies: list[str] + filename: str + fn: None + license: str + md5: str + name: str + noarch: NoArchType + package_url: str + platform: str + sha256: str + signatures: str + size: int + timestamp: int + track_features: list[str] + url: None + version: str + def __init__( + self, + name: str = ..., + version: str = ..., + build_string: str = ..., + build_number: int = ..., + channel: str = ..., + package_url: str = ..., + platform: str = ..., + filename: str = ..., + license: str = ..., + md5: str = ..., + sha256: str = ..., + signatures: str = ..., + track_features: list[str] = ..., + depends: list[str] = ..., + constrains: list[str] = ..., + defaulted_keys: list[str] = ..., + noarch: NoArchType = ..., + size: int = ..., + timestamp: int = ..., + ) -> None: ... + @staticmethod + def from_url(arg0: str) -> PackageInfo: ... + def __copy__(self) -> PackageInfo: ... + def __deepcopy__(self, memo: dict) -> PackageInfo: ... + def __eq__(self, arg0: PackageInfo) -> bool: ... + def __ne__(self, arg0: PackageInfo) -> bool: ... + +class ParseError(ValueError): ... + +class RegexSpec: + free_pattern: ClassVar[str] = ... # read-only + pattern_end: ClassVar[str] = ... # read-only + pattern_start: ClassVar[str] = ... # read-only + def __init__(self) -> None: ... + def contains(self, arg0: str) -> bool: ... + def is_exact(self) -> bool: ... + def is_explicitly_free(self) -> bool: ... + @staticmethod + def parse(arg0: str) -> RegexSpec: ... + def __copy__(self) -> RegexSpec: ... + def __deepcopy__(self, memo: dict) -> RegexSpec: ... + +class UnresolvedChannel: + class Type: + __members__: ClassVar[dict] = ... # read-only + Name: ClassVar[UnresolvedChannel.Type] = ... + PackagePath: ClassVar[UnresolvedChannel.Type] = ... + PackageURL: ClassVar[UnresolvedChannel.Type] = ... + Path: ClassVar[UnresolvedChannel.Type] = ... + URL: ClassVar[UnresolvedChannel.Type] = ... + Unknown: ClassVar[UnresolvedChannel.Type] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + + def __init__( + self, location: str, platform_filters: set[str], type: UnresolvedChannel.Type = ... + ) -> None: ... + @staticmethod + def parse(arg0: str) -> UnresolvedChannel: ... + def __copy__(self) -> UnresolvedChannel: ... + def __deepcopy__(self, memo: dict) -> UnresolvedChannel: ... + @property + def location(self) -> str: ... + @property + def platform_filters(self) -> set[str]: ... + @property + def type(self) -> UnresolvedChannel.Type: ... + +class ValuesView: + def __init__(self, *args, **kwargs) -> None: ... + def __iter__(self) -> Iterator: ... + def __len__(self) -> int: ... + +class Version: + epoch_delim: ClassVar[str] = ... # read-only + local_delim: ClassVar[str] = ... # read-only + part_delim: ClassVar[str] = ... # read-only + part_delim_alt: ClassVar[str] = ... # read-only + part_delim_special: ClassVar[str] = ... # read-only + def __init__(self, epoch: int = ..., version=..., local=...) -> None: ... + def compatible_with(self, older: Version, level: int) -> bool: ... + @staticmethod + def parse(str: str) -> Version: ... + def starts_with(self, prefix: Version) -> bool: ... + @overload + def str(self) -> str: ... + @overload + def str(self, level: int) -> str: ... + def __copy__(self) -> Version: ... + def __deepcopy__(self, memo: dict) -> Version: ... + def __eq__(self, arg0: Version) -> bool: ... + def __ge__(self, arg0: Version) -> bool: ... + def __gt__(self, arg0: Version) -> bool: ... + def __le__(self, arg0: Version) -> bool: ... + def __lt__(self, arg0: Version) -> bool: ... + def __ne__(self, arg0: Version) -> bool: ... + @property + def epoch(self) -> int: ... + @property + def local(self) -> CommonVersion: ... + @property + def version(self) -> CommonVersion: ... + +class VersionPart: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, arg0: VersionPart) -> None: ... + @overload + def __init__(self, arg0: Iterable) -> None: ... + def append(self, x: VersionPartAtom) -> None: ... + def clear(self) -> None: ... + def count(self, x: VersionPartAtom) -> int: ... + @overload + def extend(self, L: VersionPart) -> None: ... + @overload + def extend(self, L: Iterable) -> None: ... + def insert(self, i: int, x: VersionPartAtom) -> None: ... + @overload + def pop(self) -> VersionPartAtom: ... + @overload + def pop(self, i: int) -> VersionPartAtom: ... + def remove(self, x: VersionPartAtom) -> None: ... + def __bool__(self) -> bool: ... + def __contains__(self, x: VersionPartAtom) -> bool: ... + @overload + def __delitem__(self, arg0: int) -> None: ... + @overload + def __delitem__(self, arg0: slice) -> None: ... + def __eq__(self, arg0: VersionPart) -> bool: ... + @overload + def __getitem__(self, s: slice) -> VersionPart: ... + @overload + def __getitem__(self, arg0: int) -> VersionPartAtom: ... + def __iter__(self) -> Iterator[VersionPartAtom]: ... + def __len__(self) -> int: ... + def __ne__(self, arg0: VersionPart) -> bool: ... + @overload + def __setitem__(self, arg0: int, arg1: VersionPartAtom) -> None: ... + @overload + def __setitem__(self, arg0: slice, arg1: VersionPart) -> None: ... + +class VersionPartAtom: + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, numeral: int, literal: str = ...) -> None: ... + def __copy__(self) -> VersionPartAtom: ... + def __deepcopy__(self, memo: dict) -> VersionPartAtom: ... + def __eq__(self, arg0: VersionPartAtom) -> bool: ... + def __ge__(self, arg0: VersionPartAtom) -> bool: ... + def __gt__(self, arg0: VersionPartAtom) -> bool: ... + def __le__(self, arg0: VersionPartAtom) -> bool: ... + def __lt__(self, arg0: VersionPartAtom) -> bool: ... + def __ne__(self, arg0: VersionPartAtom) -> bool: ... + @property + def literal(self) -> str: ... + @property + def numeral(self) -> int: ... + +class VersionPredicate: + def __init__(self) -> None: ... + def contains(self, arg0: Version) -> bool: ... + @staticmethod + def make_compatible_with(arg0: Version, arg1: int) -> VersionPredicate: ... + @staticmethod + def make_equal_to(arg0: Version) -> VersionPredicate: ... + @staticmethod + def make_free() -> VersionPredicate: ... + @staticmethod + def make_greater(arg0: Version) -> VersionPredicate: ... + @staticmethod + def make_greater_equal(arg0: Version) -> VersionPredicate: ... + @staticmethod + def make_less(arg0: Version) -> VersionPredicate: ... + @staticmethod + def make_less_equal(arg0: Version) -> VersionPredicate: ... + @staticmethod + def make_not_equal_to(arg0: Version) -> VersionPredicate: ... + @staticmethod + def make_not_starts_with(arg0: Version) -> VersionPredicate: ... + @staticmethod + def make_starts_with(arg0: Version) -> VersionPredicate: ... + def str_conda_build(self) -> str: ... + def __copy__(self) -> VersionPredicate: ... + def __deepcopy__(self, memo: dict) -> VersionPredicate: ... + def __eq__(self, arg0: VersionPredicate) -> bool: ... + def __ne__(self, arg0: VersionPredicate) -> bool: ... + +class VersionSpec: + all_free_strs: ClassVar[list] = ... # read-only + and_token: ClassVar[str] = ... # read-only + compatible_str: ClassVar[str] = ... # read-only + equal_str: ClassVar[str] = ... # read-only + glob_suffix_str: ClassVar[str] = ... # read-only + glob_suffix_token: ClassVar[str] = ... # read-only + greater_equal_str: ClassVar[str] = ... # read-only + greater_str: ClassVar[str] = ... # read-only + left_parenthesis_token: ClassVar[str] = ... # read-only + less_equal_str: ClassVar[str] = ... # read-only + less_str: ClassVar[str] = ... # read-only + not_equal_str: ClassVar[str] = ... # read-only + or_token: ClassVar[str] = ... # read-only + preferred_free_str: ClassVar[str] = ... # read-only + right_parenthesis_token: ClassVar[str] = ... # read-only + starts_with_str: ClassVar[str] = ... # read-only + def __init__(self) -> None: ... + def contains(self, point: Version) -> bool: ... + def expression_size(self) -> int: ... + @staticmethod + def from_predicate(pred: VersionPredicate) -> VersionSpec: ... + def is_explicitly_free(self) -> bool: ... + @staticmethod + def parse(str: str) -> VersionSpec: ... + def str_conda_build(self) -> str: ... + def __copy__(self) -> VersionSpec: ... + def __deepcopy__(self, memo: dict) -> VersionSpec: ... + +def archive_extensions(*args, **kwargs): ... +@overload +def has_archive_extension(arg0: str) -> bool: ... +@overload +def has_archive_extension(arg0: os.PathLike) -> bool: ... +@overload +def strip_archive_extension(arg0: str) -> str: ... +@overload +def strip_archive_extension(arg0: os.PathLike) -> os.PathLike: ... diff --git a/libmambapy/src/libmambapy/bindings/utils.pyi b/libmambapy/src/libmambapy/bindings/utils.pyi new file mode 100644 index 000000000..9ccd47c2c --- /dev/null +++ b/libmambapy/src/libmambapy/bindings/utils.pyi @@ -0,0 +1,89 @@ +from typing import ClassVar, overload + +class TextEmphasis: + __members__: ClassVar[dict] = ... # read-only + Blink: ClassVar[TextEmphasis] = ... + Bold: ClassVar[TextEmphasis] = ... + Conceal: ClassVar[TextEmphasis] = ... + Faint: ClassVar[TextEmphasis] = ... + Italic: ClassVar[TextEmphasis] = ... + Reverse: ClassVar[TextEmphasis] = ... + Strikethrough: ClassVar[TextEmphasis] = ... + Underline: ClassVar[TextEmphasis] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... + +class TextRGBColor: + blue: int + green: int + red: int + @overload + def __init__(self) -> None: ... + @overload + def __init__(self, red: int = ..., green: int = ..., blue: int = ...) -> None: ... + def __copy__(self) -> TextRGBColor: ... + def __deepcopy__(self, memo: dict) -> TextRGBColor: ... + +class TextStyle: + @overload + def __init__(self) -> None: ... + @overload + def __init__( + self, + foreground: TextTerminalColor | TextRGBColor | None = ..., + background: TextTerminalColor | TextRGBColor | None = ..., + emphasis: TextEmphasis | None = ..., + ) -> None: ... + def __copy__(self) -> TextStyle: ... + def __deepcopy__(self, memo: dict) -> TextStyle: ... + @property + def background(self) -> TextTerminalColor | TextRGBColor | None: ... + @property + def emphasis(self) -> TextEmphasis | None: ... + @property + def foreground(self) -> TextTerminalColor | TextRGBColor | None: ... + +class TextTerminalColor: + __members__: ClassVar[dict] = ... # read-only + Black: ClassVar[TextTerminalColor] = ... + Blue: ClassVar[TextTerminalColor] = ... + BrightBlack: ClassVar[TextTerminalColor] = ... + BrightBlue: ClassVar[TextTerminalColor] = ... + BrightCyan: ClassVar[TextTerminalColor] = ... + BrightGreen: ClassVar[TextTerminalColor] = ... + BrightMagenta: ClassVar[TextTerminalColor] = ... + BrightRed: ClassVar[TextTerminalColor] = ... + BrightWhite: ClassVar[TextTerminalColor] = ... + BrightYellow: ClassVar[TextTerminalColor] = ... + Cyan: ClassVar[TextTerminalColor] = ... + Green: ClassVar[TextTerminalColor] = ... + Magenta: ClassVar[TextTerminalColor] = ... + Red: ClassVar[TextTerminalColor] = ... + White: ClassVar[TextTerminalColor] = ... + Yellow: ClassVar[TextTerminalColor] = ... + __entries: ClassVar[dict] = ... + @overload + def __init__(self, value: int) -> None: ... + @overload + def __init__(self, arg0: str) -> None: ... + def __eq__(self, other: object) -> bool: ... + def __hash__(self) -> int: ... + def __index__(self) -> int: ... + def __int__(self) -> int: ... + def __ne__(self, other: object) -> bool: ... + @property + def name(self) -> str: ... + @property + def value(self) -> int: ... diff --git a/libmambapy/src/libmambapy/solver/__init__.pyi b/libmambapy/src/libmambapy/solver/__init__.pyi new file mode 100644 index 000000000..9dc586454 --- /dev/null +++ b/libmambapy/src/libmambapy/solver/__init__.pyi @@ -0,0 +1 @@ +from libmambapy.bindings.solver import * diff --git a/libmambapy/src/libmambapy/solver/libsolv.pyi b/libmambapy/src/libmambapy/solver/libsolv.pyi new file mode 100644 index 000000000..371fcf510 --- /dev/null +++ b/libmambapy/src/libmambapy/solver/libsolv.pyi @@ -0,0 +1 @@ +from libmambapy.bindings.solver.libsolv import * diff --git a/libmambapy/src/libmambapy/specs.pyi b/libmambapy/src/libmambapy/specs.pyi new file mode 100644 index 000000000..e64cc0a95 --- /dev/null +++ b/libmambapy/src/libmambapy/specs.pyi @@ -0,0 +1 @@ +from libmambapy.bindings.specs import * diff --git a/libmambapy/src/libmambapy/utils.pyi b/libmambapy/src/libmambapy/utils.pyi new file mode 100644 index 000000000..b4ff730f3 --- /dev/null +++ b/libmambapy/src/libmambapy/utils.pyi @@ -0,0 +1 @@ +from libmambapy.bindings.utils import * diff --git a/libmambapy/src/libmambapy/version.pyi b/libmambapy/src/libmambapy/version.pyi new file mode 100644 index 000000000..d55cc4d8a --- /dev/null +++ b/libmambapy/src/libmambapy/version.pyi @@ -0,0 +1,5 @@ +from _typeshed import Incomplete + +version_info: Incomplete +version_prerelease: str +__version__: Incomplete