mirror of https://github.com/mamba-org/mamba.git
Add checking typos to pre-commit (#3278)
* Add checking typos to pre-commit * Add missed corrections * Add more corrections to doc
This commit is contained in:
parent
9006fb963b
commit
3e1e97b0e6
|
@ -43,3 +43,11 @@ repos:
|
|||
rev: v0.6.13
|
||||
hooks:
|
||||
- id: cmake-format
|
||||
- repo: https://github.com/Quantco/pre-commit-mirrors-typos
|
||||
rev: 1.20.8
|
||||
hooks:
|
||||
- id: typos-conda
|
||||
exclude: (CHANGELOG.md)
|
||||
# In case of ambiguity (multiple possible corrections), `typos` will just report it to the user and move on without applying/writing any changes.
|
||||
# cf. https://github.com/crate-ci/typos
|
||||
args: [ --write-changes ]
|
||||
|
|
|
@ -266,7 +266,7 @@ tasks:
|
|||
desc: Regenerate libmambapy typing stubs.
|
||||
summary: |
|
||||
Regenerate the stub `*.pyi` stubs files providing Python typing information.
|
||||
If this command creates any changes, the modifications needs to be commited.
|
||||
If this command creates any changes, the modifications needs to be committed.
|
||||
deps: [install-py]
|
||||
cmds:
|
||||
- '{{.TEST_RUN}} python -m pybind11_stubgen -o "{{.BUILD_DIR}}/stubs" libmambapy.core.bindings'
|
||||
|
@ -315,7 +315,7 @@ tasks:
|
|||
clean:
|
||||
desc: Remove files generated by Task commands.
|
||||
summary: |
|
||||
Remove files generated by Task commnds. Some files and folder generated by tools may still
|
||||
Remove files generated by Task commands. Some files and folder generated by tools may still
|
||||
remain. To entirely clean the repository, run:
|
||||
|
||||
git clean -xdn
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
[default.extend-words]
|
||||
# False positives to ignore
|
||||
eit = "eit"
|
||||
pn = "pn"
|
||||
Ome = "Ome"
|
||||
haa = "haa"
|
||||
"fo" = "fo"
|
|
@ -27,7 +27,7 @@ function(mamba_target_add_compile_warnings target)
|
|||
/external:W1
|
||||
# Baseline reasonable warnings
|
||||
/W4
|
||||
# "identfier": conversion from "type1" to "type1", possible loss of data
|
||||
# "identifier": conversion from "type1" to "type1", possible loss of data
|
||||
/w14242
|
||||
# "operator": conversion from "type1:field_bits" to "type2:field_bits", possible loss of
|
||||
# data
|
||||
|
@ -117,7 +117,7 @@ function(mamba_target_add_compile_warnings target)
|
|||
set(
|
||||
gcc_warnings
|
||||
${clang_warnings}
|
||||
# Warn if identation implies blocks where blocks do not exist
|
||||
# Warn if indentation implies blocks where blocks do not exist
|
||||
-Wmisleading-indentation
|
||||
# Warn if if / else chain has duplicated conditions
|
||||
-Wduplicated-cond
|
||||
|
|
|
@ -4,7 +4,7 @@ include(CheckIPOSupported)
|
|||
|
||||
# Detect is setting Link Time Optimization is recommended.
|
||||
#
|
||||
# Currenlty checks if LTO is supported and if the build is a release.
|
||||
# Currently checks if LTO is supported and if the build is a release.
|
||||
function(mamba_should_lto)
|
||||
# Names of option parameters (without arguments)
|
||||
set(options)
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
"CMAKE_C_COMPILER_LAUNCHER": "ccache",
|
||||
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON"
|
||||
},
|
||||
"description": "Extra convenience flags used when developping",
|
||||
"description": "Extra convenience flags used when developing",
|
||||
"displayName": "Mamba Dev",
|
||||
"hidden": true,
|
||||
"name": "mamba-dev",
|
||||
|
|
|
@ -26,7 +26,7 @@ In the Mamba's context, it may points to a packages server, a :ref:`channel<chan
|
|||
Channel
|
||||
-------
|
||||
|
||||
| A ``channel`` is an independant and isolated :ref:`repo<repo>` structure that is used to classify and administrate more easily a packages server.
|
||||
| A ``channel`` is an independent and isolated :ref:`repo<repo>` structure that is used to classify and administrate more easily a packages server.
|
||||
|
||||
.. note::
|
||||
A packages server may host one or multiple ``channels``.
|
||||
|
@ -39,7 +39,7 @@ Subdir
|
|||
|
||||
| A ``subdir`` is a :ref:`channel<channel>` subdirectory specific to a given operating system/platform pair.
|
||||
|
||||
Mamba is a general purpose, langage agnostic package manager. The ``subdir`` structure is a convenient way to provide and access packages depending on the targeted os and platform.
|
||||
Mamba is a general purpose, language agnostic package manager. The ``subdir`` structure is a convenient way to provide and access packages depending on the targeted os and platform.
|
||||
|
||||
Typically ``linux-64``, ``osx-arm64`` or ``win-64`` but not limited to those ones.
|
||||
|
||||
|
@ -96,7 +96,7 @@ The 3 kinds of *links* are:
|
|||
|
||||
The advanced user may want to change that behavior using configuration (see the relevant CLI or API reference for more details):
|
||||
|
||||
- allow ``soft-links`` to be used as a prefered fallback to ``copy`` (try to ``copy`` if ``soft-link`` fails)
|
||||
- allow ``soft-links`` to be used as a preferred fallback to ``copy`` (try to ``copy`` if ``soft-link`` fails)
|
||||
- use ``soft-links`` instead of ``hard-links`` as default behavior (``copy`` is still a fallback)
|
||||
- always ``copy`` instead of ``hard-links`` as default behavior (no fallback then)
|
||||
|
||||
|
@ -110,7 +110,7 @@ Hard-link
|
|||
*********
|
||||
|
||||
| A ``hard-link`` is the relation between a name/path and the actual file located on the file system.
|
||||
| It is often used to describe additional ``hard-links`` pointed the same file, but the ownership of the file is shared accross all those links (equivalent to a C++ shared pointer):
|
||||
| It is often used to describe additional ``hard-links`` pointed the same file, but the ownership of the file is shared across all those links (equivalent to a C++ shared pointer):
|
||||
|
||||
- a reference counter is incremented when creating a new ``hard-link``, decremented when deleting one
|
||||
- the file system location is freed only when that counter decreases to 0
|
||||
|
@ -133,7 +133,7 @@ This is the most efficient way to link:
|
|||
There are some limitations to use ``hard-links``:
|
||||
|
||||
- all the file systems are not supporting such links
|
||||
- those links are not working accross file systems/partitions
|
||||
- those links are not working across file systems/partitions
|
||||
|
||||
|
||||
.. _soft_link:
|
||||
|
@ -145,7 +145,7 @@ Soft-link
|
|||
|
||||
It is as efficient as a ``hard-link`` but has different properties:
|
||||
|
||||
- works accross a filesystem/partition boundaries
|
||||
- works across a filesystem/partition boundaries
|
||||
- becomes invalid then the pointed name is deleted or moved (no shared ownership)
|
||||
|
||||
|
||||
|
|
|
@ -61,4 +61,4 @@ For this example the default is the cpython build of numpy. However, currently c
|
|||
|
||||
For the case where we want to simply install ``numpy``, we need to find which numpy variant installs the highest python package. In this case libsolv would decide for ``numpy-1.20-cpython38``.
|
||||
|
||||
If we install ``numpy python=3.7`` we have two potential variants: ``numpy-1.20-cpython37`` and ``numpy-1.20-pypy37``. In this case we need to inspect wether one of those two builds will require exclusively packages with a track_feature applied. And indeed, the ``pypy37`` package will have a requirement on ``python_abi 3.7 *pypy`` and **all** packages matching this requirement have a track_feature, so that it will be down-weighted.
|
||||
If we install ``numpy python=3.7`` we have two potential variants: ``numpy-1.20-cpython37`` and ``numpy-1.20-pypy37``. In this case we need to inspect whether one of those two builds will require exclusively packages with a track_feature applied. And indeed, the ``pypy37`` package will have a requirement on ``python_abi 3.7 *pypy`` and **all** packages matching this requirement have a track_feature, so that it will be down-weighted.
|
||||
|
|
|
@ -28,7 +28,7 @@ It now presents the same user interface and experience as ``micromamba``.
|
|||
|
||||
Micromamba
|
||||
**********
|
||||
Micromamba recieves all new features and its CLI remains mostly unchanged.
|
||||
Micromamba receives all new features and its CLI remains mostly unchanged.
|
||||
|
||||
Breaking changes include:
|
||||
|
||||
|
@ -51,15 +51,15 @@ All code previously available in Python through ``import mamba`` has been remove
|
|||
|
||||
Libmambapy (Python bindings)
|
||||
****************************
|
||||
The Python bindings to the C++ ``libamamba`` library remain available through ``import libmambapy``.
|
||||
The Python bindings to the C++ ``libmamba`` library remain available through ``import libmambapy``.
|
||||
They are now considered the first class citizen to using Mamba in Python.
|
||||
Changes inlcude:
|
||||
Changes include:
|
||||
|
||||
- The global ``Context``, previously available through ``Context()``, must now be accessed through
|
||||
``Context.instance()``.
|
||||
What's more, it is required to be passed explicitly in a few more functions.
|
||||
Future version of ``libmambapy`` 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.
|
||||
In version 2, ``Context()`` will throw an exception to allow catching errors more smoothly.
|
||||
- ``ChannelContext`` is no longer an implicit global variable.
|
||||
It must be constructed with one of ``ChannelContext.make_simple`` or
|
||||
``ChannelContext.make_conda_compatible`` (with ``Context.instance`` as argument in most cases)
|
||||
|
@ -81,11 +81,11 @@ Changes inlcude:
|
|||
A usage documentation page is available at :ref:`mamba_usage_solver`.
|
||||
|
||||
- The redesign of the ``Pool``, which is now available as ``libmambapy.solver.libsolv.Database``.
|
||||
The new interfaces makes it easier to create repositories without using other ``libmambapy``
|
||||
The new interfaces make it easier to create repositories without using other ``libmambapy``
|
||||
objects.
|
||||
- ``Repo`` has been redesigned into a lightweight ``RepoInfo`` and moved to
|
||||
``libmambapy.solver.libsolv``.
|
||||
The creation and modification of repos happens through the ``Database``, with methods such as
|
||||
The creation and modification of repos happen through the ``Database``, with methods such as
|
||||
``Database.add_repo_from_repodata_json`` and ``Database.add_repo_from_packages``, but also
|
||||
high-level free functions such as ``load_subdir_in_database`` and
|
||||
``load_installed_packages_in_database``.
|
||||
|
@ -96,7 +96,7 @@ Changes inlcude:
|
|||
``libmambapy.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
|
||||
For many changes, an exception throwing placeholders has been kept to advise developers on the new
|
||||
direction to take.
|
||||
|
||||
Libmamba (C++)
|
||||
|
@ -105,16 +105,16 @@ 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.
|
||||
- Refactoring and testing of a large number of utilities into a ``util::`` namespace.
|
||||
- Creation of ``specs::`` including the items below.
|
||||
A usage documentation (in Python) is available at :ref:`mamba_usage_specs`.
|
||||
|
||||
- Implementations of ``Version`` and ``VersionSpec`` for matching versions,
|
||||
- A refactoring of a purely funcitonal ``Channel`` class,
|
||||
- Implementaiton of a ``UnresolvedChannel`` to describe unresolved ``Channels``,
|
||||
- A refactoring of a purely functional ``Channel`` class,
|
||||
- Implementation of a ``UnresolvedChannel`` to describe unresolved ``Channels``,
|
||||
- A refactored and complete implementation of ``MatchSpec`` using the components above.
|
||||
|
||||
- A cleanup of ``ChannelContext`` for be a light proxy and parameter holder wrapping the
|
||||
- A cleanup of ``ChannelContext`` to be a light proxy and parameter holder wrapping the
|
||||
``specs::Channel``.
|
||||
- A new ``repodata.json`` parser using `simdjson <https://simdjson.org/>`_.
|
||||
- The ``MPool``, ``MRepo`` and ``MSolver`` API has been completely redesigned into a ``solver``
|
||||
|
|
|
@ -301,7 +301,7 @@ Watches
|
|||
|
||||
The possible decisions on solvables are ``installation`` or ``removal``/``conflict``, this is stored as resp. positive and negative Ids.
|
||||
|
||||
Related rules are then evaluated during another level of decision: those are the one with an opposite first litteral.
|
||||
Related rules are then evaluated during another level of decision: those are the one with an opposite first literal.
|
||||
|
||||
Example:
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ Build from source
|
|||
|
||||
.. note::
|
||||
|
||||
These instuction do not work currently on Windows, which requires a more complex hybrid build.
|
||||
These instructions do not work currently on Windows, which requires a more complex hybrid build.
|
||||
For up-to-date instructions on Windows and Unix, consult the scripts in the
|
||||
`micromamba-feedstock <https://github.com/conda-forge/micromamba-feedstock>`_.
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ https://github.com/mgaitan/sphinxcontrib-mermaid
|
|||
Modified for the purpose of CoSApp by the CoSApp team
|
||||
https://gitlab.com/cosapp/cosapp
|
||||
|
||||
Allow mermaid diagramas to be included in Sphinx-generated
|
||||
Allow mermaid diagrams to be included in Sphinx-generated
|
||||
documents inline.
|
||||
|
||||
:copyright: Copyright 2016 by Martín Gaitán and others, see AUTHORS.
|
||||
|
|
|
@ -31,8 +31,8 @@ Packages are organised in repositories, described by a
|
|||
This serves to resolve explicit channel requirements or channel priority.
|
||||
As such, the database constructor takes a set of
|
||||
:cpp:type:`ChannelResolveParams <mamba::specs::ChannelResolveParams>`
|
||||
to work with :cpp:type:`Channel <mamba::specs::Channel>` work with Channel data
|
||||
internaly (see :ref:`the usage section on Channels <libmamba_usage_channel>` for more
|
||||
to work with :cpp:type:`Channel <mamba::specs::Channel>` data
|
||||
internally (see :ref:`the usage section on Channels <libmamba_usage_channel>` for more
|
||||
information).
|
||||
|
||||
The first way to add a repository is from a list of |PackageInfo| using
|
||||
|
@ -55,10 +55,10 @@ The first way to add a repository is from a list of |PackageInfo| using
|
|||
name="myrepo",
|
||||
)
|
||||
|
||||
The second way of loading packages is throuch Conda's reposoitory index format ``repodata.json``
|
||||
The second way of loading packages is through Conda's repository index format ``repodata.json``
|
||||
using
|
||||
:cpp:func:`DataBase.add_repo_from_repodata <mamba::solver::libsolv::Database::add_repo_from_repodata>`.
|
||||
This is meant as a convenience and performant alternative to the former method, since these files
|
||||
This is meant for convenience, and is not a performant alternative to the former method, since these files
|
||||
grow large.
|
||||
|
||||
.. code:: python
|
||||
|
@ -68,9 +68,9 @@ grow large.
|
|||
url="htts://conda.anaconda.org/conda-forge/linux-64",
|
||||
)
|
||||
|
||||
One of the reppository can be set to have a special meaning of "installed repository".
|
||||
One of the repositories can be set to have a special meaning of "installed repository".
|
||||
It is used as a reference point in the solver to compute changes.
|
||||
For instance if a package is required but is already available in the installed repo, the solving
|
||||
For instance, if a package is required but is already available in the installed repo, the solving
|
||||
result will not mention it.
|
||||
The function
|
||||
:cpp:func:`DataBase.set_installed_repo <mamba::solver::libsolv::Database::set_installed_repo>` is
|
||||
|
@ -88,9 +88,9 @@ such as source url and
|
|||
:cpp:type:`RepodataOrigin <mamba::solver::libsolv::RepodataOrigin>`, are stored inside the
|
||||
file when calling
|
||||
:cpp:func:`DataBase.native_serialize_repo <mamba::solver::libsolv::Database::native_serialize_repo>` .
|
||||
Upon reading, similar parameters are expected as input to
|
||||
Upon reading, similar parameters are expected as inputs to
|
||||
:cpp:func:`DataBase.add_repo_from_native_serialization <mamba::solver::libsolv::Database::add_repo_from_native_serialization>`.
|
||||
If they mistmatch, the loading results in an error.
|
||||
If they mismatch, the loading results in an error.
|
||||
|
||||
A typical wokflow first tries to load a repository from such binary cache, and then quietly
|
||||
fallbacks to ``repodata.json`` on failure.
|
||||
|
@ -120,7 +120,7 @@ This includes installing, updating, removing packages, as well as solving cutomi
|
|||
Solving the request
|
||||
-------------------
|
||||
The |Request| and the |Database| are the two input parameters needed to solve an environment.
|
||||
This task is achieve with the :cpp:func:`Solver.solve <mamba::solver::libsolv::Solver::solve>`
|
||||
This task is achieved with the :cpp:func:`Solver.solve <mamba::solver::libsolv::Solver::solve>`
|
||||
method.
|
||||
|
||||
.. code:: python
|
||||
|
@ -129,8 +129,8 @@ method.
|
|||
outcome = solver.solve(db, request)
|
||||
|
||||
The outcome can be of two types, either a |Solution| listing packages (|Packageinfo|) and the
|
||||
action to take on them (install, remove...), or an |UnSolvable| type when no solution exist
|
||||
(because of conflict, missing pacakges...).
|
||||
action to take on them (install, remove...), or an |UnSolvable| type when no solution exists
|
||||
(because of conflict, missing packages...).
|
||||
|
||||
Examine the solution
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -168,10 +168,10 @@ Alternatively, an easy way to compute the update to the environment is to check
|
|||
|
||||
Understand unsolvable problems
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
When a problem as no |Solution|, it is inherenty hard to come up with an explanation.
|
||||
In the easiest case, a requiered package is missing from the |Database|.
|
||||
When a problem has no |Solution|, it is inherenty hard to come up with an explanation.
|
||||
In the easiest case, a required package is missing from the |Database|.
|
||||
In the most complex, many package dependencies are incompatible without a single culprit.
|
||||
In this case, packages should be rebuild with weaker requirements, or with more build variants.
|
||||
In this case, packages should be rebuilt with weaker requirements, or with more build variants.
|
||||
The |UnSolvable| class attempts to build an explanation.
|
||||
|
||||
The :cpp:func:`UnSolvable.problems <mamba::solver::libsolv::UnSolvable::problems>` is a list
|
||||
|
|
|
@ -13,7 +13,7 @@ Describing Conda Objects
|
|||
.. |MatchSpec| replace:: :cpp:type:`MatchSpec <mamba::specs::MatchSpec>`
|
||||
|
||||
|
||||
The :any:`libmambapy.specs <mamba::specs>` submodule contains object to *describe* abstraction in the Conda ecosystem.
|
||||
The :any:`libmambapy.specs <mamba::specs>` submodule contains objects to *describe* abstraction in the Conda ecosystem.
|
||||
They are purely functional and do not have any observable impact on the user system.
|
||||
For instance |Channel| is used to describe a channel but does not download any file.
|
||||
|
||||
|
@ -22,7 +22,7 @@ CondaURL
|
|||
The |CondaURL| is a rich URL object that has additional capabilities for dealing with tokens,
|
||||
platforms, and packages.
|
||||
|
||||
To parse a string into a |CondaURL| use :cpp:func:`CondaURL.parse <mamba::specs::CondaURL::parse>`
|
||||
To parse a string into a |CondaURL|, use :cpp:func:`CondaURL.parse <mamba::specs::CondaURL::parse>`
|
||||
as follows:
|
||||
|
||||
.. code:: python
|
||||
|
@ -42,7 +42,7 @@ For instance, here the character ``!`` in the file name ``x264-1!164.3095-h166bd
|
|||
to be replaced with ``%21``.
|
||||
The getter functions, such as :cpp:func:`CondaURL.package <mamba::specs::CondaURL::package>`
|
||||
automatically decoded it for us, but we can specify ``decode=False`` to keep the raw representation.
|
||||
The setters follow the same logic, as described bellow.
|
||||
The setters follow the same logic, as described below.
|
||||
|
||||
.. code:: python
|
||||
|
||||
|
@ -99,7 +99,7 @@ representation of the string. By default, it will hide all credentials
|
|||
)
|
||||
assert url.str(credentials="Remove") == "https://mamba.pm/"
|
||||
|
||||
Similarily the :cpp:func:`CondaURL.pretty_str <mamba::specs::CondaURL::pretty_str>` returns a more
|
||||
Similarly the :cpp:func:`CondaURL.pretty_str <mamba::specs::CondaURL::pretty_str>` returns a more
|
||||
user-friendly string, but that may not be parsed back.
|
||||
|
||||
|
||||
|
@ -110,7 +110,7 @@ A |UnresolvedChannel| is a lightweight object to represent a channel string, as
|
|||
the CLI or configuration.
|
||||
Since channels rely heavily on configuration options, this type can be used as a placeholder for a
|
||||
channel that has not been fully "resolved" to a specific location.
|
||||
It does minimal parsing and can detect the type of ressource (an unresolved name, a URL, a file)
|
||||
It does minimal parsing and can detect the type of resource (an unresolved name, a URL, a file)
|
||||
and the platform filters.
|
||||
|
||||
.. code:: python
|
||||
|
@ -180,7 +180,7 @@ There are no hard-coded names:
|
|||
|
||||
You may have noticed that :cpp:func:`Channel.resolve <mamba::specs::Channel::resolve>` returns
|
||||
multiple channels.
|
||||
This is because of custom multichannel, a single name can return mutliple channels.
|
||||
This is because of custom multichannels, a single name can return multiple channels.
|
||||
|
||||
|
||||
.. code:: python
|
||||
|
@ -229,7 +229,7 @@ There can also be any number, such as in ``1.0.0alpha1dev3``.
|
|||
We can specify another *"local"* version, that we can separate with a ``+``, as in ``1.9.0+2.0.0``,
|
||||
but that is not widely used.
|
||||
Finally, there is also an epoch, similar to `PEP440 <https://peps.python.org/pep-0440/>`_, to
|
||||
accomodate for change in the versioning scheme.
|
||||
accommodate for change in the versioning scheme.
|
||||
For instance, in ``1!2.0.3``, the epoch is ``1``.
|
||||
|
||||
To sum up, a version like ``7!1.2a3.5b4dev+1.3.0``, can be parsed as:
|
||||
|
@ -243,7 +243,7 @@ so ``1.2``, ``1.2.0``, and ``1.2.0.0`` are all considered equal.
|
|||
|
||||
.. warning::
|
||||
|
||||
The flexibility of conda versions (arguably too flexible) is meant to accomodate differences
|
||||
The flexibility of conda versions (arguably too flexible) is meant to accommodate differences
|
||||
in various ecosystems.
|
||||
Library authors should stick to well defined version schemes such as
|
||||
`semantic versioning <https://semver.org/>`_,
|
||||
|
@ -283,7 +283,7 @@ We have the following primitives:
|
|||
Note that since ``1.2.4.0`` is the same as ``1.2.4``, this is also matched.
|
||||
- ``!=`` for **not equal** is the opposite, it matches all but the given version.
|
||||
For instance ``=!1.2.4`` matches ``1.2.5`` and ``1!1.2.4`` but not ``1.2.4``.
|
||||
- ``>`` for **greater** matches versions stricly greater than the current one, for instance
|
||||
- ``>`` for **greater** matches versions strictly greater than the current one, for instance
|
||||
``>1.2.4`` matches ``2.0.0``, ``1!1.0.0``, but not ``1.1.0`` or ``1.2.4``.
|
||||
- ``>=`` for **greater or equal**.
|
||||
- ``<`` for **less**.
|
||||
|
@ -299,7 +299,7 @@ We have the following primitives:
|
|||
all but the last parts specified, including zeros.
|
||||
For instance ``~=2.0`` matches ``2.0.0``, ``2.1.3``, but not ``3.0.1`` or ``2.0.0alpha``.
|
||||
|
||||
All version spec can be combine using a boolean grammar where ``|`` means **or** and ``,`` means
|
||||
All version specs can be combined using a boolean grammar where ``|`` means **or** and ``,`` means
|
||||
**and**.
|
||||
For instance, ``(>2.1.0,<3.0)|==2.0.1`` means:
|
||||
|
||||
|
@ -333,15 +333,15 @@ To check if a given version matches a version spec, we use
|
|||
|
||||
BuildNumberSpec
|
||||
---------------
|
||||
Similarily, a build number spec is a way to describe a set of build numbers.
|
||||
Similarly, a build number spec is a way to describe a set of build numbers.
|
||||
It's much simpler than the |VersionSpec| in that it does not contain any boolean grammar
|
||||
(the ``,`` and ``|`` operators).
|
||||
|BuildNumberSpec| only contain primitives similar to that used in |VersionSpec|:
|
||||
|BuildNumberSpec| only contain primitives similar to those used in |VersionSpec|:
|
||||
|
||||
- ``*`` or ``=*`` matches all build numbers (unrestricted).
|
||||
- ``=`` for **equal** matches build numbers equal to the given one (a singleton).
|
||||
- ``!=`` for **not equal**.
|
||||
- ``>`` for **greater** matches versions stricly greater than the current one.
|
||||
- ``>`` for **greater** matches versions strictly greater than the current one.
|
||||
- ``>=`` for **greater or equal**.
|
||||
- ``<`` for **less**.
|
||||
- ``<=`` for **less or equal**.
|
||||
|
@ -387,10 +387,10 @@ Match specs have a complex string representation, which we can informally write
|
|||
with an example
|
||||
``conda-forge:ns:python>=3.7=*cypthon[subdir="linux-64",fn=pkg.conda]``.
|
||||
|
||||
- ``<channel>``, here ``conda-forge`` describes an |UnresolvedChannel| of where the channel the
|
||||
package should come from.
|
||||
- ``<channel>``, here ``conda-forge``, describes an |UnresolvedChannel| where the package
|
||||
should come from.
|
||||
It accepts all values from an unresolved channel, such as ``conda-forge/label/micromamba_dev``,
|
||||
URLs, local file path, and platforms filters in between brackets.
|
||||
URL, local file path, and platforms filters in between brackets.
|
||||
- ``<namespace>``, here ``ns`` is a future, not implemented, feature.
|
||||
It is nonetheless parsed, and retrievable.
|
||||
- ``<name>``, here ``python`` is the package name or glob expression and is the only mandatory
|
||||
|
@ -400,8 +400,8 @@ with an example
|
|||
followed by a ``<build_string>`` glob specification, here ``*cpython``.
|
||||
- Last, a bracket section of comma separated ``<attribute>`` = ``<value>``.
|
||||
In the example, we have two attributes, ``subdir`` and ``fn``.
|
||||
Attribute values support quaoting with ``"`` or ``'``.
|
||||
As such, they can be useful to set previously mentioned field without ambiguity.
|
||||
Attribute values support quoting with ``"`` or ``'``.
|
||||
As such, they can be useful to set previously mentioned fields without ambiguity.
|
||||
Valid attribute names are:
|
||||
|
||||
- ``channel``, similar to ``<channel>``.
|
||||
|
@ -410,7 +410,7 @@ with an example
|
|||
parentheses and ``,`` and ``|`` operators).
|
||||
- ``build``, similar to ``<build_string>``.
|
||||
- ``build_number`` to set the |BuildNumberSpec|.
|
||||
- ``subdir`` to select the channel subdirectory platform from which the package must come from.
|
||||
- ``subdir`` to select the channel subdirectory platform from which the package must come.
|
||||
- ``fn`` to select the filename the package must match.
|
||||
- ``md5`` to specify the MD5 hash the package archive must have.
|
||||
- ``sha256`` to specify the SHA256 hash the package archive must have.
|
||||
|
@ -420,7 +420,7 @@ with an example
|
|||
|
||||
.. warning::
|
||||
|
||||
Specifying some value mulitple time, such as in ``python>=3.7[version="(=3.9|>3.11)"]``, or
|
||||
Specifying some value multiple times, such as in ``python>=3.7[version="(=3.9|>3.11)"]``, or
|
||||
``python[build="foo"][build="bar"]`` is undefined and subject to change in the future.
|
||||
|
||||
.. warning::
|
||||
|
@ -435,13 +435,13 @@ with an example
|
|||
The method
|
||||
:cpp:func:`MatchSpec.contains_except_channel <mamba::specs::MatchSpec::contains_except_channel>`
|
||||
can be used to check if a package is contained (matched) by the current |MatchSpec|.
|
||||
The somewhat verbose name serve to indicate that the channel is ignored in this function.
|
||||
As mentionned in the :ref:`Channel section<libmamba_usage_channel>` resolving and matching channels
|
||||
The somewhat verbose name serves to indicate that the channel is ignored in this function.
|
||||
As mentioned in the :ref:`Channel section<libmamba_usage_channel>`, resolving and matching channels
|
||||
is a delicate operation.
|
||||
In addition, the channel is a part that describe the **provenance** of a package and not is content
|
||||
so various application ay want to handle it in different ways.
|
||||
In addition, the channel is a part that describes the **provenance** of a package and not its content,
|
||||
so various applications may want to handle it in different ways.
|
||||
The :cpp:func:`MatchSpec.channel <mamba::specs::MatchSpec::channel>` attribute can be used to
|
||||
reason about the possible channel contained in the |MatchSpec|.
|
||||
reason about the possible channels contained in the |MatchSpec|.
|
||||
|
||||
.. code:: python
|
||||
|
||||
|
|
|
@ -118,7 +118,7 @@ Windows API historically supports paths up to 260 characters. While it's now pos
|
|||
Long paths support has to be activated
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
source: Robocorp `troubleshooting documentation <https://robocorp.com/docs/troubleshooting/windows-long-path>`_
|
||||
source: Robocop `troubleshooting documentation <https://robocorp.com/docs/troubleshooting/windows-long-path>`_
|
||||
|
||||
1. Open the Local Group Policy Editor application: - Start --> type gpedit.msc --> Enter:
|
||||
2. Navigate to Computer Configuration > Administrative Templates > System > Filesystem. On the right, find the "Enable win32 long paths" item and double-click it
|
||||
|
|
|
@ -34,7 +34,7 @@ set(
|
|||
)
|
||||
message(STATUS "Building libmamba v${${PROJECT_NAME}_VERSION}")
|
||||
|
||||
# Binary version See the following URL for explanations about the binary versionning
|
||||
# Binary version See the following URL for explanations about the binary versioning
|
||||
# https://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html#Updating-version-info
|
||||
file(
|
||||
STRINGS "${LIBMAMBA_INCLUDE_DIR}/mamba/version.hpp" libmamba_version_defines
|
||||
|
@ -591,7 +591,7 @@ macro(libmamba_create_target target_name linkage output_name)
|
|||
yaml-cpp::yaml-cpp
|
||||
fmt::fmt
|
||||
# Since conda-forge spdlog is built with a bundled version of fmt we use the header
|
||||
# only version to avoid chasing after the correct fmt version mathching the one used
|
||||
# only version to avoid chasing after the correct fmt version matching the one used
|
||||
# in the bundle
|
||||
spdlog::spdlog_header_only
|
||||
PRIVATE
|
||||
|
|
|
@ -37,7 +37,7 @@ if(BUILD_LIBMAMBA_TESTS)
|
|||
endif()
|
||||
|
||||
# Object libraries are installed as an interface library (in libmambaTargets) but do not install any
|
||||
# objects (.o files) or headers without the ``OBJETS DESTINATION`` property.
|
||||
# objects (.o files) or headers without the ``OBJECTS DESTINATION`` property.
|
||||
install(
|
||||
TARGETS solv-cpp
|
||||
EXPORT ${PROJECT_NAME}Targets
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace solv
|
|||
* Pool of solvable involved in resolving en environment.
|
||||
*
|
||||
* The pool contains the solvable (packages) information required from the ``::Solver``.
|
||||
* The pool can be reused by multiple solvers to solve differents requirements with the same
|
||||
* The pool can be reused by multiple solvers to solve different requirements with the same
|
||||
* ecosystem.
|
||||
*/
|
||||
class ObjPoolView
|
||||
|
@ -118,7 +118,7 @@ namespace solv
|
|||
/** Get the registered version of a dependency. */
|
||||
auto get_dependency_version(DependencyId id) const -> std::string_view;
|
||||
|
||||
/** Get the registered realtion between a dependency name and version. */
|
||||
/** Get the registered relation between a dependency name and version. */
|
||||
auto get_dependency_relation(DependencyId id) const -> std::string_view;
|
||||
|
||||
/** Compute the string representation of a dependency. */
|
||||
|
@ -129,7 +129,7 @@ namespace solv
|
|||
*
|
||||
* Create an index to retrieve the list of solvables satisfying a given dependency.
|
||||
* This is an expensive operation.
|
||||
* The index is also computed over regular ``StringId``, in which case they reprensent
|
||||
* The index is also computed over regular ``StringId``, in which case they represent
|
||||
* all packages that provide that name (without restriction on version).
|
||||
*/
|
||||
void create_whatprovides();
|
||||
|
@ -157,7 +157,7 @@ namespace solv
|
|||
* Add an entry to ``whatprovides``.
|
||||
*
|
||||
* This is the table that is looked up to know which solvables satistfy a given dependency.
|
||||
* Entries set with this function get overriden by @ref create_whatprovides.
|
||||
* Entries set with this function get overridden by @ref create_whatprovides.
|
||||
*/
|
||||
void add_to_whatprovides(DependencyId dep, OffsetId solvables);
|
||||
|
||||
|
@ -253,7 +253,7 @@ namespace solv
|
|||
* Set the installed repository.
|
||||
*
|
||||
* The installed repository represents package already installed.
|
||||
* For instance, it is used to filter out the solvable that are alrady available after
|
||||
* For instance, it is used to filter out the solvable that are already available after
|
||||
* a solve.
|
||||
*/
|
||||
void set_installed_repo(RepoId id);
|
||||
|
|
|
@ -198,7 +198,7 @@ namespace solv
|
|||
* Set the version used for writing solv files.
|
||||
*
|
||||
* This has no effect for libsolv and is purely for data storing.
|
||||
* It is up to the user to make comparsions with this attribute.
|
||||
* It is up to the user to make comparisons with this attribute.
|
||||
*
|
||||
* @note A call to @ref ObjRepoView::internalize is required for this attribute to
|
||||
* be available for lookup.
|
||||
|
@ -210,7 +210,7 @@ namespace solv
|
|||
* Clear all solvables from the repository.
|
||||
*
|
||||
* If @p reuse_ids is true, the solvable ids used in the pool can be reused for future
|
||||
* solvables (incuding in other repositories).
|
||||
* solvables (including in other repositories).
|
||||
*/
|
||||
void clear(bool reuse_ids) const;
|
||||
|
||||
|
@ -243,7 +243,7 @@ namespace solv
|
|||
* Remove a solvable from the repository.
|
||||
*
|
||||
* If @p reuse_id is true, the solvable id used in the pool can be reused for future
|
||||
* solvables (incuding in other repositories).
|
||||
* solvables (including in other repositories).
|
||||
*/
|
||||
auto remove_solvable(SolvableId id, bool reuse_id) const -> bool;
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ namespace solv
|
|||
* When the array is split in two using a maker, @p marker can be used to get
|
||||
* only a part of the the dependency array.
|
||||
* Use ``-1`` to get the first part, ``1`` to get the second part, and ``0`` to get
|
||||
* eveything including the marker.
|
||||
* everything including the marker.
|
||||
*/
|
||||
auto dependencies(DependencyMarker marker = -1) const -> ObjQueue;
|
||||
|
||||
|
@ -322,8 +322,8 @@ namespace solv
|
|||
* Set all constraints.
|
||||
*
|
||||
* A constraint is like a dependency that is not part of the solving outcome.
|
||||
* In other words, if a solvable has a constraint, it is activated ony if another solvable
|
||||
* in the solving requires that package as a dependencyl
|
||||
* In other words, if a solvable has a constraint, it is only activated if another solvable
|
||||
* in the solving requires that package as a dependency
|
||||
*
|
||||
* @warning The pool must be of type conda for this to have an impact in during solving
|
||||
* @ref ``ObjPool::set_disttype``.
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace solv
|
|||
auto ObjQueue::operator=(ObjQueue&& other) -> ObjQueue&
|
||||
{
|
||||
swap(*this, other);
|
||||
// Leaving other empty to make sure ressources are no longer used
|
||||
// Leaving other empty to make sure resources are no longer used
|
||||
auto empty = ObjQueue(nullptr);
|
||||
swap(other, empty);
|
||||
return *this;
|
||||
|
|
|
@ -60,7 +60,7 @@ TEST_SUITE("solv::ObjPool")
|
|||
}
|
||||
}
|
||||
|
||||
SUBCASE("Find non-existant string")
|
||||
SUBCASE("Find non-existent string")
|
||||
{
|
||||
CHECK_FALSE(pool.find_string("Bar").has_value());
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ TEST_SUITE("solv::ObjPool")
|
|||
|
||||
SUBCASE("Iterate on installed solvables")
|
||||
{
|
||||
SUBCASE("No instaled repo")
|
||||
SUBCASE("No installed repo")
|
||||
{
|
||||
pool.for_each_installed_solvable_id([&](SolvableId) { CHECK(false); });
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ TEST_SUITE("solv::ObjPool")
|
|||
pool.set_installed_repo(repo1_id);
|
||||
std::vector<SolvableId> ids = {};
|
||||
pool.for_each_installed_solvable_id([&](auto id) { ids.push_back(id); });
|
||||
std::sort(ids.begin(), ids.end()); // Ease comparsion
|
||||
std::sort(ids.begin(), ids.end()); // Ease comparison
|
||||
CHECK_EQ(ids, decltype(ids){ id1 });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,7 +146,7 @@ TEST_SUITE("solv::ObjTransaction")
|
|||
}
|
||||
);
|
||||
|
||||
// Sorting for comaprison
|
||||
// Sorting for comparison
|
||||
std::sort(solvables.begin(), solvables.end());
|
||||
auto steps = trans.steps();
|
||||
std::sort(steps.begin(), steps.end());
|
||||
|
|
|
@ -423,11 +423,11 @@ namespace mamba
|
|||
void clear_values();
|
||||
|
||||
/**
|
||||
* Pop values that should have a single operation lifetime to avoid memroy effect
|
||||
* Pop values that should have a single operation lifetime to avoid memory effect
|
||||
* between multiple operations.
|
||||
* It corresponds to CLI values in most of the cases, but may also include API
|
||||
* values if the `Configurable::has_single_op_lifetime` method returns true.
|
||||
* RC files and environment variables are always overriden when loading the
|
||||
* RC files and environment variables are always overridden when loading the
|
||||
* configuration.
|
||||
*/
|
||||
void operation_teardown();
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace mamba
|
|||
enum class file_parsing_error_code
|
||||
{
|
||||
unknown_failure, /// Something failed while parsing but we can't identify what.
|
||||
unsuported_version, /// The version of the file does not matched supported ver.
|
||||
unsupported_version, /// The version of the file does not matched supported ver.
|
||||
parsing_failure, /// The content of the file doesnt match the expected format/language
|
||||
/// structure or constraints.
|
||||
invalid_data, /// The structure of the data in the file is fine but some fields have
|
||||
|
|
|
@ -71,7 +71,7 @@ namespace mamba
|
|||
|
||||
error_list_t m_error_list;
|
||||
mutable std::string m_aggregated_message;
|
||||
static constexpr const char* m_base_message = "Multiple errors occured:\n";
|
||||
static constexpr const char* m_base_message = "Multiple errors occurred:\n";
|
||||
};
|
||||
|
||||
/********************************
|
||||
|
@ -277,7 +277,7 @@ namespace mamba
|
|||
}
|
||||
|
||||
/***********************************
|
||||
* helper funcitons implementation *
|
||||
* helper functions implementation *
|
||||
***********************************/
|
||||
|
||||
template <class T, class E>
|
||||
|
|
|
@ -59,7 +59,7 @@ namespace mamba
|
|||
// Schedules a task for execution.
|
||||
// The task must be a callable which takes either the provided arguments or none.
|
||||
// If this executor is open, the task is scheduled for execution and will be called
|
||||
// as soon as execution resources are available. The call to the task is not garanteed
|
||||
// as soon as execution resources are available. The call to the task is not guaranteed
|
||||
// to have been done at the end of the execution of this function, nor before.
|
||||
// If this executor is closed, the task is ignored and no code will be executed nor the task
|
||||
// be called.
|
||||
|
@ -81,7 +81,7 @@ namespace mamba
|
|||
// Moves ownership of a thread into this executor.
|
||||
// This is used in case a thread needs to be manipulated in a particular way,
|
||||
// but we still want to avoid having to use `std::thread::detach()`. By
|
||||
// transfering the ownership of the thread to this executor, we are guaranteed that
|
||||
// transferring the ownership of the thread to this executor, we are guaranteed that
|
||||
// the thread will be joined before the end of the lifetime of this executor.
|
||||
// If this executor is closed, no code will be executed and the thread will be destroyed,
|
||||
// resulting in a call to `std::terminate()` if the thread is not already joined.
|
||||
|
|
|
@ -104,7 +104,7 @@ namespace mamba
|
|||
std::chrono::system_clock::time_point m_next_retry;
|
||||
std::chrono::system_clock::duration m_retry_wait_seconds;
|
||||
std::size_t m_retry_backoff_factor;
|
||||
// count number of retries (this is not the same as failed transfers, as mutiple
|
||||
// count number of retries (this is not the same as failed transfers, as multiple
|
||||
// transfers can be started at the same time, but should all be retried only once)
|
||||
std::size_t m_retry_counter;
|
||||
|
||||
|
|
|
@ -13,9 +13,9 @@ namespace mamba
|
|||
{
|
||||
struct Palette
|
||||
{
|
||||
/** Something that is possible or exsists. */
|
||||
/** Something that is possible or exists. */
|
||||
fmt::text_style success;
|
||||
/** Something that is impossible or does not exsist. */
|
||||
/** Something that is impossible or does not exist. */
|
||||
fmt::text_style failure;
|
||||
/** Refers to external ecosystem. */
|
||||
fmt::text_style external;
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace mamba
|
|||
- if this object is being joined and/or destroyed, it will block until any already started
|
||||
tasks are ended;
|
||||
|
||||
WARNING: When used as a member of a type to syncrhonized tasks of the `this` instance, it is
|
||||
WARNING: When used as a member of a type to synchronized tasks of the `this` instance, it is
|
||||
best to set the TaskSynchronizer as the last member so that it is the first one to be
|
||||
destroyed; alternatively, `.join_tasks()` can be called manually in the destructor too.
|
||||
|
||||
|
@ -161,14 +161,14 @@ namespace mamba
|
|||
assert(!is_joined());
|
||||
}
|
||||
|
||||
/** @return true if all synchronized tasks have beeen joined, false otherwise. @see
|
||||
/** @return true if all synchronized tasks have been joined, false otherwise. @see
|
||||
* join_tasks(), reset()*/
|
||||
bool is_joined() const
|
||||
{
|
||||
return !m_status && m_running_tasks == 0;
|
||||
}
|
||||
|
||||
/** @return Number of synchronized tasks which are currently beeing executed. */
|
||||
/** @return Number of synchronized tasks which are currently being executed. */
|
||||
int64_t running_tasks() const
|
||||
{
|
||||
return m_running_tasks;
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace mamba
|
|||
|
||||
// Waits until all other threads have finished
|
||||
// Must be called by the cleaning thread to ensure
|
||||
// it won't free ressources that could be required
|
||||
// it won't free resources that could be required
|
||||
// by threads still active.
|
||||
void wait_for_all_threads();
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ namespace mamba
|
|||
// {
|
||||
// print("locked file {}, locking counts: {}", some_path,
|
||||
// lock.count_lock_owners()); // success might mean we are locking the same path
|
||||
// from multiple threads do_something(som_path); // locking was a success
|
||||
// from multiple threads do_something(some_path); // locking was a success
|
||||
// }
|
||||
// else // locking didnt succeed for some reason
|
||||
// {
|
||||
|
@ -232,7 +232,7 @@ namespace mamba
|
|||
// other reason, maybe a configuration option
|
||||
// }
|
||||
// some_more_work(some_path); // do this that the lock failed or not
|
||||
// return lock; // The locking ownership can be transfered to another function if
|
||||
// return lock; // The locking ownership can be transferred to another function if
|
||||
// necessary
|
||||
// }
|
||||
//
|
||||
|
|
|
@ -29,11 +29,11 @@ namespace mamba
|
|||
}
|
||||
catch (const std::exception& ex)
|
||||
{
|
||||
LOG_ERROR << fmt::format("Scope exit error (catched and ignored): {}", ex.what());
|
||||
LOG_ERROR << fmt::format("Scope exit error (caught and ignored): {}", ex.what());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
LOG_ERROR << "Scope exit unknown error (catched and ignored)";
|
||||
LOG_ERROR << "Scope exit unknown error (caught and ignored)";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ namespace mamba::download
|
|||
MirrorID m_id;
|
||||
size_t m_max_retries;
|
||||
|
||||
// TODO: use sychronized value
|
||||
// TODO: use synchronized value
|
||||
std::mutex m_stats_mutex;
|
||||
std::optional<std::size_t> m_allowed_connections = std::nullopt;
|
||||
std::size_t m_max_tried_connections = 0;
|
||||
|
|
|
@ -40,7 +40,7 @@ namespace mamba::download
|
|||
// Returns true if there are registered mirrors stored here, false if none are.
|
||||
bool has_mirrors(std::string_view mirror_name) const;
|
||||
|
||||
// Get a list of unique mirorrs if existing for the provided mirror name, or an empty list
|
||||
// Get a list of unique mirrors if existing for the provided mirror name, or an empty list
|
||||
// otherwise.
|
||||
mirror_set_view get_mirrors(std::string_view mirror_name) const;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace mamba::solver::libsolv
|
|||
* Database of solvable involved in resolving en environment.
|
||||
*
|
||||
* The database contains the solvable (packages) information required from the @ref Solver.
|
||||
* The database can be reused by multiple solvers to solve differents requirements with the
|
||||
* The database can be reused by multiple solvers to solve different requirements with the
|
||||
* same ecosystem.
|
||||
*/
|
||||
class Database
|
||||
|
|
|
@ -26,9 +26,9 @@ namespace mamba::solver::libsolv
|
|||
*
|
||||
* In libsolv, most of the data is help in the @ref Database, and repo are tightly coupled
|
||||
* with them.
|
||||
* This repository class is a lightwight description of a repository returned when creating
|
||||
* This repository class is a lightweight description of a repository returned when creating
|
||||
* a new repository in the @ref Database.
|
||||
* Some modifications to the repo are possible throught the @ref Database.
|
||||
* Some modifications to the repo are possible through the @ref Database.
|
||||
* @see Database::add_repo_from_repodata_json
|
||||
* @see Database::add_repo_from_packages
|
||||
* @see Database::remove_repo
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace mamba::specs
|
|||
/**
|
||||
* A class that holds the authentication info stored by users.
|
||||
*
|
||||
* Essentially a map, except that some keys can match mutliple queries.
|
||||
* Essentially a map, except that some keys can match multiple queries.
|
||||
* For instance "mamba.org/private" should be matched by queries "mamba.org/private",
|
||||
* "mamba.org/private/channel", but not "mamba.org/public".
|
||||
*
|
||||
|
@ -81,7 +81,7 @@ namespace mamba::specs
|
|||
* Future development of this class should aim to replace the map and keys with a
|
||||
* `AuthenticationSpec`, that can decide whether or not a URL should benefit from such
|
||||
* its authentication.
|
||||
* Possibly, a string reprensentation such as "*.mamba.org/private/channel*" could be added
|
||||
* Possibly, a string representation such as "*.mamba.org/private/channel*" could be added
|
||||
* to parse users intentions, rather than relying on the assumptions made here.
|
||||
*/
|
||||
using AuthenticationDataBase = util::
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace mamba::specs
|
|||
/**
|
||||
* Match a build number with a predicate.
|
||||
*
|
||||
* Conda does not implement expression for build numbers but they could be added similarily
|
||||
* Conda does not implement expression for build numbers but they could be added similarly
|
||||
* to @ref VersionSpec.
|
||||
*/
|
||||
class BuildNumberSpec
|
||||
|
@ -90,7 +90,7 @@ namespace mamba::specs
|
|||
|
||||
using BuildNumber = typename BuildNumberPredicate::BuildNumber;
|
||||
|
||||
static constexpr std::string_view prefered_free_str = "=*";
|
||||
static constexpr std::string_view preferred_free_str = "=*";
|
||||
static constexpr std::array<std::string_view, 4> all_free_strs = { "", "*", "=*", "==*" };
|
||||
static constexpr std::string_view equal_str = "=";
|
||||
static constexpr std::string_view not_equal_str = "!=";
|
||||
|
@ -107,7 +107,7 @@ namespace mamba::specs
|
|||
explicit BuildNumberSpec(BuildNumberPredicate predicate) noexcept;
|
||||
|
||||
/**
|
||||
* Returns wether the BuildNumberSpec is unconstrained.
|
||||
* Returns whether the BuildNumberSpec is unconstrained.
|
||||
*/
|
||||
[[nodiscard]] auto is_explicitly_free() const -> bool;
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ namespace mamba::specs
|
|||
/*
|
||||
* This ID is a cross URL id, and is dependent on the
|
||||
* channel_alias when the channel has not been specified in
|
||||
* the new mirrord_channel section of the configuration.
|
||||
* the new mirrored_channel section of the configuration.
|
||||
*/
|
||||
[[nodiscard]] auto id() const -> const std::string&;
|
||||
[[nodiscard]] auto display_name() const -> const std::string&;
|
||||
|
|
|
@ -105,7 +105,7 @@ namespace mamba::specs
|
|||
*/
|
||||
void append_path(std::string_view path, Encode::no_type);
|
||||
|
||||
/** Return wether a token is set. */
|
||||
/** Return whether a token is set. */
|
||||
[[nodiscard]] auto has_token() const -> bool;
|
||||
|
||||
/** Return the Conda token, as delimited with "/t/", or empty if there isn't any. */
|
||||
|
@ -115,7 +115,7 @@ namespace mamba::specs
|
|||
* Set a token.
|
||||
*
|
||||
* If the URL already contains one replace it at the same location, otherwise, add it at
|
||||
* the begining of the path.
|
||||
* the beginning of the path.
|
||||
*/
|
||||
void set_token(std::string_view token);
|
||||
|
||||
|
@ -216,7 +216,7 @@ namespace mamba::specs
|
|||
* Due to decoding, the outcome may not be understood by parser and usable to reach an
|
||||
* asset.
|
||||
* @param strip_scheme If true, remove the scheme and "localhost" on file URI.
|
||||
* @param rstrip_path If non-null, remove the given charaters at the end of the path.
|
||||
* @param rstrip_path If non-null, remove the given characters at the end of the path.
|
||||
* @param credentials If true, hide password and tokens in the decoded string.
|
||||
* @param credentials Decide to keep, remove, or hide passwrd, users, and token.
|
||||
*/
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace mamba::specs
|
|||
[[nodiscard]] auto is_free() const -> bool;
|
||||
|
||||
/**
|
||||
* Return true if the spec will match exaclty one input.
|
||||
* Return true if the spec will match exactly one input.
|
||||
*/
|
||||
[[nodiscard]] auto is_exact() const -> bool;
|
||||
|
||||
|
|
|
@ -39,11 +39,11 @@ namespace mamba::specs
|
|||
using string_set_const_ref = typename std::reference_wrapper<const string_set>;
|
||||
|
||||
inline static constexpr char url_md5_sep = '#';
|
||||
inline static constexpr char prefered_list_open = '[';
|
||||
inline static constexpr char prefered_list_close = ']';
|
||||
inline static constexpr char preferred_list_open = '[';
|
||||
inline static constexpr char preferred_list_close = ']';
|
||||
inline static constexpr char alt_list_open = '(';
|
||||
inline static constexpr char alt_list_close = ')';
|
||||
inline static constexpr char prefered_quote = '"';
|
||||
inline static constexpr char preferred_quote = '"';
|
||||
inline static constexpr char alt_quote = '\'';
|
||||
inline static constexpr char channel_namespace_spec_sep = ':';
|
||||
inline static constexpr char attribute_sep = ',';
|
||||
|
@ -123,7 +123,7 @@ namespace mamba::specs
|
|||
* comparing unresolved channels and the fact that this check can be also be done once
|
||||
* at a repository level when the user knows how packages are organised.
|
||||
*
|
||||
* This function is written as a generic template, to acomodate various uses: the fact
|
||||
* This function is written as a generic template, to accommodate various uses: the fact
|
||||
* that the attributes may not always be in the correct format in the package, and that
|
||||
* their parsing may be cached.
|
||||
*/
|
||||
|
@ -131,7 +131,7 @@ namespace mamba::specs
|
|||
[[nodiscard]] auto contains_except_channel(const Pkg& pkg) const -> bool;
|
||||
|
||||
/**
|
||||
* Convenience wrapper making necessary convertions.
|
||||
* Convenience wrapper making necessary conversions.
|
||||
*/
|
||||
[[nodiscard]] auto contains_except_channel(const PackageInfo& pkg) const -> bool;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ namespace mamba::specs
|
|||
[[nodiscard]] auto is_explicitly_free() const -> bool;
|
||||
|
||||
/**
|
||||
* Return true if the spec will match exaclty one input.
|
||||
* Return true if the spec will match exactly one input.
|
||||
*/
|
||||
[[nodiscard]] auto is_exact() const -> bool;
|
||||
|
||||
|
|
|
@ -27,12 +27,12 @@ namespace mamba::specs
|
|||
* Due the the heavy reliance of channels on configuration options, this placeholder type
|
||||
* can be used to represent channel inputs that have not been "resolved" to s specific
|
||||
* location.
|
||||
* This can even be true when a full URL or path is given, as some authentification information
|
||||
* This can even be true when a full URL or path is given, as some authentication information
|
||||
* may come from login database.
|
||||
*
|
||||
* Note that for a string to be considered a URL, it must have an explicit scheme.
|
||||
* So "repo.anaconda.com" is considered a name, similarily to "conda-forge" and not a URL.
|
||||
* This is because otherwise it is not possible to tell names and URL appart.
|
||||
* So "repo.anaconda.com" is considered a name, similarly to "conda-forge" and not a URL.
|
||||
* This is because otherwise it is not possible to tell names and URL apart.
|
||||
*/
|
||||
class UnresolvedChannel
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ namespace mamba::specs
|
|||
enum class Type
|
||||
{
|
||||
/**
|
||||
* A URL to a full repo strucuture.
|
||||
* A URL to a full repo structure.
|
||||
*
|
||||
* Example "https://repo.anaconda.com/conda-forge".
|
||||
*/
|
||||
|
@ -53,7 +53,7 @@ namespace mamba::specs
|
|||
*/
|
||||
PackageURL,
|
||||
/**
|
||||
* An (possibly implicit) path to a full repo strucuture.
|
||||
* An (possibly implicit) path to a full repo structure.
|
||||
*
|
||||
* Example "/Users/name/conda-bld", "./conda-bld", "~/.conda-bld".
|
||||
*/
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace mamba::specs
|
|||
/**
|
||||
* A sequence of VersionPart meant to represent all parts of a version.
|
||||
*
|
||||
* CommonVersion are composed of an aribtrary postive number parts, such as major, minor.
|
||||
* CommonVersion are composed of an arbitrary positive number parts, such as major, minor.
|
||||
* They are typically separated by dots, for instance the three parts in 3.0post1dev.4 are
|
||||
* {{3, ""}}, {{0, "post"}, {1, "dev"}}, and {{4, ""}}.
|
||||
*
|
||||
|
@ -85,7 +85,7 @@ namespace mamba::specs
|
|||
/**
|
||||
* A version according to Conda specifications.
|
||||
*
|
||||
* A verison is composed of
|
||||
* A version is composed of
|
||||
* - A epoch number, usually 0;
|
||||
* - A regular version,
|
||||
* - An optional local.
|
||||
|
@ -153,7 +153,7 @@ namespace mamba::specs
|
|||
*
|
||||
* For instance 1.3.1 is compatible with 1.2.1 at level 0 (first component `1 == 1``),
|
||||
* at level 1 (second component `` 3 >= 2``), but not at level two (because the second
|
||||
* component is stricly larger ``3 > 2``).
|
||||
* component is strictly larger ``3 > 2``).
|
||||
* Compatible versions are always smaller than the current version.
|
||||
*/
|
||||
[[nodiscard]] auto compatible_with(const Version& older, std::size_t level) const -> bool;
|
||||
|
|
|
@ -137,7 +137,7 @@ namespace mamba::specs
|
|||
static constexpr char left_parenthesis_token = '(';
|
||||
static constexpr char right_parenthesis_token = ')';
|
||||
|
||||
static constexpr std::string_view prefered_free_str = "=*";
|
||||
static constexpr std::string_view preferred_free_str = "=*";
|
||||
static constexpr std::array<std::string_view, 4> all_free_strs = { "", "*", "=*", "==*" };
|
||||
static constexpr std::string_view starts_with_str = "=";
|
||||
static constexpr std::string_view equal_str = "==";
|
||||
|
@ -162,10 +162,10 @@ namespace mamba::specs
|
|||
explicit VersionSpec(tree_type&& tree) noexcept;
|
||||
|
||||
/**
|
||||
* Returns wether the VersionSpec is unconstrained.
|
||||
* Returns whether the VersionSpec is unconstrained.
|
||||
*
|
||||
* Due to the complex nature of VersionSpec expressions, it is not always easy to know
|
||||
* whether a complex expression can be simpified to the unconstrained one.
|
||||
* whether a complex expression can be simplified to the unconstrained one.
|
||||
* This functions only handles the trivial cases.
|
||||
*/
|
||||
[[nodiscard]] auto is_explicitly_free() const -> bool;
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace mamba::util
|
|||
*
|
||||
* In case of error, set the error code @p ec.
|
||||
*
|
||||
* @param path must hae filesystem default encoding.
|
||||
* @param path must have filesystem default encoding.
|
||||
*/
|
||||
static auto try_open( //
|
||||
const fs::u8path& path,
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace mamba::util
|
|||
};
|
||||
|
||||
/**
|
||||
* Hash a blob of data and write the hashed bytes to the provided ouput.
|
||||
* Hash a blob of data and write the hashed bytes to the provided output.
|
||||
*/
|
||||
void blob_bytes_to(blob_type blob, std::byte* out);
|
||||
|
||||
|
@ -71,7 +71,7 @@ namespace mamba::util
|
|||
[[nodiscard]] auto blob_hex_str(blob_type blob) -> std::string;
|
||||
|
||||
/**
|
||||
* Hash a string and write the hashed bytes to the provided ouput.
|
||||
* Hash a string and write the hashed bytes to the provided output.
|
||||
*/
|
||||
void str_bytes_to(std::string_view data, std::byte* out);
|
||||
|
||||
|
@ -96,7 +96,7 @@ namespace mamba::util
|
|||
[[nodiscard]] auto str_hex_str(std::string_view data) -> std::string;
|
||||
|
||||
/**
|
||||
* Incrementally hash a file and write the hashed bytes to the provided ouput.
|
||||
* Incrementally hash a file and write the hashed bytes to the provided output.
|
||||
*/
|
||||
void file_bytes_to(std::ifstream& file, std::byte* out);
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace mamba::util
|
|||
[[nodiscard]] auto nibble_to_hex(std::byte b) noexcept -> char;
|
||||
|
||||
/**
|
||||
* Convert a buffer of bytes to a hexadecimal string written in the @p out paremeter.
|
||||
* Convert a buffer of bytes to a hexadecimal string written in the @p out parameter.
|
||||
*
|
||||
* The @p out parameter must be allocated with twice the size of the input byte buffer.
|
||||
*/
|
||||
|
@ -80,7 +80,7 @@ namespace mamba::util
|
|||
/**
|
||||
* Escape reserved URL reserved characters with '%' encoding.
|
||||
*
|
||||
* The secons argument can be used to specify characters to exclude from encoding,
|
||||
* The second argument can be used to specify characters to exclude from encoding,
|
||||
* so that for instance path can be encoded without splitting them (if they have no '/' other
|
||||
* than separators).
|
||||
*
|
||||
|
|
|
@ -37,22 +37,22 @@ namespace mamba::util
|
|||
/**
|
||||
* Return a map of all environment variables encoded in UTF8.
|
||||
*
|
||||
* This is useful if one in intersted to do an operatrion over all envrionment variables
|
||||
* when their name is unknown.
|
||||
* This is useful if one is interested to do an operation over all environment variables
|
||||
* when their names are unknown.
|
||||
*/
|
||||
[[nodiscard]] auto get_env_map() -> environment_map;
|
||||
|
||||
/**
|
||||
* Equivalent to calling set_env in a loop.
|
||||
*
|
||||
* This leaves environment variables not refered to in the map unmodified.
|
||||
* This leaves environment variables not referred to in the map unmodified.
|
||||
*/
|
||||
void update_env_map(const environment_map& env);
|
||||
|
||||
/**
|
||||
* Set the environment to be exactly the map given.
|
||||
*
|
||||
* This unset all environment variables not refered to in the map unmodified.
|
||||
* This unsets all environment variables not referred to in the map unmodified.
|
||||
*/
|
||||
void set_env_map(const environment_map& env);
|
||||
|
||||
|
@ -108,7 +108,7 @@ namespace mamba::util
|
|||
/**
|
||||
* Return the full path of a program from its name if found inside the given directories.
|
||||
*
|
||||
* The directies can be given as a range or as a @ref pathsep separated list.
|
||||
* The directories can be given as a range or as a @ref pathsep separated list.
|
||||
*/
|
||||
template <typename Range>
|
||||
[[nodiscard]] auto which_in(std::string_view exe, const Range& search_paths) -> fs::u8path;
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace mamba::util
|
|||
* any kind of binary directed acyclic graph (e.g. there can be multiple trees,
|
||||
* or nodes could have multiple parents)
|
||||
*
|
||||
* For efficency (and simplicity), this data structure can currenlty only grow.
|
||||
* For efficiency (and simplicity), this data structure can currently only grow.
|
||||
* The tree must also be grown from the leaves, adding children first and their
|
||||
* parents afterwards.
|
||||
*/
|
||||
|
@ -55,7 +55,7 @@ namespace mamba::util
|
|||
/**
|
||||
* Reserve (allocate) space for @p nodes.
|
||||
*
|
||||
* This improves the efficency of ``add_leaf`` and ``add_branch`` but does not
|
||||
* This improves the efficiency of ``add_leaf`` and ``add_branch`` but does not
|
||||
* modify the tree in any way.
|
||||
*/
|
||||
void reserve(size_type size);
|
||||
|
@ -63,7 +63,7 @@ namespace mamba::util
|
|||
/**
|
||||
* Add a node with no children.
|
||||
*
|
||||
* Return an ID that can be used to poin to this node as a children in ``add_branch``.
|
||||
* Return an ID that can be used to point to this node as a children in ``add_branch``.
|
||||
*/
|
||||
auto add_leaf(const leaf_type& leaf) -> idx_type;
|
||||
auto add_leaf(leaf_type&& leaf) -> idx_type;
|
||||
|
@ -71,7 +71,7 @@ namespace mamba::util
|
|||
/**
|
||||
* Add a node with exactly two children.
|
||||
*
|
||||
* The children must have been previously added to the tree and thei IDs can be used
|
||||
* The children must have been previously added to the tree and their IDs can be used
|
||||
* to point to them.
|
||||
*/
|
||||
auto
|
||||
|
|
|
@ -564,7 +564,7 @@ namespace mamba::util
|
|||
template <typename UnaryFunc>
|
||||
auto flat_bool_expr_tree<V>::evaluate_impl(UnaryFunc& var_eval, idx_type idx) const -> bool
|
||||
{
|
||||
// We do a tree evluation rather than a stack-based postfix evaluation to
|
||||
// We do a tree evaluation rather than a stack-based postfix evaluation to
|
||||
// avoid evaluation sub trees thanks to operator && and || short circuiting.
|
||||
assert(idx < m_tree.size());
|
||||
if (m_tree.is_leaf(idx))
|
||||
|
|
|
@ -134,7 +134,7 @@ namespace mamba::util
|
|||
friend auto
|
||||
set_difference(const flat_set<K, C, A>&, const flat_set<K, C, A>&) -> flat_set<K, C, A>;
|
||||
template <typename K, typename C, typename A>
|
||||
friend auto set_symetric_difference(const flat_set<K, C, A>&, const flat_set<K, C, A>&)
|
||||
friend auto set_symmetric_difference(const flat_set<K, C, A>&, const flat_set<K, C, A>&)
|
||||
-> flat_set<K, C, A>;
|
||||
};
|
||||
|
||||
|
@ -218,7 +218,7 @@ namespace mamba::util
|
|||
) -> flat_set<Key, Compare, Allocator>;
|
||||
|
||||
template <typename Key, typename Compare, typename Allocator>
|
||||
auto set_symetric_difference(
|
||||
auto set_symmetric_difference(
|
||||
const flat_set<Key, Compare, Allocator>& lhs,
|
||||
const flat_set<Key, Compare, Allocator>& rhs
|
||||
) -> flat_set<Key, Compare, Allocator>;
|
||||
|
@ -542,7 +542,7 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
template <typename K, typename C, typename A>
|
||||
auto set_symetric_difference(const flat_set<K, C, A>& lhs, const flat_set<K, C, A>& rhs)
|
||||
auto set_symmetric_difference(const flat_set<K, C, A>& lhs, const flat_set<K, C, A>& rhs)
|
||||
-> flat_set<K, C, A>
|
||||
{
|
||||
auto out = flat_set<K, C, A>();
|
||||
|
|
|
@ -52,7 +52,7 @@ namespace mamba::util
|
|||
bool has_node(node_id id) const;
|
||||
bool has_edge(node_id from, node_id to) const;
|
||||
|
||||
// TODO C++20 better to return a range since this search cannot be interupted from the
|
||||
// TODO C++20 better to return a range since this search cannot be interrupted from the
|
||||
// visitor
|
||||
template <typename UnaryFunc>
|
||||
UnaryFunc for_each_node_id(UnaryFunc func) const;
|
||||
|
@ -97,7 +97,7 @@ namespace mamba::util
|
|||
std::size_t m_number_of_edges = 0;
|
||||
};
|
||||
|
||||
// TODO C++20 better to return a range since this search cannot be interupted from the
|
||||
// TODO C++20 better to return a range since this search cannot be interrupted from the
|
||||
// visitor
|
||||
// TODO should let user implement reverse with a reverse view when available
|
||||
template <typename Graph, typename Visitor>
|
||||
|
|
|
@ -27,8 +27,8 @@ namespace mamba::util
|
|||
/**
|
||||
* Find the first opening parenthesis and its matching pair.
|
||||
*
|
||||
* Correctly matches parenteses together so that inner parentheses pairs are skipped.
|
||||
* Open and closing pairs need not be differents.
|
||||
* Correctly matches parentheses together so that inner parentheses pairs are skipped.
|
||||
* Open and closing pairs don't need to be different.
|
||||
* If an error is encountered, @p err is modified to contain the error, otherwise it is left
|
||||
* as it is.
|
||||
*/
|
||||
|
@ -64,7 +64,7 @@ namespace mamba::util
|
|||
* Find the last closing parenthesese and its matching pair.
|
||||
*
|
||||
* Correctly matches parenteses together so that inner parentheses pairs are skipped.
|
||||
* Open and closing pairs need not be differents.
|
||||
* Open and closing pairs don't need to be different.
|
||||
* If an error is encountered, @p err is modified to contain the error, otherwise it is left
|
||||
* as it is.
|
||||
*/
|
||||
|
@ -99,12 +99,12 @@ namespace mamba::util
|
|||
/**
|
||||
* Find a character or string, except in matching parentheses pairs.
|
||||
*
|
||||
* Find the first occurence of the given character, except if such character is inside a valid
|
||||
* Find the first occurrence of the given character, except if such character is inside a valid
|
||||
* pair of parentheses.
|
||||
* Open and closing pairs need not be differents.
|
||||
* Open and closing pairs don't need to be different.
|
||||
* If not found, ``std::string_view::npos`` is returned but no error is set as this is not
|
||||
* considered an error.
|
||||
* Due to a greedy approach, the functin may not be able to detect all errors, but will be
|
||||
* Due to a greedy approach, the function may not be able to detect all errors, but will be
|
||||
* correct when parentheses are correctly matched.
|
||||
*/
|
||||
auto find_not_in_parentheses( //
|
||||
|
@ -174,12 +174,12 @@ namespace mamba::util
|
|||
/**
|
||||
* Find the last character or string, except in matching parentheses pairs.
|
||||
*
|
||||
* Find the last occurence of the given character, except if such character is inside a valid
|
||||
* Find the last occurrence of the given character, except if such character is inside a valid
|
||||
* pair of parentheses.
|
||||
* Open and closing pairs need not be differents.
|
||||
* Open and closing pairs don't need to be different.
|
||||
* If not found, ``std::string_view::npos`` is returned but no error is set as this is not
|
||||
* considered an error.
|
||||
* Due to a greedy approach, the functin may not be able to detect all errors, but will be
|
||||
* Due to a greedy approach, the function may not be able to detect all errors, but will be
|
||||
* correct when parentheses are correctly matched.
|
||||
*/
|
||||
auto rfind_not_in_parentheses( //
|
||||
|
@ -247,7 +247,7 @@ namespace mamba::util
|
|||
) noexcept -> tl::expected<std::size_t, ParseError>;
|
||||
|
||||
/**
|
||||
* Test wether the glob pattern @p pattern matches the string @p str.
|
||||
* Test whether the glob pattern @p pattern matches the string @p str.
|
||||
*/
|
||||
[[nodiscard]] auto
|
||||
glob_match(std::string_view pattern, std::string_view str, char glob = '*') -> bool;
|
||||
|
@ -359,7 +359,7 @@ namespace mamba::util
|
|||
auto pos = start;
|
||||
while (pos != npos)
|
||||
{
|
||||
// Change depth of corresponding open/close pair, writting in index P for
|
||||
// Change depth of corresponding open/close pair, writing in index P for
|
||||
// the one not matching.
|
||||
const auto open_depth_idx = detail_parsers::find(open, text[pos]);
|
||||
const auto close_depth_idx = detail_parsers::find(close, text[pos]);
|
||||
|
@ -510,7 +510,7 @@ namespace mamba::util
|
|||
auto [last, first] = detail_parsers::find_matching_parentheses_impl(
|
||||
text,
|
||||
err,
|
||||
close, // swaped
|
||||
close, // swapped
|
||||
open,
|
||||
detail_parsers::RFindParenthesesSearcher()
|
||||
);
|
||||
|
@ -626,7 +626,7 @@ namespace mamba::util
|
|||
text,
|
||||
c,
|
||||
err,
|
||||
close, // swaped
|
||||
close, // swapped
|
||||
open,
|
||||
detail_parsers::RFindParenthesesSearcher()
|
||||
);
|
||||
|
@ -662,7 +662,7 @@ namespace mamba::util
|
|||
text,
|
||||
val,
|
||||
err,
|
||||
close, // swaped
|
||||
close, // swapped
|
||||
open,
|
||||
detail_parsers::RFindParenthesesSearcher()
|
||||
);
|
||||
|
|
|
@ -320,7 +320,7 @@ namespace mamba::util
|
|||
* defined by iterating through the ``n`` elements of the iterator pair, interleaving the
|
||||
* separator in between the elements (thus appearing ``n-1`` times).
|
||||
*
|
||||
* @param first The iterator pointing to the begining of the range of elements to join.
|
||||
* @param first The iterator pointing to the beginning of the range of elements to join.
|
||||
* @param last The iterator pointing to past the end of the range of elements to join.
|
||||
* @param func The unary function to apply to all elements (separation and truncation included).
|
||||
* @param sep The separator used in between elements.
|
||||
|
|
|
@ -84,7 +84,7 @@ namespace mamba::util
|
|||
* The fields of the URL must be percent encoded, otherwise use the individual
|
||||
* field setters to encode.
|
||||
* For instance, "https://user@email.com@mamba.org/" must be passed as
|
||||
*"https://user%40email.com@mamba.org/".The first '@' charater is part of the username
|
||||
*"https://user%40email.com@mamba.org/".The first '@' character is part of the username
|
||||
* "user@email.com" whereas the second is the URL specification for separating username
|
||||
* and hostname.
|
||||
*
|
||||
|
@ -108,13 +108,13 @@ namespace mamba::util
|
|||
/** Clear the scheme back to a defaulted value and return the old value. */
|
||||
auto clear_scheme() -> std::string;
|
||||
|
||||
/** Return wether the user is empty. */
|
||||
/** Return whether the user is empty. */
|
||||
[[nodiscard]] auto has_user() const -> bool;
|
||||
|
||||
/** Return the encoded user, or empty if none. */
|
||||
[[nodiscard]] auto user(Decode::no_type) const -> const std::string&;
|
||||
|
||||
/** Retrun the decoded user, or empty if none. */
|
||||
/** Return the decoded user, or empty if none. */
|
||||
[[nodiscard]] auto user(Decode::yes_type = Decode::yes) const -> std::string;
|
||||
|
||||
/** Set the user from a not encoded value. */
|
||||
|
@ -126,7 +126,7 @@ namespace mamba::util
|
|||
/** Clear and return the encoded user. */
|
||||
auto clear_user() -> std::string;
|
||||
|
||||
/** Return wether the password is empty. */
|
||||
/** Return whether the password is empty. */
|
||||
[[nodiscard]] auto has_password() const -> bool;
|
||||
|
||||
/** Return the encoded password, or empty if none. */
|
||||
|
@ -174,7 +174,7 @@ namespace mamba::util
|
|||
/** Clear and return the port number. */
|
||||
auto clear_port() -> std::string;
|
||||
|
||||
/** Return the encoded autority part of the URL. */
|
||||
/** Return the encoded authority part of the URL. */
|
||||
[[nodiscard]] auto authority(Credentials = Credentials::Hide) const -> std::string;
|
||||
|
||||
/** Return the encoded path, always starts with a '/'. */
|
||||
|
@ -249,7 +249,7 @@ namespace mamba::util
|
|||
*
|
||||
* Due to decoding, the outcome may not be understood by parser and usable to fetch the URL.
|
||||
* @param strip_scheme If true, remove the scheme and "localhost" on file URI.
|
||||
* @param rstrip_path If non-null, remove the given charaters at the end of the path.
|
||||
* @param rstrip_path If non-null, remove the given characters at the end of the path.
|
||||
* @param credentials Decide to keep, remove, or hide credentials.
|
||||
*/
|
||||
[[nodiscard]] auto pretty_str(
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace mamba::util
|
|||
[[nodiscard]] auto is_file_uri(std::string_view url) -> bool;
|
||||
|
||||
/**
|
||||
* Retrun true if @p url starts with a URL scheme.
|
||||
* Return true if @p url starts with a URL scheme.
|
||||
*/
|
||||
[[nodiscard]] auto url_has_scheme(std::string_view url) -> bool;
|
||||
|
||||
|
@ -68,13 +68,13 @@ namespace mamba::util
|
|||
*
|
||||
* Windows paths can be expressed in a form, called UNC, where it is possible to express a
|
||||
* server location, as in "\\hostname\folder\data.xml".
|
||||
* This can be succefully encoded in a file URI like "file://hostname/folder/data.xml"
|
||||
* This can be successfully encoded in a file URI like "file://hostname/folder/data.xml"
|
||||
* since file URI contain a part for the hostname (empty hostname file URI must start with
|
||||
* "file:///").
|
||||
* Since CURL does not support hostname in file URI, we can encode UNC hostname as part
|
||||
* of the path (called 4-slash), where it becomes "file:////hostname/folder/data.xml".
|
||||
*
|
||||
* This function leaves all non-matching URI (inluding a number of invalid URI for unkown
|
||||
* This function leaves all non-matching URI (including a number of invalid URI for unknown
|
||||
* legacy reasons taken from ``url_to_path`` in conda.common.path) unchanged.
|
||||
*
|
||||
* @see https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#unc-paths
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace mamba::util
|
|||
alt_cmp = std::forward<AlternativeCmp>(alternative_cmp) //
|
||||
](const auto& lhs, const auto& rhs) -> bool
|
||||
{
|
||||
// When alternatives are differents, compare the index.
|
||||
// When alternatives are different, compare the index.
|
||||
if (lhs.index() != rhs.index())
|
||||
{
|
||||
return int_cmp(lhs.index(), rhs.index());
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace mamba::util
|
|||
* multiple keys.
|
||||
* This can be understood as an extreme generalization of defaults: when a key is not found,
|
||||
* the behaviour is to look for another key.
|
||||
* The behaviour for generating the sequence of weaken keys is controled by the Weakener.
|
||||
* The behaviour for generating the sequence of weaken keys is controlled by the Weakener.
|
||||
*/
|
||||
template <typename Map, typename Weakener>
|
||||
class weakening_map : private Map
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace mamba
|
|||
{
|
||||
if (!fs::exists(pkgs_dir))
|
||||
{
|
||||
// TODO : us tl::expected mechanis
|
||||
// TODO : us tl::expected mechanism
|
||||
throw std::runtime_error("Specified pkgs_dir does not exist\n");
|
||||
}
|
||||
auto sprefix_data = PrefixData::create(pkgs_dir, channel_context);
|
||||
|
|
|
@ -532,7 +532,7 @@ namespace mamba
|
|||
auto& spec_file_env_name = config.at("spec_file_env_name");
|
||||
auto& spec_file_name = spec_file_env_name.value<std::string>();
|
||||
|
||||
// Allow spec file environment name to be overriden by target prefix
|
||||
// Allow spec file environment name to be overridden by target prefix
|
||||
if (env_name.cli_configured() && config.at("target_prefix").cli_configured())
|
||||
{
|
||||
LOG_ERROR << "Cannot set both prefix and env name";
|
||||
|
@ -1251,7 +1251,7 @@ namespace mamba
|
|||
.set_env_var_names({ "CONDA_SUBDIR", "MAMBA_PLATFORM" })
|
||||
.description("The platform description")
|
||||
.long_description(unindent(R"(
|
||||
The plaftorm description points what channels
|
||||
The platform description points what channels
|
||||
subdir/platform have to be fetched for package solving.
|
||||
This can be 'linux-64' or similar.)")));
|
||||
|
||||
|
@ -1349,7 +1349,7 @@ namespace mamba
|
|||
.description("Custom multichannels")
|
||||
.long_description( //
|
||||
"A dictionary where keys are multi channels names, and values are a list "
|
||||
"of correspinding names / urls / file paths to use.\n"
|
||||
"of corresponding names / urls / file paths to use.\n"
|
||||
)
|
||||
.needs({ "default_channels", "target_prefix", "root_prefix" }));
|
||||
|
||||
|
@ -1387,8 +1387,8 @@ namespace mamba
|
|||
.set_env_var_names()
|
||||
.description("Path (file or directory) SSL certificate(s)")
|
||||
.long_description(unindent(R"(
|
||||
Path (file or directory) SSL certificate(s) to use whe
|
||||
'ssl_verify' in turned on but not set with path to certs.
|
||||
Path (file or directory) SSL certificate(s) to use when
|
||||
'ssl_verify' is turned on but not set with path to certs.
|
||||
WARNING: overrides 'ssl_verify' if provided and 'ssl_verify'
|
||||
also contains a path to SSL certificates.)")));
|
||||
|
||||
|
|
|
@ -581,7 +581,7 @@ namespace mamba
|
|||
{
|
||||
auto out = Console::stream();
|
||||
print_request_pins_to(request, out);
|
||||
// Console stream prints on destrucion
|
||||
// Console stream prints on destruction
|
||||
}
|
||||
|
||||
auto outcome = solver::libsolv::Solver().solve(db, request).value();
|
||||
|
@ -637,10 +637,10 @@ namespace mamba
|
|||
Console::instance().json_write({ { "success", true } });
|
||||
|
||||
// The point here is to delete the database before executing the transaction.
|
||||
// The database can have high memrory impact, and so can installing pacakges as it
|
||||
// The database can have high memrory impact, and so can installing packages as it
|
||||
// requires downloading, extracgint, and launching Python interpreters for
|
||||
// creating ``.pyc`` files.
|
||||
// Ideally this whole function should be properly refactored and the transction itself
|
||||
// Ideally this whole function should be properly refactored and the transaction itself
|
||||
// should not need the database.
|
||||
auto trans = [&](auto db)
|
||||
{
|
||||
|
|
|
@ -160,7 +160,7 @@ namespace mamba
|
|||
.value();
|
||||
const auto& installed = prefix_data.records();
|
||||
// TODO should itreate over all packages and use MatchSpec.contains
|
||||
// TODO should move such method over Pool for consitent use
|
||||
// TODO should move such method over Pool for consistent use
|
||||
if (auto iter = installed.find(spec.name().str()); iter != installed.cend())
|
||||
{
|
||||
pkgs_to_remove.push_back(iter->second);
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace mamba
|
|||
void shell_hook(Context& ctx, const std::string& shell_type)
|
||||
{
|
||||
auto activator = make_activator(ctx, shell_type);
|
||||
// TODO do we need to do something wtih `shell_prefix -> root_prefix?`?
|
||||
// TODO do we need to do something with `shell_prefix -> root_prefix?`?
|
||||
if (ctx.output_params.json)
|
||||
{
|
||||
Console::instance().json_write({ { "success", true },
|
||||
|
|
|
@ -160,7 +160,7 @@ namespace mamba
|
|||
{
|
||||
auto out = Console::stream();
|
||||
print_request_pins_to(request, out);
|
||||
// Console stream prints on destrucion
|
||||
// Console stream prints on destruction
|
||||
}
|
||||
|
||||
auto outcome = solver::libsolv::Solver().solve(db, request).value();
|
||||
|
|
|
@ -177,7 +177,7 @@ namespace mamba
|
|||
params.custom_multichannels.emplace("local", std::move(channels));
|
||||
}
|
||||
|
||||
// Called after to guarentee there are no custom multichannels when calling
|
||||
// Called after to guarantee there are no custom multichannels when calling
|
||||
// make_unique_chan.
|
||||
add_simple_params_custom_multichannel(params, ctx);
|
||||
}
|
||||
|
|
|
@ -20,8 +20,8 @@ namespace mamba
|
|||
{
|
||||
const auto now = std::chrono::steady_clock::now();
|
||||
|
||||
const auto throttle_treshold = std::chrono::milliseconds(50);
|
||||
if (now - throttle_time < throttle_treshold)
|
||||
const auto throttle_threshold = std::chrono::milliseconds(50);
|
||||
if (now - throttle_time < throttle_threshold)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -198,7 +198,7 @@ namespace mamba
|
|||
default:
|
||||
{
|
||||
return tl::unexpected(EnvLockFileError::make_error(
|
||||
file_parsing_error_code::unsuported_version,
|
||||
file_parsing_error_code::unsupported_version,
|
||||
fmt::format(
|
||||
"Failed to read environment lockfile at '{}' : unknown version '{}'",
|
||||
file_path.string(),
|
||||
|
|
|
@ -56,7 +56,7 @@ namespace mamba
|
|||
return m_data;
|
||||
}
|
||||
|
||||
constexpr const char* mamba_aggregated_error::m_base_message; // = "Many errors occured:\n";
|
||||
constexpr const char* mamba_aggregated_error::m_base_message; // = "Many errors occurred:\n";
|
||||
|
||||
mamba_aggregated_error::mamba_aggregated_error(error_list_t&& error_list)
|
||||
: base_type(mamba_aggregated_error::m_base_message, mamba_error_code::aggregated)
|
||||
|
|
|
@ -115,7 +115,7 @@ namespace mamba
|
|||
}
|
||||
|
||||
// Flip known problematic edges.
|
||||
// This is made to adress cycles but there is no straightforward way to make
|
||||
// This is made to address cycles but there is no straightforward way to make
|
||||
// a generic cycle handler so we instead force flip the given edges
|
||||
static constexpr auto edges_to_flip = std::array{ std::pair{ "pip", "python" } };
|
||||
for (const auto& [from, to] : edges_to_flip)
|
||||
|
|
|
@ -154,7 +154,7 @@ namespace cursor
|
|||
|
||||
namespace mamba
|
||||
{
|
||||
// TODO: bytes sould be size_t and the implementation is wrong
|
||||
// TODO: bytes should be size_t and the implementation is wrong
|
||||
void to_human_readable_filesize(std::ostream& o, double bytes, std::size_t precision)
|
||||
{
|
||||
static constexpr const char* sizes[] = { " B", "kB", "MB", "GB", "TB", "PB" };
|
||||
|
@ -755,7 +755,7 @@ namespace mamba
|
|||
+ postfix.width() + elapsed.width() + 1;
|
||||
|
||||
// Add extra whitespaces between fields (prefix, progress,
|
||||
// and elasped fields are assumed always displayed)
|
||||
// and elapsed fields are assumed always displayed)
|
||||
if (current)
|
||||
{
|
||||
total_width += 1;
|
||||
|
@ -836,7 +836,7 @@ namespace mamba
|
|||
}
|
||||
|
||||
// Redistribute available space
|
||||
// 1: start with the prefix if it was shrinked
|
||||
// 1: start with the prefix if it was shrunk
|
||||
if (total_width < max_width && prefix && prefix.width() < prefix_min_width)
|
||||
{
|
||||
if ((max_width - total_width) < (prefix_min_width - prefix.width()))
|
||||
|
|
|
@ -148,8 +148,8 @@ namespace mamba
|
|||
// This is an approximation.
|
||||
// Resolving all depenndencies, even of a single Matchspec isnot as simple
|
||||
// as taking any package matching a dependency recursively.
|
||||
// Package dependencies can appear mulitple time, further reducing its valid set.
|
||||
// To do this properly, we should instanciate a solver and resolve the spec.
|
||||
// Package dependencies can appear multiple time, further reducing its valid set.
|
||||
// To do this properly, we should instantiate a solver and resolve the spec.
|
||||
const auto ms = specs::MatchSpec::parse(dep)
|
||||
.or_else([](specs::ParseError&& err) { throw std::move(err); })
|
||||
.value();
|
||||
|
@ -871,7 +871,7 @@ namespace mamba
|
|||
for (auto id : m_pkg_id_list)
|
||||
{
|
||||
nlohmann::json pkg_info_json = m_dep_graph.node(id);
|
||||
// We want the cannonical channel name here.
|
||||
// We want the canonical channel name here.
|
||||
// We do not know what is in the `channel` field so we need to make sure.
|
||||
// This is most likely legacy and should be updated on the next major release.
|
||||
pkg_info_json["channel"] = cut_subdir(
|
||||
|
@ -886,7 +886,7 @@ namespace mamba
|
|||
if (!m_dep_graph.successors(0).empty())
|
||||
{
|
||||
nlohmann::json pkg_info_json = m_dep_graph.node(0);
|
||||
// We want the cannonical channel name here.
|
||||
// We want the canonical channel name here.
|
||||
// We do not know what is in the `channel` field so we need to make sure.
|
||||
// This is most likely legacy and should be updated on the next major release.
|
||||
pkg_info_json["channel"] = cut_subdir(
|
||||
|
|
|
@ -31,7 +31,7 @@ namespace mamba
|
|||
// Other static objects from other translation units can be destroyed in parallel to the ones
|
||||
// here as C++ does not guarantee any order of destruction after `main()`.
|
||||
|
||||
//--- Dependencie's singletons
|
||||
//--- Dependencies singletons
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
|
||||
|
@ -106,7 +106,7 @@ namespace mamba
|
|||
static std::atomic<MainExecutor*> main_executor{ nullptr };
|
||||
|
||||
static std::unique_ptr<MainExecutor> default_executor;
|
||||
static std::mutex default_executor_mutex; // TODO: replace by sychronized_value once available
|
||||
static std::mutex default_executor_mutex; // TODO: replace by synchronized_value once available
|
||||
|
||||
MainExecutor& MainExecutor::instance()
|
||||
{
|
||||
|
|
|
@ -414,7 +414,7 @@ namespace mamba
|
|||
catch (...)
|
||||
{
|
||||
return make_unexpected(
|
||||
"Unkown error when trying to load subdir data "
|
||||
"Unknown error when trying to load subdir data "
|
||||
+ SubdirData::get_name(channel.id(), platform),
|
||||
mamba_error_code::unknown
|
||||
);
|
||||
|
@ -624,7 +624,7 @@ namespace mamba
|
|||
|
||||
for (const fs::u8path& cache_path : cache_paths)
|
||||
{
|
||||
// TODO: rewite this with pipe chains of ranges
|
||||
// TODO: rewrite this with pipe chains of ranges
|
||||
fs::u8path json_file = cache_path / "cache" / m_json_fn;
|
||||
if (!fs::is_regular_file(json_file))
|
||||
{
|
||||
|
|
|
@ -295,7 +295,7 @@ namespace mamba
|
|||
std::string line;
|
||||
while (std::getline(file_stream, line))
|
||||
{
|
||||
// Remove the trailing \r to accomodate Windows line endings.
|
||||
// Remove the trailing \r to accommodate Windows line endings.
|
||||
if ((!line.empty()) && (line.back() == '\r'))
|
||||
{
|
||||
line.pop_back();
|
||||
|
@ -366,7 +366,7 @@ namespace mamba
|
|||
bs_buf.clear();
|
||||
if (!result.empty())
|
||||
{
|
||||
// seperate arguments
|
||||
// separate arguments
|
||||
result += " ";
|
||||
}
|
||||
|
||||
|
@ -451,7 +451,7 @@ namespace mamba
|
|||
std::size_t clean_trash_files(const fs::u8path& prefix, bool deep_clean)
|
||||
{
|
||||
std::size_t deleted_files = 0;
|
||||
std::size_t remainig_trash = 0;
|
||||
std::size_t remaining_trash = 0;
|
||||
std::error_code ec;
|
||||
std::vector<fs::u8path> remaining_files;
|
||||
auto trash_txt = prefix / "conda-meta" / "mamba_trash.txt";
|
||||
|
@ -469,7 +469,7 @@ namespace mamba
|
|||
else
|
||||
{
|
||||
LOG_INFO << "Trash: could not remove " << full_path;
|
||||
remainig_trash += 1;
|
||||
remaining_trash += 1;
|
||||
// save relative path
|
||||
remaining_files.push_back(f);
|
||||
}
|
||||
|
@ -496,7 +496,7 @@ namespace mamba
|
|||
}
|
||||
else
|
||||
{
|
||||
remainig_trash += 1;
|
||||
remaining_trash += 1;
|
||||
// save relative path
|
||||
remaining_files.push_back(fs::relative(p, prefix));
|
||||
}
|
||||
|
@ -519,7 +519,7 @@ namespace mamba
|
|||
}
|
||||
}
|
||||
|
||||
LOG_INFO << "Cleaned " << deleted_files << " .mamba_trash files. " << remainig_trash
|
||||
LOG_INFO << "Cleaned " << deleted_files << " .mamba_trash files. " << remaining_trash
|
||||
<< " remaining.";
|
||||
return deleted_files;
|
||||
}
|
||||
|
|
|
@ -147,9 +147,9 @@ namespace mamba
|
|||
"with the fall 2016 \"Anniversary update\" or newer.";
|
||||
return false;
|
||||
}
|
||||
auto splitted = util::split(win_ver.value(), ".");
|
||||
if (!(splitted.size() >= 3 && std::stoull(splitted[0]) >= 10
|
||||
&& std::stoull(splitted[2]) >= 14352))
|
||||
auto split_out = util::split(win_ver.value(), ".");
|
||||
if (!(split_out.size() >= 3 && std::stoull(split_out[0]) >= 10
|
||||
&& std::stoull(split_out[2]) >= 14352))
|
||||
{
|
||||
LOG_WARNING << "Not setting long path registry key; Windows version must be at least 10 "
|
||||
"with the fall 2016 \"Anniversary update\" or newer.";
|
||||
|
@ -414,9 +414,9 @@ namespace mamba
|
|||
|
||||
if (auto version = util::windows_version())
|
||||
{
|
||||
auto splitted = util::split(version.value(), '.');
|
||||
if (splitted.size() >= 3 && std::stoull(splitted[0]) >= 10
|
||||
&& std::stoull(splitted[2]) >= 15063)
|
||||
auto split_out = util::split(version.value(), '.');
|
||||
if (split_out.size() >= 3 && std::stoull(split_out[0]) >= 10
|
||||
&& std::stoull(split_out[2]) >= 15063)
|
||||
{
|
||||
features.true_colors = true;
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace mamba::solver
|
|||
|
||||
auto python_binary_compatible(const specs::Version& older, const specs::Version& newer) -> bool
|
||||
{
|
||||
// Python binary compatiblity is defined athe the same MINOR level.
|
||||
// Python binary compatibility is defined at the same MINOR level.
|
||||
return older.compatible_with(newer, /* level= */ 2);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -860,7 +860,7 @@ namespace mamba::solver::libsolv
|
|||
// Locking on a spec applies the lock to all packages matching the spec.
|
||||
// In mamba, we do not want to lock the package because we want to allow other variants
|
||||
// (matching the same spec) to unlock more solutions.
|
||||
// For instance we may pin ``libfmt=8.*`` but allow it to be swaped with a version built
|
||||
// For instance we may pin ``libfmt=8.*`` but allow it to be swapped with a version built
|
||||
// by a more recent compiler.
|
||||
//
|
||||
// A previous version of this function would use ``SOLVER_LOCK`` to lock all packages not
|
||||
|
@ -870,7 +870,7 @@ namespace mamba::solver::libsolv
|
|||
//
|
||||
// Another wrong idea is to add the pin as an install job.
|
||||
// This is not what is expected of pins, as they must not be installed if they were not
|
||||
// in the environement.
|
||||
// in the environment.
|
||||
// They can be configure in ``.condarc`` for generally specifying what versions are wanted.
|
||||
//
|
||||
// The idea behind the current version is to add the pin/spec as a constraint that must be
|
||||
|
@ -898,7 +898,7 @@ namespace mamba::solver::libsolv
|
|||
// If the installed repo does not exists, we can safely create it because this is
|
||||
// called right before the solve function.
|
||||
// If it gets modified latter on the pin should not interfere with user packages.
|
||||
// If it gets overriden this it is not a problem for the solve because pins are added
|
||||
// If it gets overridden this it is not a problem for the solve because pins are added
|
||||
// on each solve.
|
||||
auto [id, repo] = pool.add_repo("installed");
|
||||
pool.set_installed_repo(id);
|
||||
|
@ -991,7 +991,7 @@ namespace mamba::solver::libsolv
|
|||
|
||||
// We can specifically filter out packages, for things such as deps-only or
|
||||
// no-deps.
|
||||
// We add them as ommited anyhow so that downstream code can print them for
|
||||
// We add them as omitted anyhow so that downstream code can print them for
|
||||
// instance.
|
||||
if (!filter(pkginfo))
|
||||
{
|
||||
|
@ -1476,7 +1476,7 @@ namespace mamba::solver::libsolv
|
|||
// Pins add solvables to Pol and hence require a call to create_whatprovides.
|
||||
// For some reason we need to add them first.
|
||||
pool.create_whatprovides();
|
||||
for (const auto& unkown_job : request.jobs)
|
||||
for (const auto& unknown_job : request.jobs)
|
||||
{
|
||||
auto xpt = std::visit(
|
||||
[&](const auto& job) -> expected_t<void>
|
||||
|
@ -1487,7 +1487,7 @@ namespace mamba::solver::libsolv
|
|||
}
|
||||
return {};
|
||||
},
|
||||
unkown_job
|
||||
unknown_job
|
||||
);
|
||||
if (!xpt)
|
||||
{
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
#include "solver/libsolv/matcher.hpp"
|
||||
|
||||
/**
|
||||
* Solver, repo, and solvable helpers dependent on specifi libsolv logic and objects.
|
||||
* Solver, repo, and solvable helpers are dependent on specific libsolv logic and objects.
|
||||
*/
|
||||
|
||||
namespace mamba::fs
|
||||
|
|
|
@ -186,7 +186,7 @@ namespace mamba::solver::libsolv
|
|||
Matcher::get_channels(const specs::UnresolvedChannel& uc) -> expected_t<channel_list_const_ref>
|
||||
{
|
||||
// Channel maps require converting channel to string because unresolved channels are
|
||||
// akward to compare.
|
||||
// awkward to compare.
|
||||
auto str = uc.str();
|
||||
if (const auto it = m_channel_cache.find(str); it != m_channel_cache.end())
|
||||
{
|
||||
|
|
|
@ -172,7 +172,7 @@ namespace mamba::solver::libsolv
|
|||
void warn_unexpected_problem(const SolverProblem& problem)
|
||||
{
|
||||
// TODO: Once the new error message are not experimental, we should consider
|
||||
// reducing this level since it is not somethig the user has control over.
|
||||
// reducing this level since it is not something the user has control over.
|
||||
LOG_WARNING << "Unexpected empty optionals for problem type "
|
||||
<< solv::enum_name(problem.type);
|
||||
}
|
||||
|
@ -462,7 +462,7 @@ namespace mamba::solver::libsolv
|
|||
{
|
||||
// A package dependency does not exist.
|
||||
// Could be a wrong name or missing channel.
|
||||
// This is a partial exaplanation of why a specific solvable (could be any
|
||||
// This is a partial explanation of why a specific solvable (could be any
|
||||
// of the parent) cannot be installed.
|
||||
if (!source || !dep)
|
||||
{
|
||||
|
@ -486,7 +486,7 @@ namespace mamba::solver::libsolv
|
|||
{
|
||||
// Looking for a valid solution to the installation satisfiability expand to
|
||||
// two solvables of same package that cannot be installed together. This is
|
||||
// a partial exaplanation of why one of the solvables (could be any of the
|
||||
// a partial explanation of why one of the solvables (could be any of the
|
||||
// parent) cannot be installed.
|
||||
if (!source || !target)
|
||||
{
|
||||
|
@ -533,7 +533,7 @@ namespace mamba::solver::libsolv
|
|||
}
|
||||
default:
|
||||
{
|
||||
// Many more SolverRuleinfo that heve not been encountered.
|
||||
// Many more SolverRuleinfo that have not been encountered.
|
||||
LOG_WARNING << "Problem type not implemented " << solv::enum_name(type);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace mamba::solver
|
|||
for (const auto& [id, id_conflicts] : old_conflicts)
|
||||
{
|
||||
// We are trying to detect node that are in conflicts but are not leaves.
|
||||
// This shows up in Pyhon dependencies because the constraint on ``python`` and
|
||||
// This shows up in Python dependencies because the constraint on ``python`` and
|
||||
// ``python_abi`` was reversed.
|
||||
if (has_constraint_child(id))
|
||||
{
|
||||
|
@ -94,10 +94,10 @@ namespace mamba::solver
|
|||
// between the ``id_child`` and the parents ``c_parent`` of the ``c``.
|
||||
// This is a bit hacky but the intuition is to replicate the structure of
|
||||
// nodes conflicting with ``id_child`` with ``c_parent``.
|
||||
// They likely reprensent the same thing and so we want them to be able to
|
||||
// They likely represent the same thing and so we want them to be able to
|
||||
// merge later on.
|
||||
|
||||
// id_child may alrady have been removed through a preivous iteration
|
||||
// id_child may already have been removed through a previous iteration
|
||||
if (graph.has_node(id_child) && is_constraint(old_graph.node(c)))
|
||||
{
|
||||
for (const node_id c_parent : old_graph.predecessors(c))
|
||||
|
@ -133,8 +133,8 @@ namespace mamba::solver
|
|||
* that will be merged together.
|
||||
*
|
||||
* @param node_indices The indices of nodes of a given type.
|
||||
* @param merge_criteria A binary function that decices whether two nodes should be merged
|
||||
* together. The function is assumed to be symetric and transitive.
|
||||
* @param merge_criteria A binary function that decides whether two nodes should be merged
|
||||
* together. The function is assumed to be symmetric and transitive.
|
||||
* @return A partition of the the indices in @p node_indices.
|
||||
*/
|
||||
template <typename CompFunc>
|
||||
|
@ -157,7 +157,7 @@ namespace mamba::solver
|
|||
std::vector<node_id> current_group{};
|
||||
current_group.push_back(id_i);
|
||||
node_added_to_a_group[i] = true;
|
||||
// This is where we use symetry and transitivity, going through all remaining
|
||||
// This is where we use symmetry and transitivity, going through all remaining
|
||||
// nodes and adding them to the current group if they match the criteria.
|
||||
for (std::size_t j = i + 1; j < n_nodes; ++j)
|
||||
{
|
||||
|
@ -208,8 +208,8 @@ namespace mamba::solver
|
|||
*
|
||||
* Merge by applying the @p merge_criteria to nodes that hold the same type in the variant.
|
||||
*
|
||||
* @param merge_criteria A binary function that decices whether two nodes should be merged
|
||||
* together. The function is assumed to be symetric and transitive.
|
||||
* @param merge_criteria A binary function that decides whether two nodes should be merged
|
||||
* together. The function is assumed to be symmetric and transitive.
|
||||
* @return For each node type, a partition of the the indices in @p of that type..
|
||||
*/
|
||||
template <typename CompFunc>
|
||||
|
@ -438,8 +438,8 @@ namespace mamba::solver
|
|||
*
|
||||
* Merge by applying the @p merge_criteria to nodes that hold the same type in the variant.
|
||||
*
|
||||
* @param merge_criteria A binary function that decices whether two nodes should be merged
|
||||
* together. The function is assumed to be symetric and transitive.
|
||||
* @param merge_criteria A binary function that decides whether two nodes should be merged
|
||||
* together. The function is assumed to be symmetric and transitive.
|
||||
* @return A tuple of the graph with newly created nodes (without edges), the new root node,
|
||||
* and a mapping between old node ids and new node ids.
|
||||
*/
|
||||
|
@ -733,7 +733,7 @@ namespace mamba::solver
|
|||
) const -> std::pair<std::string, std::size_t>
|
||||
{
|
||||
auto builds = std::vector<std::string>(size());
|
||||
// TODO(C++20) *this | std::ranges::transform(invoke_buid_string) | ranges::unique
|
||||
// TODO(C++20) *this | std::ranges::transform(invoke_build_string) | ranges::unique
|
||||
std::transform(
|
||||
begin(),
|
||||
end(),
|
||||
|
@ -840,7 +840,7 @@ namespace mamba::solver
|
|||
last = true,
|
||||
};
|
||||
|
||||
/** Progagate a status up the tree, such as whether the package is installable. */
|
||||
/** Propagate a status up the tree, such as whether the package is installable. */
|
||||
using Status = bool;
|
||||
|
||||
using node_id = CompressedProblemsGraph::node_id;
|
||||
|
@ -867,7 +867,7 @@ namespace mamba::solver
|
|||
*
|
||||
* We need to reimplement a DFS algorithm instead of using the one provided by the one
|
||||
* from DiGraph because we need a more complex exploration, including:
|
||||
* - Controling the order in which neighbors are explored;
|
||||
* - Controlling the order in which neighbors are explored;
|
||||
* - Dynamically adding and removing nodes;
|
||||
* - Executing some operations before and after a node is visited;
|
||||
* - Propagating information from the exploration of the subtree back to the current
|
||||
|
@ -920,7 +920,7 @@ namespace mamba::solver
|
|||
* Function to decide if a node is not installable.
|
||||
*
|
||||
* For a leaf this sets the final status.
|
||||
* For other nodes, a pacakge could still be not installable because of its children.
|
||||
* For other nodes, a package could still be not installable because of its children.
|
||||
*/
|
||||
auto node_not_installable(node_id id) -> Status;
|
||||
|
||||
|
@ -1005,7 +1005,7 @@ namespace mamba::solver
|
|||
return false;
|
||||
}
|
||||
|
||||
// Assuming any other type of leave is a kind of problem and other nodes not.
|
||||
// Assuming any other type of leaves is a kind of problem and other nodes not.
|
||||
return m_pbs.graph().successors(id).size() == 0;
|
||||
}
|
||||
|
||||
|
@ -1016,7 +1016,7 @@ namespace mamba::solver
|
|||
const bool is_visited = m_node_visited.at(id).has_value();
|
||||
// We purposefully check if the node is a leaf before checking if it
|
||||
// is visited because showing a single node again is more intelligible than
|
||||
// refering to another one.
|
||||
// referring to another one.
|
||||
if (!has_successors)
|
||||
{
|
||||
return TreeNode::Type::leaf;
|
||||
|
@ -1041,7 +1041,7 @@ namespace mamba::solver
|
|||
std::string key = edge.name();
|
||||
if (!name_only)
|
||||
{
|
||||
// Making up an arbitrary string represnetation of the edge
|
||||
// Making up an arbitrary string representation of the edge
|
||||
key += edge.versions_and_build_strings_trunc(
|
||||
"",
|
||||
"",
|
||||
|
@ -1096,7 +1096,7 @@ namespace mamba::solver
|
|||
const auto child_pos = last ? SiblingNumber::last : SiblingNumber::not_last;
|
||||
Status status;
|
||||
std::tie(out, status) = visit_node(children_ids[i], child_pos, ongoing, out);
|
||||
// If there are any valid option in the split, the split is iself valid.
|
||||
// If there are any valid options in the split, the split is itself valid.
|
||||
ongoing.status |= status;
|
||||
}
|
||||
|
||||
|
@ -1350,7 +1350,7 @@ namespace mamba::solver
|
|||
}
|
||||
else
|
||||
{
|
||||
// Single depenency with only name constraint often end up looking like
|
||||
// Single dependency with only name constraint often end up looking like
|
||||
// ``python =* *`` so we strip all this.
|
||||
// Best would be to handle this with a richer NamedList that contains
|
||||
// ``VersionSpecs`` to avoid flaky reliance on string modification.
|
||||
|
|
|
@ -126,7 +126,7 @@ fmt::formatter<mamba::specs::BuildNumberPredicate>::format(
|
|||
using Op = std::decay_t<decltype(op)>;
|
||||
if constexpr (std::is_same_v<Op, BuildNumberPredicate::free_interval>)
|
||||
{
|
||||
out = fmt::format_to(out, "{}", BuildNumberSpec::prefered_free_str);
|
||||
out = fmt::format_to(out, "{}", BuildNumberSpec::preferred_free_str);
|
||||
}
|
||||
if constexpr (std::is_same_v<Op, std::equal_to<BuildNumber>>)
|
||||
{
|
||||
|
|
|
@ -305,7 +305,7 @@ namespace mamba::specs
|
|||
if (!plat.has_value())
|
||||
{
|
||||
throw std::invalid_argument(
|
||||
fmt::format(R"(No platform in orignial path "{}")", path(Decode::no))
|
||||
fmt::format(R"(No platform in original path "{}")", path(Decode::no))
|
||||
);
|
||||
}
|
||||
assert(1 < len);
|
||||
|
@ -351,7 +351,7 @@ namespace mamba::specs
|
|||
|
||||
auto CondaURL::package(Decode::no_type) const -> std::string_view
|
||||
{
|
||||
// Must not decode to find the meaningful '/' spearators
|
||||
// Must not decode to find the meaningful '/' separators
|
||||
const auto& l_path = path(Decode::no);
|
||||
if (has_archive_extension(l_path))
|
||||
{
|
||||
|
@ -374,7 +374,7 @@ namespace mamba::specs
|
|||
fmt::format(R"(Invalid CondaURL package "{}", use path_append instead)", pkg)
|
||||
);
|
||||
}
|
||||
// Must not decode to find the meaningful '/' spearators
|
||||
// Must not decode to find the meaningful '/' separators
|
||||
if (has_archive_extension(path(Decode::no)))
|
||||
{
|
||||
auto l_path = clear_path();
|
||||
|
@ -390,7 +390,7 @@ namespace mamba::specs
|
|||
|
||||
auto CondaURL::clear_package() -> bool
|
||||
{
|
||||
// Must not decode to find the meaningful '/' spearators
|
||||
// Must not decode to find the meaningful '/' separators
|
||||
if (has_archive_extension(path(Decode::no)))
|
||||
{
|
||||
auto l_path = clear_path();
|
||||
|
|
|
@ -80,16 +80,16 @@ namespace mamba::specs
|
|||
namespace
|
||||
{
|
||||
inline constexpr auto open_or_quote_tokens = std::array{
|
||||
MatchSpec::prefered_list_open,
|
||||
MatchSpec::preferred_list_open,
|
||||
MatchSpec::alt_list_open,
|
||||
MatchSpec::prefered_quote,
|
||||
MatchSpec::preferred_quote,
|
||||
MatchSpec::alt_quote,
|
||||
};
|
||||
|
||||
inline constexpr auto close_or_quote_tokens = std::array{
|
||||
MatchSpec::prefered_list_close,
|
||||
MatchSpec::preferred_list_close,
|
||||
MatchSpec::alt_list_close,
|
||||
MatchSpec::prefered_quote,
|
||||
MatchSpec::preferred_quote,
|
||||
MatchSpec::alt_quote,
|
||||
};
|
||||
|
||||
|
@ -180,7 +180,7 @@ namespace mamba::specs
|
|||
return util::strip_if(
|
||||
str,
|
||||
[](char c) -> bool {
|
||||
return !util::is_graphic(c) || (c == MatchSpec::prefered_quote)
|
||||
return !util::is_graphic(c) || (c == MatchSpec::preferred_quote)
|
||||
|| (c == MatchSpec::alt_quote);
|
||||
}
|
||||
|
||||
|
@ -410,7 +410,7 @@ namespace mamba::specs
|
|||
// - ``target=blarg,optional``
|
||||
// - ``build=3``
|
||||
|
||||
if (!util::ends_with(str, MatchSpec::prefered_list_close)
|
||||
if (!util::ends_with(str, MatchSpec::preferred_list_close)
|
||||
&& !util::ends_with(str, MatchSpec::alt_list_close))
|
||||
{
|
||||
return str;
|
||||
|
@ -1107,7 +1107,7 @@ fmt::formatter<::mamba::specs::MatchSpec>::format(
|
|||
out = fmt::format_to(
|
||||
out,
|
||||
"{}",
|
||||
bracket_written ? MatchSpec::attribute_sep : MatchSpec::prefered_list_open
|
||||
bracket_written ? MatchSpec::attribute_sep : MatchSpec::preferred_list_open
|
||||
);
|
||||
bracket_written = true;
|
||||
};
|
||||
|
@ -1115,7 +1115,7 @@ fmt::formatter<::mamba::specs::MatchSpec>::format(
|
|||
{
|
||||
if (bracket_written)
|
||||
{
|
||||
out = fmt::format_to(out, "{}", MatchSpec::prefered_list_close);
|
||||
out = fmt::format_to(out, "{}", MatchSpec::preferred_list_close);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -1124,18 +1124,18 @@ fmt::formatter<::mamba::specs::MatchSpec>::format(
|
|||
if (const auto& ver = spec.version(); !ver.is_explicitly_free())
|
||||
{
|
||||
ensure_bracket_open_or_comma();
|
||||
out = fmt::format_to(out, "version={0}{1}{0}", MatchSpec::prefered_quote, ver);
|
||||
out = fmt::format_to(out, "version={0}{1}{0}", MatchSpec::preferred_quote, ver);
|
||||
}
|
||||
if (const auto& bs = spec.build_string(); !bs.is_explicitly_free())
|
||||
{
|
||||
ensure_bracket_open_or_comma();
|
||||
out = fmt::format_to(out, "build={0}{1}{0}", MatchSpec::prefered_quote, bs);
|
||||
out = fmt::format_to(out, "build={0}{1}{0}", MatchSpec::preferred_quote, bs);
|
||||
}
|
||||
}
|
||||
if (const auto& num = spec.build_number(); !num.is_explicitly_free())
|
||||
{
|
||||
ensure_bracket_open_or_comma();
|
||||
out = fmt::format_to(out, "build_number={0}{1}{0}", MatchSpec::prefered_quote, num);
|
||||
out = fmt::format_to(out, "build_number={0}{1}{0}", MatchSpec::preferred_quote, num);
|
||||
}
|
||||
if (const auto& tf = spec.track_features(); tf.has_value() && !tf->get().empty())
|
||||
{
|
||||
|
@ -1143,7 +1143,7 @@ fmt::formatter<::mamba::specs::MatchSpec>::format(
|
|||
out = fmt::format_to(
|
||||
out,
|
||||
"track_features={0}{1}{0}",
|
||||
MatchSpec::prefered_quote,
|
||||
MatchSpec::preferred_quote,
|
||||
fmt::join(tf->get(), std::string_view(&MatchSpec::feature_sep.front(), 1))
|
||||
);
|
||||
}
|
||||
|
|
|
@ -181,7 +181,7 @@ namespace mamba::specs
|
|||
if (m_type == Type::Unknown)
|
||||
{
|
||||
m_location = unknown_channel;
|
||||
// Allowing in any platform filters for unkown type can be useful in MatchSpec
|
||||
// Allowing in any platform filters for unknown type can be useful in MatchSpec
|
||||
}
|
||||
if (m_location.empty())
|
||||
{
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace mamba::specs
|
|||
return num_ord;
|
||||
}
|
||||
|
||||
// Certain literals have sepcial meaning we map then to a priority
|
||||
// Certain literals have special meaning we map then to a priority
|
||||
// 0 meaning regular string
|
||||
auto lit_priority = [](const auto& l) -> int
|
||||
{
|
||||
|
@ -142,7 +142,7 @@ namespace mamba::specs
|
|||
|
||||
auto VersionPartAtom::operator==(const VersionPartAtom& other) const -> bool
|
||||
{
|
||||
// More efficient thatn three way comparison because of edge cases
|
||||
// More efficient than three way comparison because of edge cases
|
||||
auto attrs = [](const VersionPartAtom& a) -> std::tuple<std::size_t, const std::string&>
|
||||
{ return { a.numeral(), a.literal() }; };
|
||||
return attrs(*this) == attrs(other);
|
||||
|
@ -150,7 +150,7 @@ namespace mamba::specs
|
|||
|
||||
auto VersionPartAtom::operator!=(const VersionPartAtom& other) const -> bool
|
||||
{
|
||||
// More efficient thatn three way comparison
|
||||
// More efficient than three way comparison
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ namespace mamba::specs
|
|||
auto Version::str(std::size_t level) const -> std::string
|
||||
{
|
||||
// We should be able to do, as it works with numbers but it is not clear how this works
|
||||
// with the cusotm parser
|
||||
// with the custom parser
|
||||
// return fmt::format("{:{}}", *this, level);
|
||||
auto fmt = fmt::format("{{:{}}}", level);
|
||||
return fmt::format(fmt, *this);
|
||||
|
@ -242,15 +242,15 @@ namespace mamba::specs
|
|||
namespace
|
||||
{
|
||||
/**
|
||||
* Compare two range where some trailing elements can be considered as empty.
|
||||
* Compare two ranges where some trailing elements can be considered as empty.
|
||||
*
|
||||
* If ``0`` is considered "empty" then all the ranges ``[1, 2] and ``[1, 2, 0]``,
|
||||
* ``[1, 2, 0, 0]`` are considered equal, however ``[1, 2]`` and ``[1, 0, 2]`` are not.
|
||||
* Similarily ``[1, 1] is less than ``[1, 2, 0]`` but more than ``[1, 1, -1]``
|
||||
* Similarly ``[1, 1] is less than ``[1, 2, 0]`` but more than ``[1, 1, -1]``
|
||||
* because ``-1 < 0``.
|
||||
*
|
||||
* @return The comparison between the two sequence
|
||||
* @return The first index where the two sequence diverge.
|
||||
* @return The comparison between the two sequences
|
||||
* @return The first index where the two sequences diverge.
|
||||
*/
|
||||
template <typename Iter1, typename Iter2, typename Empty1, typename Empty2, typename Cmp>
|
||||
constexpr auto lexicographical_compare_three_way_trailing(
|
||||
|
@ -277,7 +277,7 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
// They have the same leading elements but 1 has more elements
|
||||
// We do a lexicographic compare with an infite sequence of empties
|
||||
// We do a lexicographic comparison with an infinite sequence of empties
|
||||
if ((iter1 != last1))
|
||||
{
|
||||
for (; iter1 != last1; ++iter1)
|
||||
|
@ -290,7 +290,7 @@ namespace mamba::specs
|
|||
}
|
||||
// first2 != last2
|
||||
// They have the same leading elements but 2 has more elements
|
||||
// We do a lexicographic compare with an infite sequence of empties
|
||||
// We do a lexicographic comparison with an infinite sequence of empties
|
||||
if ((iter2 != last2))
|
||||
{
|
||||
for (; iter2 != last2; ++iter2)
|
||||
|
@ -671,7 +671,7 @@ namespace mamba::specs
|
|||
while (true)
|
||||
{
|
||||
tail_delim_pos = tail.find_first_of(delims);
|
||||
// `_` is both a delimiter and has sepcial meaning.
|
||||
// `_` is both a delimiter and has special meaning.
|
||||
// We need to check if it is at the end and omit it
|
||||
if ((tail_delim_pos == tail.size() - 1)
|
||||
&& tail[tail_delim_pos] == Version::part_delim_special)
|
||||
|
|
|
@ -587,7 +587,7 @@ fmt::formatter<mamba::specs::VersionSpec>::format(
|
|||
auto out = ctx.out();
|
||||
if (spec.m_tree.empty())
|
||||
{
|
||||
return fmt::format_to(out, "{}", VersionSpec::prefered_free_str);
|
||||
return fmt::format_to(out, "{}", VersionSpec::preferred_free_str);
|
||||
}
|
||||
spec.m_tree.infix_for_each(
|
||||
[&](const auto& token)
|
||||
|
|
|
@ -68,7 +68,7 @@ namespace mamba::util
|
|||
/**
|
||||
* A RAII wrapper for string mananged by CURL.
|
||||
*
|
||||
* String can possibly be null, or zero-lenght, depending on the data returned by CURL.
|
||||
* String can possibly be null, or zero-length, depending on the data returned by CURL.
|
||||
*/
|
||||
class CurlStr
|
||||
{
|
||||
|
|
|
@ -245,7 +245,7 @@ TEST_SUITE("ChannelContext")
|
|||
);
|
||||
}
|
||||
|
||||
// Explicilty override defaults
|
||||
// Explicitly override defaults
|
||||
{
|
||||
const auto& defaults = chan_ctx.params().custom_multichannels.at("defaults");
|
||||
|
||||
|
@ -371,7 +371,7 @@ TEST_SUITE("ChannelContext")
|
|||
);
|
||||
}
|
||||
|
||||
// Explicilty created defaults
|
||||
// Explicitly created defaults
|
||||
{
|
||||
const auto& defaults = chan_ctx.params().custom_multichannels.at("defaults");
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ namespace mamba
|
|||
|
||||
private:
|
||||
|
||||
// Variables to restore the original COntext state and avoid
|
||||
// Variables to restore the original Context state and avoid
|
||||
// side effect across the tests. A better solution would be to
|
||||
// save and restore the whole context (that requires refactoring
|
||||
// of the Context class)
|
||||
|
|
|
@ -48,7 +48,7 @@ namespace mamba
|
|||
const auto error = maybe_lockfile.error();
|
||||
REQUIRE_EQ(mamba_error_code::env_lockfile_parsing_failed, error.error_code());
|
||||
const auto& error_details = EnvLockFileError::get_details(error);
|
||||
CHECK_EQ(file_parsing_error_code::unsuported_version, error_details.parsing_error_code);
|
||||
CHECK_EQ(file_parsing_error_code::unsupported_version, error_details.parsing_error_code);
|
||||
}
|
||||
|
||||
TEST_CASE("valid_no_package_succeed")
|
||||
|
|
|
@ -46,7 +46,7 @@ namespace mamba
|
|||
TEST_CASE("stop_default_always_succeeds")
|
||||
{
|
||||
MainExecutor::stop_default(); // Make sure no other default main executor is running.
|
||||
MainExecutor::instance(); // Make sure we use the defaut main executor.
|
||||
MainExecutor::instance(); // Make sure we use the default main executor.
|
||||
MainExecutor::stop_default(); // Stop the default main executor and make sure it's not
|
||||
// enabled for the following tests.
|
||||
MainExecutor::stop_default(); // However the number of time we call it it should never
|
||||
|
|
|
@ -146,7 +146,7 @@ namespace mamba
|
|||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "convertion error" << std::endl;
|
||||
std::cout << "conversion error" << std::endl;
|
||||
}
|
||||
CHECK(is_locked);
|
||||
|
||||
|
@ -168,7 +168,7 @@ namespace mamba
|
|||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "convertion error" << std::endl;
|
||||
std::cout << "conversion error" << std::endl;
|
||||
}
|
||||
CHECK_FALSE(new_lock_created);
|
||||
}
|
||||
|
@ -270,7 +270,7 @@ namespace mamba
|
|||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "convertion error" << std::endl;
|
||||
std::cout << "conversion error" << std::endl;
|
||||
}
|
||||
CHECK(is_locked);
|
||||
|
||||
|
@ -292,7 +292,7 @@ namespace mamba
|
|||
}
|
||||
catch (...)
|
||||
{
|
||||
std::cout << "convertion error" << std::endl;
|
||||
std::cout << "conversion error" << std::endl;
|
||||
}
|
||||
CHECK_FALSE(new_lock_created);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ namespace mamba
|
|||
CHECK_EQ(pkgs.back().build_string.find("x86_64"), 0);
|
||||
#endif
|
||||
|
||||
// This is bad design, tests should not interfer
|
||||
// This is bad design, tests should not interfere
|
||||
// Will get rid of that when implementing context as not a singleton
|
||||
auto restore_ctx = [&ctx, old_plat = ctx.platform]() { ctx.platform = old_plat; };
|
||||
auto finally = Finally<decltype(restore_ctx)>{ restore_ctx };
|
||||
|
|
|
@ -879,7 +879,7 @@ TEST_SUITE("solver::libsolv::solver")
|
|||
);
|
||||
REQUIRE(repo_linux.has_value());
|
||||
|
||||
// FIXME the subdir is not overriden here so it is still linux-64 because that's what
|
||||
// FIXME the subdir is not overridden here so it is still linux-64 because that's what
|
||||
// is in the json file.
|
||||
// We'de want to pass option to the database to override channel and subsir.
|
||||
const auto repo_noarch = db.add_repo_from_repodata_json(
|
||||
|
|
|
@ -34,7 +34,7 @@ using namespace mamba::solver;
|
|||
|
||||
TEST_SUITE("solver::conflict_map")
|
||||
{
|
||||
TEST_CASE("symetric")
|
||||
TEST_CASE("symmetric")
|
||||
{
|
||||
auto c = conflict_map<std::size_t>();
|
||||
CHECK_EQ(c.size(), 0);
|
||||
|
@ -100,7 +100,7 @@ namespace
|
|||
/**
|
||||
* Create a solver and a database of a conflict.
|
||||
*
|
||||
* The underlying packages do not exist, we are onl interested in the conflict.
|
||||
* The underlying packages do not exist, we are only interested in the conflict.
|
||||
*/
|
||||
template <typename PkgRange>
|
||||
auto create_pkgs_database(ChannelContext& channel_context, const PkgRange& packages)
|
||||
|
@ -370,7 +370,7 @@ namespace
|
|||
const std::vector<std::string>& platforms = { "linux-64", "noarch" }
|
||||
)
|
||||
{
|
||||
// Reusing the cache for all invocation of this funciton for speedup
|
||||
// Reusing the cache for all invocations of this function for speedup
|
||||
|
||||
static const auto tmp_dir = TemporaryDirectory();
|
||||
|
||||
|
|
|
@ -851,7 +851,7 @@ TEST_SUITE("specs::channel")
|
|||
auto found_names = util::flat_set<std::string>();
|
||||
for (const auto& chan : channels)
|
||||
{
|
||||
CHECK_EQ(chan.platforms(), uc.platform_filters()); // Overriden
|
||||
CHECK_EQ(chan.platforms(), uc.platform_filters()); // Overridden
|
||||
found_names.insert(chan.display_name());
|
||||
}
|
||||
CHECK_EQ(found_names, util::flat_set<std::string>{ "pkgs/main", "pkgs/pro", "pkgs/r" });
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue