Mamba 2.0 Changes#
Command Line Executables#
Mamba (executable)#
mamba
, previously a Python executable mixing libmambapy
, conda
, and code to bridge both
project is being replace by a fully C++ executable based on libmamba
solely.
It now presents the same user interface and experience as micromamba
.
Warning
The previous code being a highly complex project with few of its original developers still active, it is hard to make an exhaustive list of all changes.
Please help us by reporting changes missing changes.
Micromamba#
Micromamba recieves all new features and its CLI remains mostly unchanged.
Breaking changes include:
micromamba shell init
root prefix parameter--prefix
(-p
) was renamed--root-prefix
(-r
). Both options were supported in version1.5
.A new config
order_solver_request
(default true) can be used to order the dependencies passed to the solver, getting order independent solutions.Support for complex match specs such as
pkg[md5=0000000000000]
andpkg[build='^\d*$']
.
Libraries#
Mamba (Python package)#
In version 2.0, all tools are fully written in C++.
All code previously available in Python through import mamba
has been removed.
Libmambapy (Python bindings)#
The Python bindings to the C++ libamamba
library remain available through import libmambapy
.
They are now considered the first class citizen to using Mamba in Python.
Changes inlcude:
The global
Context
, previously available throughContext()
, must now be accessed throughContext.instance()
. What’s more, it is required to be passed explicitly in a few more functions. Future version oflibmambapy
will continue in this direction until there are no global context. In version 2,Context()
will throw an exception to avoid hard to catch errors.ChannelContext
is no longer an implicit global variable. It must be constructed with one ofChannelContext.make_simple
orChannelContext.make_conda_compatible
(withContext.instance
as argument in most cases) and passed explicitly to a few functions.A new
Context
independent submodulelibmambapy.specs
has been introduced with:The redesign of the
Channel
and a newUnresolvedChannel
used to describe unresolved channel strings. A featurefullibmambapy.specs.CondaURL
is used to describe channel URLs.The redesign of
MatchSpec
. The module also includes a platform enumeration, an implementation of orderedVersion
, and aVersionSpec
to match versions.PackageInfo
has been moved to this submodule. Some attributes have been given a more explicit namefn
>filename
,url
>package_url
.
A new
Context
independent submodulelibmambapy.solver
has been introduced with the changes below. A usage documentation page is available at Solving Package Environments.The redesign of the
Pool
, which is now available aslibmambapy.solver.libsolv.Database
. The new interfaces makes it easier to create repositories without using otherlibmambapy
objects.Repo
has been redesigned into a lightweightRepoInfo
and moved tolibmambapy.solver.libsolv
. The creation and modification of repos happens through theDatabase
, with methods such asDatabase.add_repo_from_repodata_json
andDatabase.add_repo_from_packages
, but also high-level free functions such asload_subdir_in_database
andload_installed_packages_in_database
.The
Solver
has been moved tolibmambapy.solver.libsolv.Solver
.All jobs, pins, and flags must be passed as a single
libmambapy.solver.Request
.The outcome of solving the request is either a
libmambapy.solver.Solution
or alibmambapy.solver.libsolv.Unsolvable
state from which rich error messages can be extracted.
For many changes, an exception throwing placeholder has ben kept to advise developpers on the new direction to take.
Libmamba (C++)#
The C++ library libmamba
has received significant changes.
Due to the low usage of the C++ interface, all changes are not listed here.
The main changes are:
Refactoring and testing of a large number of utilities into a
util::
namespace,Creation of the
specs::
the items below. A usage documentation (in Python) is available at Describing Conda Objects.Implementations of
Version
andVersionSpec
for matching versions,A refactoring of a purely funcitonal
Channel
class,Implementaiton of a
UnresolvedChannel
to describe unresolvedChannels
,A refactored and complete implementation of
MatchSpec
using the components above.
A cleanup of
ChannelContext
for be a light proxy and parameter holder wrapping thespecs::Channel
.A new
repodata.json
parser using simdjson.The
MPool
,MRepo
andMSolver
API has been completely redesigned into asolver
subnamespace and works independently of theContext
. Thesolver::libsolv
sub-namespace has also been added for full isolation of libsolv, and a solver API withoutContext
. Thesolver
API redesign includes the items below. A usage documentation (in Python) is available at Solving Package Environments.A refactoring of the
MPool
as aDataBase
, fully isolates libsolv, and simplifies repository creation.A refactoring and thinning of
MRepo
as a newRepoInfo
.A solver
Request
with all requirements to solve is the new way to specify jobs.A refactoring of
Solver
.A solver outcome as either a
Solution
or anUnSolvable
state.
Plug of the Mamba’s
MatchSpec
implementation in theSolver
, enabling the solving of all types of previously unsupported MatchSpecs.Improved downloaders.