From 7f98f5dbc9a25931a78b227af7ef6ddaacf88b5a Mon Sep 17 00:00:00 2001 From: Johan Mabille Date: Wed, 5 Jul 2023 18:53:15 +0200 Subject: [PATCH] Call init_console in mamba to prevent UTF8 errors when extracting packages --- libmambapy/libmambapy/__init__.pyi | 422 ++++++++--------------------- libmambapy/src/main.cpp | 3 + mamba/mamba/mamba.py | 2 + 3 files changed, 120 insertions(+), 307 deletions(-) diff --git a/libmambapy/libmambapy/__init__.pyi b/libmambapy/libmambapy/__init__.pyi index 72541a2b8a..534320521b 100644 --- a/libmambapy/libmambapy/__init__.pyi +++ b/libmambapy/libmambapy/__init__.pyi @@ -123,16 +123,15 @@ __all__ = [ "ostream_redirect", "sign", "simplify_conflicts", - "transmute", + "transmute" ] -class Channel: + +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.List[typing.Tuple[str, str]]: ... + def platform_urls(self, with_credentials: bool = True) -> typing.List[typing.Tuple[str, str]]: ... def urls(self, with_credentials: bool = True) -> typing.List[str]: ... @property def auth(self) -> typing.Optional[str]: @@ -175,8 +174,7 @@ class Channel: :type: typing.Optional[str] """ pass - -class ChannelPriority: +class ChannelPriority(): """ Members: @@ -186,7 +184,6 @@ class ChannelPriority: kDisabled """ - def __eq__(self, other: object) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -206,14 +203,13 @@ class ChannelPriority: """ :type: int """ - __members__: dict # value = {'kFlexible': , 'kStrict': , 'kDisabled': } - kDisabled: libmambapy.bindings.ChannelPriority # value = - kFlexible: libmambapy.bindings.ChannelPriority # value = - kStrict: libmambapy.bindings.ChannelPriority # value = + __members__: dict # value = {'kFlexible': , 'kStrict': , 'kDisabled': } + kDisabled: libmambapy.bindings.ChannelPriority # value = + kFlexible: libmambapy.bindings.ChannelPriority # value = + kStrict: libmambapy.bindings.ChannelPriority # value = pass - -class CompressedProblemsGraph: - class ConflictMap: +class CompressedProblemsGraph(): + class ConflictMap(): def __bool__(self) -> bool: ... def __contains__(self, arg0: int) -> bool: ... def __init__(self) -> None: ... @@ -225,163 +221,70 @@ class CompressedProblemsGraph: def has_conflict(self, arg0: int) -> bool: ... def in_conflict(self, arg0: int, arg1: int) -> bool: ... pass - - class ConstraintListNode: + 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 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]: ... + 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: + 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 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]: ... + 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: + 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 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]: ... + 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: + class RootNode(): def __init__(self) -> None: ... pass - - class UnresolvedDependencyListNode: + 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 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]: ... + 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: ... + 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 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 Context: - class OutputParams: +class Context(): + class OutputParams(): def __init__(self) -> None: ... @property def json(self) -> bool: @@ -408,8 +311,7 @@ class Context: def verbosity(self, arg0: int) -> None: pass pass - - class PrefixParams: + class PrefixParams(): def __init__(self) -> None: ... @property def conda_prefix(self) -> Path: @@ -436,8 +338,7 @@ class Context: def target_prefix(self, arg0: Path) -> None: pass pass - - class RemoteFetchParams: + class RemoteFetchParams(): def __init__(self) -> None: ... @property def connect_timeout_secs(self) -> int: @@ -488,8 +389,7 @@ class Context: def user_agent(self, arg0: str) -> None: pass pass - - class ThreadsParams: + class ThreadsParams(): def __init__(self) -> None: ... @property def download_threads(self) -> int: @@ -816,14 +716,12 @@ class Context: def verbosity(self, arg1: int) -> None: pass pass - -class DownloadTargetList: +class DownloadTargetList(): def __init__(self) -> None: ... def add(self, arg0: SubdirData) -> None: ... def download(self, arg0: int) -> bool: ... pass - -class ExtraPkgInfo: +class ExtraPkgInfo(): def __init__(self) -> None: ... @property def noarch(self) -> str: @@ -842,13 +740,11 @@ class ExtraPkgInfo: def repo_url(self, arg0: str) -> None: pass pass - -class History: +class History(): def __init__(self, arg0: Path) -> None: ... def get_requested_specs_map(self) -> typing.Dict[str, MatchSpec]: ... pass - -class Key: +class Key(): @staticmethod def from_ed25519(arg0: str) -> Key: ... @property @@ -881,8 +777,7 @@ class Key: def scheme(self, arg0: str) -> None: pass pass - -class RoleBase: +class RoleBase(): def all_keys(self) -> typing.Dict[str, RoleFullKeys]: ... @property def expired(self) -> bool: @@ -915,12 +810,10 @@ class RoleBase: :type: int """ pass - -class LockFile: +class LockFile(): def __init__(self, arg0: Path) -> None: ... pass - -class LogLevel: +class LogLevel(): """ Members: @@ -938,7 +831,6 @@ class LogLevel: OFF """ - def __eq__(self, other: object) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -958,28 +850,25 @@ class LogLevel: """ :type: int """ - CRITICAL: libmambapy.bindings.LogLevel # value = - DEBUG: libmambapy.bindings.LogLevel # value = - ERROR: libmambapy.bindings.LogLevel # value = - INFO: libmambapy.bindings.LogLevel # value = - OFF: libmambapy.bindings.LogLevel # value = - TRACE: libmambapy.bindings.LogLevel # value = - WARNING: libmambapy.bindings.LogLevel # value = - __members__: dict # value = {'TRACE': , 'DEBUG': , 'INFO': , 'WARNING': , 'ERROR': , 'CRITICAL': , 'OFF': } + CRITICAL: libmambapy.bindings.LogLevel # value = + DEBUG: libmambapy.bindings.LogLevel # value = + ERROR: libmambapy.bindings.LogLevel # value = + INFO: libmambapy.bindings.LogLevel # value = + OFF: libmambapy.bindings.LogLevel # value = + TRACE: libmambapy.bindings.LogLevel # value = + WARNING: libmambapy.bindings.LogLevel # value = + __members__: dict # value = {'TRACE': , 'DEBUG': , 'INFO': , 'WARNING': , 'ERROR': , 'CRITICAL': , 'OFF': } pass - class MambaNativeException(Exception, BaseException): pass - -class MatchSpec: +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: +class MultiPackageCache(): def __init__(self, arg0: typing.List[Path]) -> None: ... def get_tarball_path(self, arg0: PackageInfo, arg1: bool) -> Path: ... @property @@ -988,14 +877,11 @@ class MultiPackageCache: :type: Path """ pass - -class PackageInfo: +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: ... + def __init__(self, name: str, version: str, build_string: str, build_number: int) -> None: ... @property def build_number(self) -> int: """ @@ -1077,14 +963,6 @@ class PackageInfo: 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 @@ -1149,22 +1027,19 @@ class PackageInfo: def version(self, arg0: str) -> None: pass pass - -class Path: +class Path(): def __init__(self, arg0: str) -> None: ... def __repr__(self) -> str: ... def __str__(self) -> str: ... pass - -class RoleBaseExtension: +class RoleBaseExtension(): @property def timestamp(self) -> str: """ :type: str """ pass - -class Pool: +class Pool(): def __init__(self) -> None: ... def create_whatprovides(self) -> None: ... def id2pkginfo(self, id: int) -> typing.Optional[PackageInfo]: ... @@ -1175,8 +1050,7 @@ class Pool: def select_solvables(self, id: int, sorted: bool = False) -> typing.List[int]: ... def set_debuglevel(self) -> None: ... pass - -class PrefixData: +class PrefixData(): def __init__(self, arg0: Path) -> None: ... def add_packages(self, arg0: typing.List[PackageInfo]) -> None: ... @property @@ -1185,50 +1059,30 @@ class PrefixData: :type: typing.Dict[str, PackageInfo] """ pass - -class ProblemsGraph: - class ConflictMap: +class ProblemsGraph(): + class ConflictMap(): pass - class ConstraintNode(MatchSpec): pass - class PackageNode(PackageInfo): pass - - class RootNode: + 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 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: +class Query(): def __init__(self, arg0: Pool) -> None: ... def depends(self, arg0: str, arg1: QueryFormat) -> str: ... def find(self, arg0: str, arg1: QueryFormat) -> str: ... def whoneeds(self, arg0: str, arg1: QueryFormat) -> str: ... pass - -class QueryFormat: +class QueryFormat(): """ Members: @@ -1242,7 +1096,6 @@ class QueryFormat: RECURSIVETABLE """ - def __eq__(self, other: object) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -1262,15 +1115,14 @@ class QueryFormat: """ :type: int """ - JSON: libmambapy.bindings.QueryFormat # value = - PRETTY: libmambapy.bindings.QueryFormat # value = - RECURSIVETABLE: libmambapy.bindings.QueryFormat # value = - TABLE: libmambapy.bindings.QueryFormat # value = - TREE: libmambapy.bindings.QueryFormat # value = - __members__: dict # value = {'JSON': , 'TREE': , 'TABLE': , 'PRETTY': , 'RECURSIVETABLE': } + JSON: libmambapy.bindings.QueryFormat # value = + PRETTY: libmambapy.bindings.QueryFormat # value = + RECURSIVETABLE: libmambapy.bindings.QueryFormat # value = + TABLE: libmambapy.bindings.QueryFormat # value = + TREE: libmambapy.bindings.QueryFormat # value = + __members__: dict # value = {'JSON': , 'TREE': , 'TABLE': , 'PRETTY': , 'RECURSIVETABLE': } pass - -class Repo: +class Repo(): @typing.overload def __init__(self, arg0: Pool, arg1: str, arg2: str, arg3: str) -> None: ... @typing.overload @@ -1283,16 +1135,13 @@ class Repo: 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: +class RoleFullKeys(): @typing.overload def __init__(self) -> None: ... @typing.overload @@ -1314,20 +1163,15 @@ class RoleFullKeys: 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: +class RootRole(): pass - -class Solver: - def __init__( - self, arg0: Pool, arg1: typing.List[typing.Tuple[int, int]] - ) -> None: ... +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: ... @@ -1339,14 +1183,11 @@ class Solver: 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 set_postsolve_flags(self, arg0: typing.List[typing.Tuple[int, int]]) -> None: ... def solve(self) -> bool: ... def try_solve(self) -> bool: ... pass - -class SolverProblem: +class SolverProblem(): def __str__(self) -> str: ... @property def dep(self) -> typing.Optional[str]: @@ -1413,8 +1254,7 @@ class SolverProblem: def type(self, arg0: SolverRuleinfo) -> None: pass pass - -class SolverRuleinfo: +class SolverRuleinfo(): """ Members: @@ -1476,7 +1316,6 @@ class SolverRuleinfo: SOLVER_RULE_STRICT_REPO_PRIORITY """ - def __eq__(self, other: object) -> bool: ... def __getstate__(self) -> int: ... def __hash__(self) -> int: ... @@ -1496,57 +1335,49 @@ class SolverRuleinfo: """ :type: int """ - SOLVER_RULE_BEST: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_BLACK: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_CHOICE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_DISTUPGRADE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_FEATURE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_INFARCH: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB_UNKNOWN_PACKAGE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_JOB_UNSUPPORTED: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_LEARNT: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_CONFLICTS: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_CONSTRAINS: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_INSTALLED_OBSOLETES: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_NOT_INSTALLABLE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_OBSOLETES: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_RECOMMENDS: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_REQUIRES: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_SAME_NAME: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_PKG_SELF_CONFLICT: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_RECOMMENDS: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_STRICT_REPO_PRIORITY: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_UNKNOWN: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_UPDATE: libmambapy.bindings.SolverRuleinfo # value = - SOLVER_RULE_YUMOBS: libmambapy.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': } + SOLVER_RULE_BEST: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_BLACK: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_CHOICE: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_DISTUPGRADE: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_FEATURE: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_INFARCH: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_JOB: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_JOB_UNKNOWN_PACKAGE: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_JOB_UNSUPPORTED: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_LEARNT: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_CONFLICTS: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_CONSTRAINS: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_INSTALLED_OBSOLETES: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_NOT_INSTALLABLE: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_OBSOLETES: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_RECOMMENDS: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_REQUIRES: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_SAME_NAME: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_PKG_SELF_CONFLICT: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_RECOMMENDS: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_STRICT_REPO_PRIORITY: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_UNKNOWN: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_UPDATE: libmambapy.bindings.SolverRuleinfo # value = + SOLVER_RULE_YUMOBS: libmambapy.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: +class SpecBase(): pass - class SpecImpl(SpecBase): def __init__(self) -> None: ... pass - -class SubdirData: - def __init__( - self, arg0: Channel, arg1: str, arg2: str, arg3: MultiPackageCache, arg4: str - ) -> None: ... +class SubdirData(): + def __init__(self, arg0: Channel, arg1: str, arg2: str, arg3: MultiPackageCache, arg4: str) -> None: ... def cache_path(self) -> str: ... def create_repo(self, arg0: Pool) -> Repo: ... - def download_and_check_targets(self, arg0: DownloadTargetList) -> bool: ... - def finalize_checks(self) -> None: ... def loaded(self) -> bool: ... pass - -class Transaction: +class Transaction(): @typing.overload def __init__(self, arg0: Solver, arg1: MultiPackageCache) -> None: ... @typing.overload @@ -1557,56 +1388,33 @@ class Transaction: 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]], - ]: ... + 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 ostream_redirect: +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() -> None: pass - def clean(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() -> typing.List[PackageInfo]: pass - def sign(data: str, secret_key: str) -> str: pass - def simplify_conflicts(arg0: ProblemsGraph) -> ProblemsGraph: pass - -def transmute( - source_package: Path, - destination_package: Path, - compression_level: int, - compression_threads: int = 1, -) -> bool: +def transmute(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 diff --git a/libmambapy/src/main.cpp b/libmambapy/src/main.cpp index d08d7d2567..486e01948d 100644 --- a/libmambapy/src/main.cpp +++ b/libmambapy/src/main.cpp @@ -30,6 +30,7 @@ #include "mamba/core/subdirdata.hpp" #include "mamba/core/transaction.hpp" #include "mamba/core/url.hpp" +#include "mamba/core/util_os.hpp" #include "mamba/core/util_string.hpp" #include "mamba/core/validate.hpp" #include "mamba/core/virtual_packages.hpp" @@ -1004,6 +1005,8 @@ PYBIND11_MODULE(bindings, m) py::arg("compression_threads") = 1 ); + m.def("init_console", &init_console); + // fix extract from error_handling first // auto package_handling_sm = m.def_submodule("package_handling"); // package_handling_sm.def("extract", &extract); diff --git a/mamba/mamba/mamba.py b/mamba/mamba/mamba.py index 43ae8fc3c0..af3f6c4860 100644 --- a/mamba/mamba/mamba.py +++ b/mamba/mamba/mamba.py @@ -226,6 +226,8 @@ def install(args, parser, command="install"): context.validate_configuration() check_non_admin() + api.init_console() + init_api_context(use_mamba_experimental) newenv = bool(command == "create")