mirror of https://github.com/mamba-org/mamba.git
Update pre-commit hooks" (#3252)
* Update Pre-commit hooks * Apply updated hook
This commit is contained in:
parent
327534724a
commit
245de2009e
|
@ -1,7 +1,7 @@
|
|||
exclude: libmamba/tests/data/repodata_json_cache*
|
||||
repos:
|
||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||
rev: v4.4.0
|
||||
rev: v4.5.0
|
||||
hooks:
|
||||
- id: trailing-whitespace
|
||||
- id: end-of-file-fixer
|
||||
|
@ -17,13 +17,13 @@ repos:
|
|||
- id: debug-statements
|
||||
language_version: python3
|
||||
- repo: https://github.com/pre-commit/pygrep-hooks
|
||||
rev: v1.9.0
|
||||
rev: v1.10.0
|
||||
hooks:
|
||||
- id: rst-backticks
|
||||
- id: rst-directive-colons
|
||||
- id: rst-inline-touching-normal
|
||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||
rev: v0.1.6
|
||||
rev: v0.3.4
|
||||
hooks:
|
||||
- id: ruff
|
||||
args: [ --fix ]
|
||||
|
@ -34,7 +34,7 @@ repos:
|
|||
- id: blacken-docs
|
||||
additional_dependencies: [black==22.3.0]
|
||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||
rev: v16.0.6
|
||||
rev: v18.1.2
|
||||
hooks:
|
||||
- id: clang-format
|
||||
args: [--style=file]
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
"""
|
||||
sphinx-mermaid
|
||||
~~~~~~~~~~~~~~~
|
||||
sphinx-mermaid
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
https://github.com/mgaitan/sphinxcontrib-mermaid
|
||||
Modified for the purpose of CoSApp by the CoSApp team
|
||||
https://gitlab.com/cosapp/cosapp
|
||||
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
|
||||
documents inline.
|
||||
Allow mermaid diagramas to be included in Sphinx-generated
|
||||
documents inline.
|
||||
|
||||
:copyright: Copyright 2016 by Martín Gaitán and others, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
:copyright: Copyright 2016 by Martín Gaitán and others, see AUTHORS.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
|
||||
import codecs
|
||||
|
|
|
@ -71,8 +71,8 @@ namespace solv
|
|||
*/
|
||||
[[nodiscard]] auto problem_rules(ProblemId id) const -> ObjQueue;
|
||||
[[nodiscard]] auto get_rule_info(const ObjPool& pool, RuleId id) const -> ObjRuleInfo;
|
||||
[[nodiscard]] auto rule_info_to_string(const ObjPool& pool, const ObjRuleInfo& id) const
|
||||
-> std::string;
|
||||
[[nodiscard]] auto
|
||||
rule_info_to_string(const ObjPool& pool, const ObjRuleInfo& id) const -> std::string;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -37,16 +37,16 @@ namespace solv
|
|||
*
|
||||
* Negative solvable ids are use to mean that the solvable must be removed.
|
||||
*/
|
||||
[[nodiscard]] static auto from_solvables(const ObjPool& pool, const ObjQueue& solvables)
|
||||
-> ObjTransaction;
|
||||
[[nodiscard]] static auto
|
||||
from_solvables(const ObjPool& pool, const ObjQueue& solvables) -> ObjTransaction;
|
||||
|
||||
/**
|
||||
* Create a transaction from the result of a solver run.
|
||||
*
|
||||
* The solver must be solved.
|
||||
*/
|
||||
[[nodiscard]] static auto from_solver(const ObjPool& pool, const ObjSolver& solver)
|
||||
-> ObjTransaction;
|
||||
[[nodiscard]] static auto
|
||||
from_solver(const ObjPool& pool, const ObjSolver& solver) -> ObjTransaction;
|
||||
|
||||
ObjTransaction(const ObjPool& pool);
|
||||
ObjTransaction(ObjTransaction&&) noexcept = default;
|
||||
|
|
|
@ -118,8 +118,8 @@ namespace solv
|
|||
return (id == 0) ? std::nullopt : std::optional(DependencyId{ id });
|
||||
}
|
||||
|
||||
auto ObjPoolView::add_dependency(StringId name_id, RelationFlag flag, StringId version_id)
|
||||
-> DependencyId
|
||||
auto
|
||||
ObjPoolView::add_dependency(StringId name_id, RelationFlag flag, StringId version_id) -> DependencyId
|
||||
{
|
||||
// Note: libsolv cannot report failure to allocate
|
||||
const ::Id id = ::pool_rel2id(
|
||||
|
@ -181,8 +181,8 @@ namespace solv
|
|||
return solvables;
|
||||
}
|
||||
|
||||
auto ObjPoolView::what_matches_dep(KeyNameId key, DependencyId dep, DependencyMarker marker) const
|
||||
-> ObjQueue
|
||||
auto
|
||||
ObjPoolView::what_matches_dep(KeyNameId key, DependencyId dep, DependencyMarker marker) const -> ObjQueue
|
||||
{
|
||||
ObjQueue solvables = {};
|
||||
::pool_whatmatchesdep(const_cast<::Pool*>(raw()), key, dep, solvables.raw(), marker);
|
||||
|
|
|
@ -228,8 +228,8 @@ namespace solv
|
|||
};
|
||||
}
|
||||
|
||||
auto ObjSolver::rule_info_to_string(const ObjPool& /* pool */, const ObjRuleInfo& ri) const
|
||||
-> std::string
|
||||
auto
|
||||
ObjSolver::rule_info_to_string(const ObjPool& /* pool */, const ObjRuleInfo& ri) const -> std::string
|
||||
{
|
||||
// pool is captured inside solver so we take it as a parameter to be explicit.
|
||||
return ::solver_ruleinfo2str(
|
||||
|
|
|
@ -41,8 +41,8 @@ namespace solv
|
|||
return *this;
|
||||
}
|
||||
|
||||
auto ObjTransaction::from_solvables(const ObjPool& pool, const ObjQueue& solvables)
|
||||
-> ObjTransaction
|
||||
auto
|
||||
ObjTransaction::from_solvables(const ObjPool& pool, const ObjQueue& solvables) -> ObjTransaction
|
||||
{
|
||||
return ObjTransaction{ ::transaction_create_decisionq(
|
||||
const_cast<::Pool*>(pool.raw()),
|
||||
|
@ -103,8 +103,8 @@ namespace solv
|
|||
return ::transaction_type(const_cast<::Transaction*>(raw()), step, mode);
|
||||
}
|
||||
|
||||
auto ObjTransaction::step_newer(const ObjPool& pool, SolvableId step) const
|
||||
-> std::optional<SolvableId>
|
||||
auto
|
||||
ObjTransaction::step_newer(const ObjPool& pool, SolvableId step) const -> std::optional<SolvableId>
|
||||
{
|
||||
assert_same_pool(pool, *this);
|
||||
if (const auto solvable = pool.get_solvable(step); solvable && solvable->installed())
|
||||
|
|
|
@ -48,8 +48,8 @@ namespace solv::test
|
|||
return attrs(a) >= attrs(b);
|
||||
}
|
||||
|
||||
auto add_simple_package(solv::ObjPool& pool, solv::ObjRepoView& repo, const SimplePkg& pkg)
|
||||
-> solv::SolvableId
|
||||
auto
|
||||
add_simple_package(solv::ObjPool& pool, solv::ObjRepoView& repo, const SimplePkg& pkg) -> solv::SolvableId
|
||||
{
|
||||
auto [solv_id, solv] = repo.add_solvable();
|
||||
solv.set_name(pkg.name);
|
||||
|
|
|
@ -85,7 +85,7 @@ TEST_SUITE("solv::ObjQueue")
|
|||
CHECK_EQ(q.at(0), q[0]);
|
||||
CHECK_EQ(q.at(1), q[1]);
|
||||
CHECK_EQ(q.at(2), q[2]);
|
||||
auto use_at = [&]() { [[maybe_unused]] auto const& x = q.at(q.size()); };
|
||||
auto use_at = [&]() { [[maybe_unused]] const auto& x = q.at(q.size()); };
|
||||
CHECK_THROWS_AS(use_at(), std::out_of_range);
|
||||
}
|
||||
|
||||
|
|
|
@ -201,9 +201,7 @@ TEST_SUITE("solv::scenariso")
|
|||
|
||||
auto solver = ObjSolver(pool);
|
||||
CHECK_THROWS_AS(
|
||||
[&] {
|
||||
return solver.solve(pool, { SOLVER_INSTALL, dep_id });
|
||||
}(),
|
||||
[&] { return solver.solve(pool, { SOLVER_INSTALL, dep_id }); }(),
|
||||
std::runtime_error
|
||||
);
|
||||
}
|
||||
|
@ -269,9 +267,7 @@ TEST_SUITE("solv::scenariso")
|
|||
|
||||
auto solver = ObjSolver(pool);
|
||||
CHECK_THROWS_AS(
|
||||
[&] {
|
||||
return solver.solve(pool, { SOLVER_INSTALL, job_id });
|
||||
}(),
|
||||
[&] { return solver.solve(pool, { SOLVER_INSTALL, job_id }); }(),
|
||||
std::runtime_error
|
||||
);
|
||||
}
|
||||
|
|
|
@ -94,8 +94,8 @@ namespace mamba
|
|||
|
||||
using Database = solver::libsolv::Database;
|
||||
|
||||
[[nodiscard]] static auto find(Database& db, const std::vector<std::string>& queries)
|
||||
-> QueryResult;
|
||||
[[nodiscard]] static auto
|
||||
find(Database& db, const std::vector<std::string>& queries) -> QueryResult;
|
||||
|
||||
[[nodiscard]] static auto whoneeds(Database& db, std::string query, bool tree) -> QueryResult;
|
||||
|
||||
|
|
|
@ -63,8 +63,8 @@ namespace mamba::download
|
|||
};
|
||||
|
||||
template <class MirrorType, class... Args>
|
||||
auto mirror_map::create_unique_mirror(const std::string& mirror_name, Args&&... args)
|
||||
-> MirrorType&
|
||||
auto
|
||||
mirror_map::create_unique_mirror(const std::string& mirror_name, Args&&... args) -> MirrorType&
|
||||
{
|
||||
static_assert(std::is_base_of_v<Mirror, MirrorType>);
|
||||
|
||||
|
|
|
@ -801,9 +801,9 @@ namespace mamba::fs
|
|||
template <typename... OtherArgs>
|
||||
explicit recursive_directory_iterator(const u8path& path, OtherArgs&&... args)
|
||||
: std::filesystem::recursive_directory_iterator(
|
||||
path.std_path(),
|
||||
std::forward<OtherArgs>(args)...
|
||||
)
|
||||
path.std_path(),
|
||||
std::forward<OtherArgs>(args)...
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -100,9 +100,11 @@ namespace mamba::solver::libsolv
|
|||
PipAsPythonDependency add = PipAsPythonDependency::No
|
||||
) -> RepoInfo;
|
||||
|
||||
auto
|
||||
native_serialize_repo(const RepoInfo& repo, const fs::u8path& path, const RepodataOrigin& metadata)
|
||||
-> expected_t<RepoInfo>;
|
||||
auto native_serialize_repo(
|
||||
const RepoInfo& repo,
|
||||
const fs::u8path& path,
|
||||
const RepodataOrigin& metadata
|
||||
) -> expected_t<RepoInfo>;
|
||||
|
||||
[[nodiscard]] auto installed_repo() const -> std::optional<RepoInfo>;
|
||||
|
||||
|
@ -160,11 +162,11 @@ namespace mamba::solver::libsolv
|
|||
|
||||
[[nodiscard]] auto packages_in_repo(RepoInfo repo) const -> std::vector<PackageId>;
|
||||
|
||||
[[nodiscard]] auto packages_matching_ids(const specs::MatchSpec& ms)
|
||||
-> std::vector<PackageId>;
|
||||
[[nodiscard]] auto
|
||||
packages_matching_ids(const specs::MatchSpec& ms) -> std::vector<PackageId>;
|
||||
|
||||
[[nodiscard]] auto packages_depending_on_ids(const specs::MatchSpec& ms)
|
||||
-> std::vector<PackageId>;
|
||||
[[nodiscard]] auto
|
||||
packages_depending_on_ids(const specs::MatchSpec& ms) -> std::vector<PackageId>;
|
||||
};
|
||||
|
||||
/********************
|
||||
|
@ -189,9 +191,11 @@ namespace mamba::solver::libsolv
|
|||
}
|
||||
|
||||
template <typename Range>
|
||||
auto
|
||||
Database::add_repo_from_packages(const Range& packages, std::string_view name, PipAsPythonDependency add)
|
||||
-> RepoInfo
|
||||
auto Database::add_repo_from_packages(
|
||||
const Range& packages,
|
||||
std::string_view name,
|
||||
PipAsPythonDependency add
|
||||
) -> RepoInfo
|
||||
{
|
||||
return add_repo_from_packages(packages.begin(), packages.end(), name, add);
|
||||
}
|
||||
|
|
|
@ -53,8 +53,8 @@ namespace mamba::solver::libsolv
|
|||
const Palette& palette
|
||||
) const -> std::ostream&;
|
||||
|
||||
[[nodiscard]] auto explain_problems(Database& pool, const Palette& palette) const
|
||||
-> std::string;
|
||||
[[nodiscard]] auto
|
||||
explain_problems(Database& pool, const Palette& palette) const -> std::string;
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
@ -70,8 +70,8 @@ namespace mamba::specs
|
|||
BuildNumberPredicate(BuildNumber ver, BinaryOperator op);
|
||||
|
||||
friend auto equal(free_interval, free_interval) -> bool;
|
||||
friend auto operator==(const BuildNumberPredicate& lhs, const BuildNumberPredicate& rhs)
|
||||
-> bool;
|
||||
friend auto
|
||||
operator==(const BuildNumberPredicate& lhs, const BuildNumberPredicate& rhs) -> bool;
|
||||
friend class ::fmt::formatter<BuildNumberPredicate>;
|
||||
};
|
||||
|
||||
|
@ -151,8 +151,8 @@ struct fmt::formatter<mamba::specs::BuildNumberSpec>
|
|||
{
|
||||
auto parse(format_parse_context& ctx) -> decltype(ctx.begin());
|
||||
|
||||
auto format(const ::mamba::specs::BuildNumberSpec& spec, format_context& ctx)
|
||||
-> decltype(ctx.out());
|
||||
auto
|
||||
format(const ::mamba::specs::BuildNumberSpec& spec, format_context& ctx) -> decltype(ctx.out());
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -39,8 +39,8 @@ namespace mamba::specs
|
|||
/**
|
||||
* Remove the last element of the '/'-separated name.
|
||||
*/
|
||||
[[nodiscard]] auto weaken_key(std::string_view key) const
|
||||
-> std::optional<std::string_view>;
|
||||
[[nodiscard]] auto
|
||||
weaken_key(std::string_view key) const -> std::optional<std::string_view>;
|
||||
};
|
||||
|
||||
template <typename Key, typename Value>
|
||||
|
@ -95,8 +95,8 @@ namespace mamba::specs
|
|||
|
||||
[[nodiscard]] auto mirror_urls() const -> const std::vector<CondaURL>&;
|
||||
[[nodiscard]] auto platform_mirror_urls() const -> std::vector<CondaURL>;
|
||||
[[nodiscard]] auto platform_mirror_urls(const std::string_view platform) const
|
||||
-> std::vector<CondaURL>;
|
||||
[[nodiscard]] auto
|
||||
platform_mirror_urls(const std::string_view platform) const -> std::vector<CondaURL>;
|
||||
|
||||
[[nodiscard]] auto url() const -> const CondaURL&;
|
||||
auto clear_url() -> const CondaURL;
|
||||
|
|
|
@ -62,8 +62,8 @@ struct fmt::formatter<mamba::specs::ChimeraStringSpec>
|
|||
{
|
||||
auto parse(format_parse_context& ctx) -> decltype(ctx.begin());
|
||||
|
||||
auto format(const ::mamba::specs::ChimeraStringSpec& spec, format_context& ctx)
|
||||
-> decltype(ctx.out());
|
||||
auto
|
||||
format(const ::mamba::specs::ChimeraStringSpec& spec, format_context& ctx) -> decltype(ctx.out());
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -53,11 +53,11 @@ namespace mamba::specs
|
|||
return static_cast<std::size_t>(KnownPlatform::count_);
|
||||
}
|
||||
|
||||
[[nodiscard]] constexpr auto known_platforms()
|
||||
-> std::array<KnownPlatform, known_platforms_count()>;
|
||||
[[nodiscard]] constexpr auto
|
||||
known_platforms() -> std::array<KnownPlatform, known_platforms_count()>;
|
||||
|
||||
[[nodiscard]] constexpr auto known_platform_names()
|
||||
-> std::array<std::string_view, known_platforms_count()>;
|
||||
[[nodiscard]] constexpr auto
|
||||
known_platform_names() -> std::array<std::string_view, known_platforms_count()>;
|
||||
|
||||
/**
|
||||
* Convert the enumeration to its conda string.
|
||||
|
|
|
@ -177,8 +177,8 @@ struct fmt::formatter<mamba::specs::VersionPartAtom>
|
|||
{
|
||||
auto parse(format_parse_context& ctx) -> decltype(ctx.begin());
|
||||
|
||||
auto format(const ::mamba::specs::VersionPartAtom atom, format_context& ctx)
|
||||
-> decltype(ctx.out());
|
||||
auto
|
||||
format(const ::mamba::specs::VersionPartAtom atom, format_context& ctx) -> decltype(ctx.out());
|
||||
};
|
||||
|
||||
template <>
|
||||
|
|
|
@ -36,8 +36,8 @@ namespace mamba::specs
|
|||
[[nodiscard]] static auto make_less_equal(Version ver) -> VersionPredicate;
|
||||
[[nodiscard]] static auto make_starts_with(Version ver) -> VersionPredicate;
|
||||
[[nodiscard]] static auto make_not_starts_with(Version ver) -> VersionPredicate;
|
||||
[[nodiscard]] static auto make_compatible_with(Version ver, std::size_t level)
|
||||
-> VersionPredicate;
|
||||
[[nodiscard]] static auto
|
||||
make_compatible_with(Version ver, std::size_t level) -> VersionPredicate;
|
||||
|
||||
/** Construct an free interval. */
|
||||
VersionPredicate() = default;
|
||||
|
@ -218,8 +218,8 @@ struct fmt::formatter<mamba::specs::VersionPredicate>
|
|||
|
||||
auto parse(format_parse_context& ctx) -> decltype(ctx.begin());
|
||||
|
||||
auto format(const ::mamba::specs::VersionPredicate& pred, format_context& ctx)
|
||||
-> decltype(ctx.out());
|
||||
auto
|
||||
format(const ::mamba::specs::VersionPredicate& pred, format_context& ctx) -> decltype(ctx.out());
|
||||
};
|
||||
|
||||
template <>
|
||||
|
|
|
@ -51,14 +51,14 @@ namespace mamba::util
|
|||
/**
|
||||
* Convert two hexadecimal characters to a byte.
|
||||
*/
|
||||
[[nodiscard]] auto two_hex_to_byte(char high, char low, EncodingError& error) noexcept
|
||||
-> std::byte;
|
||||
[[nodiscard]] auto
|
||||
two_hex_to_byte(char high, char low, EncodingError& error) noexcept -> std::byte;
|
||||
|
||||
/**
|
||||
* Convert two hexadecimal characters to a byte.
|
||||
*/
|
||||
[[nodiscard]] auto two_hex_to_byte(char high, char low) noexcept
|
||||
-> tl::expected<std::byte, EncodingError>;
|
||||
[[nodiscard]] auto
|
||||
two_hex_to_byte(char high, char low) noexcept -> tl::expected<std::byte, EncodingError>;
|
||||
|
||||
/**
|
||||
* Convert hexadecimal characters to a bytes and write it to the given output.
|
||||
|
@ -74,8 +74,8 @@ namespace mamba::util
|
|||
* The number of hexadecimal characters must be even and out must be allocated with half the
|
||||
* number of hexadecimal characters.
|
||||
*/
|
||||
[[nodiscard]] auto hex_to_bytes_to(std::string_view hex, std::byte* out) noexcept
|
||||
-> tl::expected<void, EncodingError>;
|
||||
[[nodiscard]] auto
|
||||
hex_to_bytes_to(std::string_view hex, std::byte* out) noexcept -> tl::expected<void, EncodingError>;
|
||||
|
||||
/**
|
||||
* Escape reserved URL reserved characters with '%' encoding.
|
||||
|
@ -100,13 +100,13 @@ namespace mamba::util
|
|||
/**
|
||||
* Convert a string to base64 encoding.
|
||||
*/
|
||||
[[nodiscard]] auto encode_base64(std::string_view input)
|
||||
-> tl::expected<std::string, EncodingError>;
|
||||
[[nodiscard]] auto
|
||||
encode_base64(std::string_view input) -> tl::expected<std::string, EncodingError>;
|
||||
|
||||
/**
|
||||
* Convert a string from base64 back to its original representation.
|
||||
*/
|
||||
[[nodiscard]] auto decode_base64(std::string_view input)
|
||||
-> tl::expected<std::string, EncodingError>;
|
||||
[[nodiscard]] auto
|
||||
decode_base64(std::string_view input) -> tl::expected<std::string, EncodingError>;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -102,8 +102,8 @@ namespace mamba::util
|
|||
* Return the full path of a program from its name if found inside the given directories.
|
||||
*/
|
||||
template <typename Iter>
|
||||
[[nodiscard]] auto which_in(std::string_view exe, Iter search_path_first, Iter search_path_last)
|
||||
-> fs::u8path;
|
||||
[[nodiscard]] auto
|
||||
which_in(std::string_view exe, Iter search_path_first, Iter search_path_last) -> fs::u8path;
|
||||
|
||||
/**
|
||||
* Return the full path of a program from its name if found inside the given directories.
|
||||
|
@ -133,8 +133,8 @@ namespace mamba::util
|
|||
{
|
||||
[[nodiscard]] auto which_in_one(const fs::u8path& exe, const fs::u8path& dir) -> fs::u8path;
|
||||
|
||||
[[nodiscard]] auto which_in_split(const fs::u8path& exe, std::string_view paths)
|
||||
-> fs::u8path;
|
||||
[[nodiscard]] auto
|
||||
which_in_split(const fs::u8path& exe, std::string_view paths) -> fs::u8path;
|
||||
}
|
||||
|
||||
template <typename Iter>
|
||||
|
|
|
@ -74,8 +74,8 @@ namespace mamba::util
|
|||
* The children must have been previously added to the tree and thei IDs can be used
|
||||
* to point to them.
|
||||
*/
|
||||
auto add_branch(const branch_type& branch, idx_type left_child, idx_type right_child)
|
||||
-> idx_type;
|
||||
auto
|
||||
add_branch(const branch_type& branch, idx_type left_child, idx_type right_child) -> idx_type;
|
||||
auto add_branch(branch_type&& branch, idx_type left_child, idx_type right_child) -> idx_type;
|
||||
|
||||
[[nodiscard]] auto node(idx_type idx) const -> const node_type&;
|
||||
|
@ -234,9 +234,11 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
template <typename B, typename L>
|
||||
auto
|
||||
flat_binary_tree<B, L>::add_branch(const branch_type& branch, idx_type left_child, idx_type right_child)
|
||||
-> idx_type
|
||||
auto flat_binary_tree<B, L>::add_branch(
|
||||
const branch_type& branch,
|
||||
idx_type left_child,
|
||||
idx_type right_child
|
||||
) -> idx_type
|
||||
{
|
||||
return add_branch_impl(branch, left_child, right_child);
|
||||
}
|
||||
|
|
|
@ -167,8 +167,8 @@ namespace mamba::util
|
|||
void reserve(size_type size);
|
||||
|
||||
template <typename UnaryFunc = identity>
|
||||
[[nodiscard]] auto evaluate(UnaryFunc&& var_evaluator = {}, bool empty_val = true) const
|
||||
-> bool;
|
||||
[[nodiscard]] auto
|
||||
evaluate(UnaryFunc&& var_evaluator = {}, bool empty_val = true) const -> bool;
|
||||
|
||||
template <typename UnaryFunc>
|
||||
void infix_for_each(UnaryFunc&& func) const;
|
||||
|
|
|
@ -125,14 +125,14 @@ namespace mamba::util
|
|||
friend auto operator==(const flat_set<K, C, A>& lhs, const flat_set<K, C, A>& rhs) -> bool;
|
||||
|
||||
template <typename K, typename C, typename A>
|
||||
friend auto set_union(const flat_set<K, C, A>&, const flat_set<K, C, A>&)
|
||||
-> flat_set<K, C, A>;
|
||||
friend auto
|
||||
set_union(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_intersection(const flat_set<K, C, A>&, const flat_set<K, C, A>&)
|
||||
-> flat_set<K, C, A>;
|
||||
friend auto
|
||||
set_intersection(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_difference(const flat_set<K, C, A>&, const flat_set<K, C, A>&)
|
||||
-> flat_set<K, C, A>;
|
||||
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>&)
|
||||
-> flat_set<K, C, A>;
|
||||
|
@ -158,14 +158,16 @@ namespace mamba::util
|
|||
-> flat_set<Key, Compare, Allocator>;
|
||||
|
||||
template <typename Key, typename Compare, typename Allocator>
|
||||
auto
|
||||
operator==(const flat_set<Key, Compare, Allocator>& lhs, const flat_set<Key, Compare, Allocator>& rhs)
|
||||
-> bool;
|
||||
auto operator==(
|
||||
const flat_set<Key, Compare, Allocator>& lhs,
|
||||
const flat_set<Key, Compare, Allocator>& rhs
|
||||
) -> bool;
|
||||
|
||||
template <typename Key, typename Compare, typename Allocator>
|
||||
auto
|
||||
operator!=(const flat_set<Key, Compare, Allocator>& lhs, const flat_set<Key, Compare, Allocator>& rhs)
|
||||
-> bool;
|
||||
auto operator!=(
|
||||
const flat_set<Key, Compare, Allocator>& lhs,
|
||||
const flat_set<Key, Compare, Allocator>& rhs
|
||||
) -> bool;
|
||||
|
||||
template <typename Key, typename Compare, typename Allocator>
|
||||
auto set_is_disjoint_of(
|
||||
|
@ -426,8 +428,7 @@ namespace mamba::util
|
|||
*/
|
||||
template <class InputIt1, class InputIt2, class Compare>
|
||||
auto
|
||||
set_disjoint(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, Compare comp)
|
||||
-> bool
|
||||
set_disjoint(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, Compare comp) -> bool
|
||||
{
|
||||
while (first1 != last1 && first2 != last2)
|
||||
{
|
||||
|
@ -509,8 +510,8 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
template <typename K, typename C, typename A>
|
||||
auto set_intersection(const flat_set<K, C, A>& lhs, const flat_set<K, C, A>& rhs)
|
||||
-> flat_set<K, C, A>
|
||||
auto
|
||||
set_intersection(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>();
|
||||
std::set_intersection(
|
||||
|
@ -525,8 +526,8 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
template <typename K, typename C, typename A>
|
||||
auto set_difference(const flat_set<K, C, A>& lhs, const flat_set<K, C, A>& rhs)
|
||||
-> flat_set<K, C, A>
|
||||
auto
|
||||
set_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>();
|
||||
std::set_difference(
|
||||
|
|
|
@ -705,8 +705,7 @@ namespace mamba::util
|
|||
|
||||
template <typename Graph>
|
||||
auto
|
||||
is_reachable(const Graph& graph, typename Graph::node_id source, typename Graph::node_id target)
|
||||
-> bool
|
||||
is_reachable(const Graph& graph, typename Graph::node_id source, typename Graph::node_id target) -> bool
|
||||
{
|
||||
struct : EmptyVisitor<Graph>
|
||||
{
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace mamba::util
|
||||
{
|
||||
[[nodiscard]] auto unix_name_version()
|
||||
-> tl::expected<std::pair<std::string, std::string>, OSError>;
|
||||
[[nodiscard]] auto
|
||||
unix_name_version() -> tl::expected<std::pair<std::string, std::string>, OSError>;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -249,8 +249,8 @@ namespace mamba::util
|
|||
/**
|
||||
* Test wether 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;
|
||||
[[nodiscard]] auto
|
||||
glob_match(std::string_view pattern, std::string_view str, char glob = '*') -> bool;
|
||||
|
||||
/********************
|
||||
* Implementation *
|
||||
|
@ -265,7 +265,7 @@ namespace mamba::util
|
|||
std::size_t out_idx = 0;
|
||||
auto copy_one = [&](const auto& a)
|
||||
{
|
||||
for (auto const& x : a)
|
||||
for (const auto& x : a)
|
||||
{
|
||||
out[out_idx++] = x;
|
||||
}
|
||||
|
|
|
@ -80,8 +80,8 @@ namespace mamba::util
|
|||
/**
|
||||
* Concatenate paths with the given separator.
|
||||
*/
|
||||
[[nodiscard]] auto path_concat(std::string_view parent, std::string_view child, char sep)
|
||||
-> std::string;
|
||||
[[nodiscard]] auto
|
||||
path_concat(std::string_view parent, std::string_view child, char sep) -> std::string;
|
||||
|
||||
/**
|
||||
* Concatenate paths with '/' on Unix and detected separator on Windows.
|
||||
|
@ -91,8 +91,8 @@ namespace mamba::util
|
|||
/**
|
||||
* Expand a leading '~' with the given home directory, assuming the given separator.
|
||||
*/
|
||||
[[nodiscard]] auto expand_home(std::string_view path, std::string_view home, char sep)
|
||||
-> std::string;
|
||||
[[nodiscard]] auto
|
||||
expand_home(std::string_view path, std::string_view home, char sep) -> std::string;
|
||||
|
||||
/**
|
||||
* Expand a leading '~' with the given home directory.
|
||||
|
@ -109,8 +109,8 @@ namespace mamba::util
|
|||
*
|
||||
* This assumes the given separator is used separate paths.
|
||||
*/
|
||||
[[nodiscard]] auto shrink_home(std::string_view path, std::string_view home, char sep)
|
||||
-> std::string;
|
||||
[[nodiscard]] auto
|
||||
shrink_home(std::string_view path, std::string_view home, char sep) -> std::string;
|
||||
|
||||
/**
|
||||
* If the path starts with the given home directory, replace it with a leading '~'.
|
||||
|
|
|
@ -61,8 +61,8 @@ namespace mamba::util
|
|||
return rng;
|
||||
}
|
||||
|
||||
extern template auto local_random_generator<default_random_generator>()
|
||||
-> default_random_generator&;
|
||||
extern template auto
|
||||
local_random_generator<default_random_generator>() -> default_random_generator&;
|
||||
|
||||
template <typename T, typename Generator>
|
||||
auto random_int(T min, T max, Generator& generator) -> T
|
||||
|
|
|
@ -103,32 +103,32 @@ namespace mamba::util
|
|||
/**
|
||||
* Return a view to the input without the prefix if present.
|
||||
*/
|
||||
[[nodiscard]] auto remove_prefix(std::string_view str, std::string_view prefix)
|
||||
-> std::string_view;
|
||||
[[nodiscard]] auto remove_prefix(std::string_view str, std::string_view::value_type c)
|
||||
-> std::string_view;
|
||||
[[nodiscard]] auto
|
||||
remove_prefix(std::string_view str, std::string_view prefix) -> std::string_view;
|
||||
[[nodiscard]] auto
|
||||
remove_prefix(std::string_view str, std::string_view::value_type c) -> std::string_view;
|
||||
|
||||
/**
|
||||
* Return a view to prefix if present, and a view to the rest of the input.
|
||||
*/
|
||||
[[nodiscard]] auto split_prefix(std::string_view str, std::string_view prefix)
|
||||
-> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
split_prefix(std::string_view str, std::string_view prefix) -> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto split_prefix(std::string_view str, std::string_view::value_type c)
|
||||
-> std::array<std::string_view, 2>;
|
||||
|
||||
/**
|
||||
* Return a view to the input without the suffix if present.
|
||||
*/
|
||||
[[nodiscard]] auto remove_suffix(std::string_view str, std::string_view suffix)
|
||||
-> std::string_view;
|
||||
[[nodiscard]] auto remove_suffix(std::string_view str, std::string_view::value_type c)
|
||||
-> std::string_view;
|
||||
[[nodiscard]] auto
|
||||
remove_suffix(std::string_view str, std::string_view suffix) -> std::string_view;
|
||||
[[nodiscard]] auto
|
||||
remove_suffix(std::string_view str, std::string_view::value_type c) -> std::string_view;
|
||||
|
||||
/**
|
||||
* Return a view to the head of the input, and a view to suffix if present.
|
||||
*/
|
||||
[[nodiscard]] auto split_suffix(std::string_view str, std::string_view suffix)
|
||||
-> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
split_suffix(std::string_view str, std::string_view suffix) -> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto split_suffix(std::string_view str, std::string_view::value_type c)
|
||||
-> std::array<std::string_view, 2>;
|
||||
|
||||
|
@ -139,24 +139,24 @@ namespace mamba::util
|
|||
[[nodiscard]] auto lstrip(std::string_view input) -> std::string_view;
|
||||
[[nodiscard]] auto lstrip(std::wstring_view input) -> std::wstring_view;
|
||||
|
||||
[[nodiscard]] auto lstrip_parts(std::string_view input, char c)
|
||||
-> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto lstrip_parts(std::wstring_view input, wchar_t c)
|
||||
-> std::array<std::wstring_view, 2>;
|
||||
[[nodiscard]] auto lstrip_parts(std::string_view input, std::string_view chars)
|
||||
-> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto lstrip_parts(std::wstring_view input, std::wstring_view chars)
|
||||
-> std::array<std::wstring_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
lstrip_parts(std::string_view input, char c) -> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
lstrip_parts(std::wstring_view input, wchar_t c) -> std::array<std::wstring_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
lstrip_parts(std::string_view input, std::string_view chars) -> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
lstrip_parts(std::wstring_view input, std::wstring_view chars) -> std::array<std::wstring_view, 2>;
|
||||
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto lstrip_if(std::string_view input, UnaryFunc should_strip) -> std::string_view;
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto lstrip_if(std::wstring_view input, UnaryFunc should_strip)
|
||||
-> std::wstring_view;
|
||||
[[nodiscard]] auto
|
||||
lstrip_if(std::wstring_view input, UnaryFunc should_strip) -> std::wstring_view;
|
||||
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto lstrip_if_parts(std::string_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
lstrip_if_parts(std::string_view input, UnaryFunc should_strip) -> std::array<std::string_view, 2>;
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto lstrip_if_parts(std::wstring_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::wstring_view, 2>;
|
||||
|
@ -168,24 +168,24 @@ namespace mamba::util
|
|||
[[nodiscard]] auto rstrip(std::string_view input) -> std::string_view;
|
||||
[[nodiscard]] auto rstrip(std::wstring_view input) -> std::wstring_view;
|
||||
|
||||
[[nodiscard]] auto rstrip_parts(std::string_view input, char c)
|
||||
-> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto rstrip_parts(std::wstring_view input, wchar_t c)
|
||||
-> std::array<std::wstring_view, 2>;
|
||||
[[nodiscard]] auto rstrip_parts(std::string_view input, std::string_view chars)
|
||||
-> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto rstrip_parts(std::wstring_view input, std::wstring_view chars)
|
||||
-> std::array<std::wstring_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
rstrip_parts(std::string_view input, char c) -> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
rstrip_parts(std::wstring_view input, wchar_t c) -> std::array<std::wstring_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
rstrip_parts(std::string_view input, std::string_view chars) -> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
rstrip_parts(std::wstring_view input, std::wstring_view chars) -> std::array<std::wstring_view, 2>;
|
||||
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto rstrip_if(std::string_view input, UnaryFunc should_strip) -> std::string_view;
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto rstrip_if(std::wstring_view input, UnaryFunc should_strip)
|
||||
-> std::wstring_view;
|
||||
[[nodiscard]] auto
|
||||
rstrip_if(std::wstring_view input, UnaryFunc should_strip) -> std::wstring_view;
|
||||
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto rstrip_if_parts(std::string_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::string_view, 2>;
|
||||
[[nodiscard]] auto
|
||||
rstrip_if_parts(std::string_view input, UnaryFunc should_strip) -> std::array<std::string_view, 2>;
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto rstrip_if_parts(std::wstring_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::wstring_view, 2>;
|
||||
|
@ -198,25 +198,24 @@ namespace mamba::util
|
|||
[[nodiscard]] auto strip(std::wstring_view input) -> std::wstring_view;
|
||||
|
||||
[[nodiscard]] auto strip_parts(std::string_view input, char c) -> std::array<std::string_view, 3>;
|
||||
[[nodiscard]] auto strip_parts(std::wstring_view input, wchar_t c)
|
||||
-> std::array<std::wstring_view, 3>;
|
||||
[[nodiscard]] auto strip_parts(std::string_view input, std::string_view chars)
|
||||
-> std::array<std::string_view, 3>;
|
||||
[[nodiscard]] auto strip_parts(std::wstring_view input, std::wstring_view chars)
|
||||
-> std::array<std::wstring_view, 3>;
|
||||
[[nodiscard]] auto
|
||||
strip_parts(std::wstring_view input, wchar_t c) -> std::array<std::wstring_view, 3>;
|
||||
[[nodiscard]] auto
|
||||
strip_parts(std::string_view input, std::string_view chars) -> std::array<std::string_view, 3>;
|
||||
[[nodiscard]] auto
|
||||
strip_parts(std::wstring_view input, std::wstring_view chars) -> std::array<std::wstring_view, 3>;
|
||||
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto strip_if(std::string_view input, UnaryFunc should_strip) -> std::string_view;
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto strip_if(std::wstring_view input, UnaryFunc should_strip)
|
||||
-> std::wstring_view;
|
||||
[[nodiscard]] auto strip_if(std::wstring_view input, UnaryFunc should_strip) -> std::wstring_view;
|
||||
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto strip_if_parts(std::string_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::string_view, 3>;
|
||||
[[nodiscard]] auto
|
||||
strip_if_parts(std::string_view input, UnaryFunc should_strip) -> std::array<std::string_view, 3>;
|
||||
template <typename UnaryFunc>
|
||||
[[nodiscard]] auto strip_if_parts(std::wstring_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::wstring_view, 3>;
|
||||
[[nodiscard]] auto
|
||||
strip_if_parts(std::wstring_view input, UnaryFunc should_strip) -> std::array<std::wstring_view, 3>;
|
||||
|
||||
[[nodiscard]] auto split_once(std::string_view str, char sep)
|
||||
-> std::tuple<std::string_view, std::optional<std::string_view>>;
|
||||
|
@ -270,11 +269,10 @@ namespace mamba::util
|
|||
* would return "private/channel/label/foo", but "private/chan" and "channel/label/foo"
|
||||
* would return the "private/chan/channel/label/foo".
|
||||
*/
|
||||
[[nodiscard]] auto concat_dedup_splits(std::string_view str1, std::string_view str2, char sep)
|
||||
-> std::string;
|
||||
[[nodiscard]] auto
|
||||
concat_dedup_splits(std::string_view str1, std::string_view str2, std::string_view sep)
|
||||
-> std::string;
|
||||
concat_dedup_splits(std::string_view str1, std::string_view str2, char sep) -> std::string;
|
||||
[[nodiscard]] auto
|
||||
concat_dedup_splits(std::string_view str1, std::string_view str2, std::string_view sep) -> std::string;
|
||||
|
||||
void replace_all(std::string& data, std::string_view search, std::string_view replace);
|
||||
void replace_all(std::wstring& data, std::wstring_view search, std::wstring_view replace);
|
||||
|
@ -296,8 +294,8 @@ namespace mamba::util
|
|||
* separator in between the elements (thus appearing ``n-1`` times).
|
||||
*/
|
||||
template <typename InputIt, typename UnaryFunction, typename Value>
|
||||
auto join_for_each(InputIt first, InputIt last, UnaryFunction func, const Value& sep)
|
||||
-> UnaryFunction;
|
||||
auto
|
||||
join_for_each(InputIt first, InputIt last, UnaryFunction func, const Value& sep) -> UnaryFunction;
|
||||
|
||||
/**
|
||||
* Concatenate the elements of the container @p container by interleaving a separator.
|
||||
|
@ -462,15 +460,15 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
template <typename UnaryFunc>
|
||||
auto lstrip_if_parts(std::string_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::string_view, 2>
|
||||
auto
|
||||
lstrip_if_parts(std::string_view input, UnaryFunc should_strip) -> std::array<std::string_view, 2>
|
||||
{
|
||||
return detail::lstrip_if_parts_impl(input, std::move(should_strip));
|
||||
}
|
||||
|
||||
template <typename UnaryFunc>
|
||||
auto lstrip_if_parts(std::wstring_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::wstring_view, 2>
|
||||
auto
|
||||
lstrip_if_parts(std::wstring_view input, UnaryFunc should_strip) -> std::array<std::wstring_view, 2>
|
||||
{
|
||||
return detail::lstrip_if_parts_impl(input, std::move(should_strip));
|
||||
}
|
||||
|
@ -504,15 +502,15 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
template <typename UnaryFunc>
|
||||
auto rstrip_if_parts(std::string_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::string_view, 2>
|
||||
auto
|
||||
rstrip_if_parts(std::string_view input, UnaryFunc should_strip) -> std::array<std::string_view, 2>
|
||||
{
|
||||
return detail::rstrip_if_parts_impl(input, std::move(should_strip));
|
||||
}
|
||||
|
||||
template <typename UnaryFunc>
|
||||
auto rstrip_if_parts(std::wstring_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::wstring_view, 2>
|
||||
auto
|
||||
rstrip_if_parts(std::wstring_view input, UnaryFunc should_strip) -> std::array<std::wstring_view, 2>
|
||||
{
|
||||
return detail::rstrip_if_parts_impl(input, std::move(should_strip));
|
||||
}
|
||||
|
@ -542,15 +540,15 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
template <typename UnaryFunc>
|
||||
auto strip_if_parts(std::string_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::string_view, 3>
|
||||
auto
|
||||
strip_if_parts(std::string_view input, UnaryFunc should_strip) -> std::array<std::string_view, 3>
|
||||
{
|
||||
return detail::strip_if_parts_impl(input, std::move(should_strip));
|
||||
}
|
||||
|
||||
template <typename UnaryFunc>
|
||||
auto strip_if_parts(std::wstring_view input, UnaryFunc should_strip)
|
||||
-> std::array<std::wstring_view, 3>
|
||||
auto
|
||||
strip_if_parts(std::wstring_view input, UnaryFunc should_strip) -> std::array<std::wstring_view, 3>
|
||||
{
|
||||
return detail::strip_if_parts_impl(input, std::move(should_strip));
|
||||
}
|
||||
|
@ -609,8 +607,8 @@ namespace mamba::util
|
|||
|
||||
// TODO(C++20) Use ``std::ranges::join_view`` (or ``std::ranges::join``)
|
||||
template <typename InputIt, typename UnaryFunction, typename Value>
|
||||
auto join_for_each(InputIt first, InputIt last, UnaryFunction func, const Value& sep)
|
||||
-> UnaryFunction
|
||||
auto
|
||||
join_for_each(InputIt first, InputIt last, UnaryFunction func, const Value& sep) -> UnaryFunction
|
||||
{
|
||||
if (first < last)
|
||||
{
|
||||
|
|
|
@ -21,8 +21,8 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
template <class T, typename Hasher = std::hash<T>>
|
||||
constexpr auto hash_combine_val(std::size_t seed, const T& val, const Hasher& hasher = {})
|
||||
-> std::size_t
|
||||
constexpr auto
|
||||
hash_combine_val(std::size_t seed, const T& val, const Hasher& hasher = {}) -> std::size_t
|
||||
{
|
||||
return hash_combine(seed, hasher(val));
|
||||
}
|
||||
|
|
|
@ -260,15 +260,15 @@ namespace mamba::util
|
|||
|
||||
protected:
|
||||
|
||||
[[nodiscard]] auto authentication_elems(Credentials, Decode::no_type) const
|
||||
-> std::array<std::string_view, 3>;
|
||||
[[nodiscard]] auto authentication_elems(Credentials, Decode::yes_type) const
|
||||
-> std::array<std::string, 3>;
|
||||
[[nodiscard]] auto
|
||||
authentication_elems(Credentials, Decode::no_type) const -> std::array<std::string_view, 3>;
|
||||
[[nodiscard]] auto
|
||||
authentication_elems(Credentials, Decode::yes_type) const -> std::array<std::string, 3>;
|
||||
|
||||
[[nodiscard]] auto authority_elems(Credentials, Decode::no_type) const
|
||||
-> std::array<std::string_view, 7>;
|
||||
[[nodiscard]] auto authority_elems(Credentials, Decode::yes_type) const
|
||||
-> std::array<std::string, 7>;
|
||||
[[nodiscard]] auto
|
||||
authority_elems(Credentials, Decode::no_type) const -> std::array<std::string_view, 7>;
|
||||
[[nodiscard]] auto
|
||||
authority_elems(Credentials, Decode::yes_type) const -> std::array<std::string, 7>;
|
||||
|
||||
[[nodiscard]] auto
|
||||
pretty_str_path(StripScheme strip_scheme = StripScheme::no, char rstrip_path = 0) const
|
||||
|
|
|
@ -105,8 +105,8 @@ namespace mamba::util
|
|||
{
|
||||
if (!out.empty() && !to_add.empty())
|
||||
{
|
||||
bool const out_has_slash = out.back() == '/';
|
||||
bool const to_add_has_slash = to_add.front() == '/';
|
||||
const bool out_has_slash = out.back() == '/';
|
||||
const bool to_add_has_slash = to_add.front() == '/';
|
||||
if (out_has_slash && to_add_has_slash)
|
||||
{
|
||||
to_add = to_add.substr(1);
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace mamba::util
|
|||
[&](const auto& l) -> bool
|
||||
{
|
||||
using Alt = std::decay_t<decltype(l)>;
|
||||
auto const& r = std::get<Alt>(rhs);
|
||||
const auto& r = std::get<Alt>(rhs);
|
||||
return alt_cmp(l, r);
|
||||
},
|
||||
lhs
|
||||
|
|
|
@ -35,8 +35,8 @@ namespace mamba::validation
|
|||
|
||||
auto generate_ed25519_keypair(std::byte* pk, std::byte* sk) -> int;
|
||||
auto generate_ed25519_keypair() -> std::pair<
|
||||
std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>,
|
||||
std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>>;
|
||||
std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>,
|
||||
std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>>;
|
||||
auto generate_ed25519_keypair_hex() -> std::pair<std::string, std::string>;
|
||||
|
||||
auto sign(const std::string& data, const std::byte* sk, std::byte* signature) -> int;
|
||||
|
@ -52,8 +52,8 @@ namespace mamba::validation
|
|||
verify(const std::byte* data, std::size_t data_len, const std::byte* pk, const std::byte* signature)
|
||||
-> int;
|
||||
auto verify(const std::string& data, const std::byte* pk, const std::byte* signature) -> int;
|
||||
auto verify(const std::string& data, const std::string& pk_hex, const std::string& signature_hex)
|
||||
-> int;
|
||||
auto
|
||||
verify(const std::string& data, const std::string& pk_hex, const std::string& signature_hex) -> int;
|
||||
|
||||
/**
|
||||
* Verify a GPG/PGP signature against the hash of the binary data and
|
||||
|
@ -61,8 +61,8 @@ namespace mamba::validation
|
|||
* See RFC4880, section 5.2.4 https://datatracker.ietf.org/doc/html/rfc4880#section-5.2.4
|
||||
* This method assumes hash function to be SHA-256
|
||||
*/
|
||||
auto verify_gpg_hashed_msg(const std::byte* data, const std::byte* pk, const std::byte* signature)
|
||||
-> int;
|
||||
auto
|
||||
verify_gpg_hashed_msg(const std::byte* data, const std::byte* pk, const std::byte* signature) -> int;
|
||||
auto
|
||||
verify_gpg_hashed_msg(const std::string& data, const std::byte* pk, const std::byte* signature)
|
||||
-> int;
|
||||
|
|
|
@ -59,9 +59,8 @@ namespace mamba::validation
|
|||
[[nodiscard]] virtual auto json_key() const -> std::string = 0;
|
||||
[[nodiscard]] virtual auto expiration_json_key() const -> std::string = 0;
|
||||
|
||||
[[nodiscard]] virtual auto signatures(const nlohmann::json& j) const
|
||||
-> std::set<RoleSignature>
|
||||
= 0;
|
||||
[[nodiscard]] virtual auto
|
||||
signatures(const nlohmann::json& j) const -> std::set<RoleSignature> = 0;
|
||||
|
||||
protected:
|
||||
|
||||
|
@ -104,8 +103,8 @@ namespace mamba::validation
|
|||
|
||||
protected:
|
||||
|
||||
[[nodiscard]] auto read_json_file(const fs::u8path& p, bool update = false) const
|
||||
-> nlohmann::json;
|
||||
[[nodiscard]] auto
|
||||
read_json_file(const fs::u8path& p, bool update = false) const -> nlohmann::json;
|
||||
|
||||
/**
|
||||
* Check that a threshold of valid signatures is met
|
||||
|
@ -179,8 +178,7 @@ namespace mamba::validation
|
|||
const TimeRef& time_reference,
|
||||
const std::string& url,
|
||||
const fs::u8path& cache_path
|
||||
) const -> std::unique_ptr<RepoIndexChecker>
|
||||
= 0;
|
||||
) const -> std::unique_ptr<RepoIndexChecker> = 0;
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -32,8 +32,8 @@ namespace mamba::validation::v0_6
|
|||
[[nodiscard]] auto json_key() const -> std::string override;
|
||||
[[nodiscard]] auto expiration_json_key() const -> std::string override;
|
||||
|
||||
[[nodiscard]] auto signatures(const nlohmann::json& j) const
|
||||
-> std::set<RoleSignature> override;
|
||||
[[nodiscard]] auto
|
||||
signatures(const nlohmann::json& j) const -> std::set<RoleSignature> override;
|
||||
|
||||
[[nodiscard]] auto canonicalize(const nlohmann::json& j) const -> std::string override;
|
||||
[[nodiscard]] auto upgradable() const -> bool override;
|
||||
|
|
|
@ -34,8 +34,8 @@ namespace mamba::validation::v1
|
|||
[[nodiscard]] auto json_key() const -> std::string override;
|
||||
[[nodiscard]] auto expiration_json_key() const -> std::string override;
|
||||
|
||||
[[nodiscard]] auto signatures(const nlohmann::json& j) const
|
||||
-> std::set<RoleSignature> override;
|
||||
[[nodiscard]] auto
|
||||
signatures(const nlohmann::json& j) const -> std::set<RoleSignature> override;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -244,8 +244,8 @@ namespace mamba
|
|||
{
|
||||
std::stringstream ss;
|
||||
ss << "Could not load repodata.json for " << subdir.name()
|
||||
<< " after retry."
|
||||
<< "Please check repodata source. Exiting." << std::endl;
|
||||
<< " after retry." << "Please check repodata source. Exiting."
|
||||
<< std::endl;
|
||||
error_list.push_back(
|
||||
mamba_error(ss.str(), mamba_error_code::repodata_not_loaded)
|
||||
);
|
||||
|
|
|
@ -965,7 +965,8 @@ namespace mamba
|
|||
{
|
||||
env_name.set_cli_yaml_value(parse_result.name);
|
||||
}
|
||||
else if (parse_result.name.size() != 0 && parse_result.name != env_name.cli_value<std::string>())
|
||||
else if (parse_result.name.size() != 0
|
||||
&& parse_result.name != env_name.cli_value<std::string>())
|
||||
{
|
||||
LOG_WARNING << "YAML specs have different environment names. Using "
|
||||
<< env_name.cli_value<std::string>();
|
||||
|
|
|
@ -23,8 +23,8 @@ namespace mamba
|
|||
{
|
||||
namespace
|
||||
{
|
||||
auto make_activator(const Context& context, std::string_view name)
|
||||
-> std::unique_ptr<Activator>
|
||||
auto
|
||||
make_activator(const Context& context, std::string_view name) -> std::unique_ptr<Activator>
|
||||
{
|
||||
if (name == "bash" || name == "zsh" || name == "dash" || name == "posix")
|
||||
{
|
||||
|
|
|
@ -21,7 +21,7 @@ namespace mamba
|
|||
fs::u8path PREFIX_STATE_FILE = fs::u8path("conda-meta") / "state";
|
||||
fs::u8path PACKAGE_ENV_VARS_DIR = fs::u8path("etc") / "conda" / "env_vars.d";
|
||||
std::string CONDA_ENV_VARS_UNSET_VAR = "***unset***"; // NOLINT(runtime/string)
|
||||
} // namespace
|
||||
} // namespace
|
||||
|
||||
/****************************
|
||||
* Activator implementation *
|
||||
|
|
|
@ -27,8 +27,8 @@ namespace mamba
|
|||
|
||||
namespace
|
||||
{
|
||||
auto create_platforms(const std::vector<std::string>& platforms)
|
||||
-> specs::ChannelResolveParams::platform_list
|
||||
auto create_platforms(const std::vector<std::string>& platforms
|
||||
) -> specs::ChannelResolveParams::platform_list
|
||||
{
|
||||
return { platforms.cbegin(), platforms.cend() };
|
||||
}
|
||||
|
|
|
@ -436,8 +436,7 @@ namespace mamba
|
|||
const std::string cwd = path.parent_path().string();
|
||||
options.working_directory = cwd.c_str();
|
||||
|
||||
LOG_TRACE << "ENV MAP:"
|
||||
<< "\n ROOT_PREFIX: " << envmap["ROOT_PREFIX"]
|
||||
LOG_TRACE << "ENV MAP:" << "\n ROOT_PREFIX: " << envmap["ROOT_PREFIX"]
|
||||
<< "\n PREFIX: " << envmap["PREFIX"] << "\n PKG_NAME: " << envmap["PKG_NAME"]
|
||||
<< "\n PKG_VERSION: " << envmap["PKG_VERSION"]
|
||||
<< "\n PKG_BUILDNUM: " << envmap["PKG_BUILDNUM"] << "\n PATH: " << envmap["PATH"]
|
||||
|
|
|
@ -66,11 +66,10 @@ namespace mamba
|
|||
IPersistFile* pPersistFile = nullptr;
|
||||
|
||||
HRESULT hres;
|
||||
LOG_DEBUG << "Creating shortcut with "
|
||||
<< "\n Path: " << path << "\n Description: " << description
|
||||
<< "\n Filename: " << filename << "\n Arguments: " << arguments
|
||||
<< "\n Workdir: " << work_dir << "\n Icon Path: " << icon_path
|
||||
<< "\n Icon Index: " << icon_index;
|
||||
LOG_DEBUG << "Creating shortcut with " << "\n Path: " << path
|
||||
<< "\n Description: " << description << "\n Filename: " << filename
|
||||
<< "\n Arguments: " << arguments << "\n Workdir: " << work_dir
|
||||
<< "\n Icon Path: " << icon_path << "\n Icon Index: " << icon_index;
|
||||
try
|
||||
{
|
||||
hres = CoInitialize(nullptr);
|
||||
|
|
|
@ -177,8 +177,8 @@ namespace mamba
|
|||
return request;
|
||||
}
|
||||
|
||||
auto PackageFetcher::validate(std::size_t downloaded_size, progress_callback_t* cb) const
|
||||
-> ValidationResult
|
||||
auto
|
||||
PackageFetcher::validate(std::size_t downloaded_size, progress_callback_t* cb) const -> ValidationResult
|
||||
{
|
||||
update_monitor(cb, PackageExtractEvent::validate_update);
|
||||
ValidationResult res = validate_size(downloaded_size);
|
||||
|
|
|
@ -203,7 +203,7 @@ namespace mamba
|
|||
}
|
||||
else
|
||||
{
|
||||
auto const child_id = m_graph.add_node(std::move(pkg));
|
||||
const auto child_id = m_graph.add_node(std::move(pkg));
|
||||
m_graph.add_edge(id, child_id);
|
||||
m_visited.emplace(&m_graph.node(child_id), child_id);
|
||||
reverse_walk_impl(child_id);
|
||||
|
|
|
@ -423,8 +423,7 @@ namespace mamba
|
|||
content << "$env.MAMBA_EXE = " << mamba_exe << "\n";
|
||||
content << "$env.MAMBA_ROOT_PREFIX = " << env_prefix << "\n";
|
||||
content << "$env.PATH = ($env.PATH | append ([$env.MAMBA_ROOT_PREFIX bin] | path join) | uniq)\n";
|
||||
content << "$env.PROMPT_COMMAND_BK = $env.PROMPT_COMMAND"
|
||||
<< "\n";
|
||||
content << "$env.PROMPT_COMMAND_BK = $env.PROMPT_COMMAND" << "\n";
|
||||
// TODO the following shouldn't live here but in a shell hook
|
||||
content << R"nu(def --env ")nu" << exe_name << R"nu( activate" [name: string] {)nu";
|
||||
content << R"###(
|
||||
|
@ -446,8 +445,7 @@ namespace mamba
|
|||
if ($env.CONDA_PROMPT_MODIFIER? != null) {
|
||||
$env.PROMPT_COMMAND = {|| $env.CONDA_PROMPT_MODIFIER + (do $env.PROMPT_COMMAND_BK)}
|
||||
}
|
||||
})###"
|
||||
<< "\n";
|
||||
})###" << "\n";
|
||||
|
||||
content << R"nu(def --env ")nu" << exe_name << R"nu( deactivate" [] {)nu";
|
||||
content << R"###(
|
||||
|
@ -469,8 +467,7 @@ namespace mamba
|
|||
# update prompt
|
||||
$env.PROMPT_COMMAND = $env.PROMPT_COMMAND
|
||||
}
|
||||
})###"
|
||||
<< "\n";
|
||||
})###" << "\n";
|
||||
content << "# <<< mamba initialize <<<\n";
|
||||
return content.str();
|
||||
}
|
||||
|
@ -956,8 +953,7 @@ namespace mamba
|
|||
if (fs::exists(root_prefix / "condabin") && fs::is_empty(root_prefix / "condabin"))
|
||||
{
|
||||
fs::remove(root_prefix / "condabin");
|
||||
LOG_INFO << "Removed " << root_prefix / "condabin"
|
||||
<< " directory.";
|
||||
LOG_INFO << "Removed " << root_prefix / "condabin" << " directory.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -285,8 +285,7 @@ namespace mamba
|
|||
return m;
|
||||
}
|
||||
|
||||
auto SubdirMetadata::from_repodata_file(const fs::u8path& repodata_file)
|
||||
-> expected_subdir_metadata
|
||||
auto SubdirMetadata::from_repodata_file(const fs::u8path& repodata_file) -> expected_subdir_metadata
|
||||
{
|
||||
const std::string json = [](const fs::u8path& file) -> std::string
|
||||
{
|
||||
|
|
|
@ -83,8 +83,8 @@ namespace mamba
|
|||
return out;
|
||||
}
|
||||
|
||||
auto installed_python(const solver::libsolv::Database& db)
|
||||
-> std::optional<specs::PackageInfo>
|
||||
auto
|
||||
installed_python(const solver::libsolv::Database& db) -> std::optional<specs::PackageInfo>
|
||||
{
|
||||
// TODO combine Repo and MatchSpec search API in Pool
|
||||
auto out = std::optional<specs::PackageInfo>();
|
||||
|
@ -402,7 +402,7 @@ namespace mamba
|
|||
{
|
||||
using Action = std::decay_t<decltype(act)>;
|
||||
|
||||
auto const link = [&](specs::PackageInfo const& pkg)
|
||||
const auto link = [&](const specs::PackageInfo& pkg)
|
||||
{
|
||||
const fs::u8path cache_path(m_multi_cache.get_extracted_dir_path(pkg, false));
|
||||
LinkPackage lp(pkg, cache_path, &m_transaction_context);
|
||||
|
@ -410,7 +410,7 @@ namespace mamba
|
|||
rollback.record(lp);
|
||||
m_history_entry.link_dists.push_back(pkg.long_str());
|
||||
};
|
||||
auto const unlink = [&](specs::PackageInfo const& pkg)
|
||||
const auto unlink = [&](const specs::PackageInfo& pkg)
|
||||
{
|
||||
const fs::u8path cache_path(m_multi_cache.get_extracted_dir_path(pkg));
|
||||
UnlinkPackage up(pkg, cache_path, &m_transaction_context);
|
||||
|
|
|
@ -1400,9 +1400,8 @@ namespace mamba
|
|||
// 'python -m conda'
|
||||
// *with* PYTHONPATH set.
|
||||
out << silencer << "SET PYTHONPATH=" << CONDA_PACKAGE_ROOT << "\n";
|
||||
out << silencer << "SET CONDA_EXE="
|
||||
<< "python.exe"
|
||||
<< "\n"; // TODO this should be `sys.executable`
|
||||
out << silencer << "SET CONDA_EXE=" << "python.exe" << "\n"; // TODO this should be
|
||||
// `sys.executable`
|
||||
out << silencer << "SET _CE_M=-m\n";
|
||||
out << silencer << "SET _CE_CONDA=conda\n";
|
||||
}
|
||||
|
|
|
@ -190,8 +190,8 @@ namespace mamba::download
|
|||
DownloadTrackerOptions options
|
||||
);
|
||||
|
||||
auto prepare_new_attempt(CURLMultiHandle& handle, const Context& context)
|
||||
-> completion_map_entry;
|
||||
auto
|
||||
prepare_new_attempt(CURLMultiHandle& handle, const Context& context) -> completion_map_entry;
|
||||
|
||||
bool has_failed() const;
|
||||
bool can_start_transfer() const;
|
||||
|
|
|
@ -37,8 +37,8 @@ namespace mamba::download
|
|||
return PASSTHROUGH_MIRROR_ID;
|
||||
}
|
||||
|
||||
auto PassThroughMirror::get_request_generators_impl(const std::string&) const
|
||||
-> request_generator_list
|
||||
auto
|
||||
PassThroughMirror::get_request_generators_impl(const std::string&) const -> request_generator_list
|
||||
{
|
||||
return { [](const Request& dl_request, const Content*)
|
||||
{ return MirrorRequest(dl_request, dl_request.url_path); } };
|
||||
|
@ -148,8 +148,8 @@ namespace mamba::download
|
|||
return MirrorID(std::move(url));
|
||||
}
|
||||
|
||||
auto OCIMirror::get_request_generators_impl(const std::string& url_path) const
|
||||
-> request_generator_list
|
||||
auto OCIMirror::get_request_generators_impl(const std::string& url_path
|
||||
) const -> request_generator_list
|
||||
{
|
||||
// NB: This method can be executed by many threads in parallel. Therefore,
|
||||
// data should not be captured in lambda used for building the request, as
|
||||
|
@ -299,8 +299,8 @@ namespace mamba::download
|
|||
return fmt::format("{}/v2/{}/blobs/sha256:{}", m_url, get_repo(repo), sha256sum);
|
||||
}
|
||||
|
||||
auto OCIMirror::get_authentication_data(const std::string& split_path) const
|
||||
-> AuthenticationData*
|
||||
auto
|
||||
OCIMirror::get_authentication_data(const std::string& split_path) const -> AuthenticationData*
|
||||
{
|
||||
auto it = m_path_map.find(split_path);
|
||||
if (it != m_path_map.end())
|
||||
|
@ -320,7 +320,8 @@ namespace mamba::download
|
|||
{
|
||||
return std::make_unique<PassThroughMirror>();
|
||||
}
|
||||
else if (util::starts_with(url, "https://") || util::starts_with(url, "http://") || util::starts_with(url, "file://"))
|
||||
else if (util::starts_with(url, "https://") || util::starts_with(url, "http://")
|
||||
|| util::starts_with(url, "file://"))
|
||||
{
|
||||
return std::make_unique<HTTPMirror>(std::move(url));
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@
|
|||
|
||||
namespace mamba::solver
|
||||
{
|
||||
auto find_new_python_in_solution(const Solution& solution)
|
||||
-> std::optional<std::reference_wrapper<const specs::PackageInfo>>
|
||||
auto find_new_python_in_solution(const Solution& solution
|
||||
) -> std::optional<std::reference_wrapper<const specs::PackageInfo>>
|
||||
{
|
||||
auto out = std::optional<std::reference_wrapper<const specs::PackageInfo>>{};
|
||||
for_each_to_install(
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
|
||||
namespace mamba::solver
|
||||
{
|
||||
[[nodiscard]] auto find_new_python_in_solution(const Solution& solution)
|
||||
-> std::optional<std::reference_wrapper<const specs::PackageInfo>>;
|
||||
[[nodiscard]] auto find_new_python_in_solution(const Solution& solution
|
||||
) -> std::optional<std::reference_wrapper<const specs::PackageInfo>>;
|
||||
|
||||
[[nodiscard]] auto python_binary_compatible( //
|
||||
const specs::Version& older,
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace mamba::solver::libsolv
|
|||
{
|
||||
logger(libsolv_to_log_level(type), msg);
|
||||
}
|
||||
catch (std::exception const& e)
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
std::cerr << "Developer error: error in libsolv logging function: \n"
|
||||
<< e.what();
|
||||
|
|
|
@ -90,8 +90,8 @@ namespace mamba::solver::libsolv
|
|||
solv.add_self_provide();
|
||||
}
|
||||
|
||||
auto make_package_info(const solv::ObjPool& pool, solv::ObjSolvableViewConst s)
|
||||
-> specs::PackageInfo
|
||||
auto
|
||||
make_package_info(const solv::ObjPool& pool, solv::ObjSolvableViewConst s) -> specs::PackageInfo
|
||||
{
|
||||
specs::PackageInfo out = {};
|
||||
|
||||
|
@ -458,7 +458,7 @@ namespace mamba::solver::libsolv
|
|||
[&](util::CFile&& file_ptr) -> tl::expected<void, std::string>
|
||||
{
|
||||
auto out = repo.legacy_read_conda_repodata(file_ptr.raw(), flags);
|
||||
file_ptr.try_close().or_else([&](auto const& err) { //
|
||||
file_ptr.try_close().or_else([&](const auto& err) { //
|
||||
LOG_WARNING << R"(Fail to close file ")" << filename << R"(": )" << err;
|
||||
});
|
||||
return out;
|
||||
|
@ -565,7 +565,7 @@ namespace mamba::solver::libsolv
|
|||
[&](util::CFile&& file_ptr) -> tl::expected<void, std::string>
|
||||
{
|
||||
auto out = repo.read(file_ptr.raw());
|
||||
file_ptr.try_close().or_else([&](auto const& err) { //
|
||||
file_ptr.try_close().or_else([&](const auto& err) { //
|
||||
LOG_WARNING << R"(Fail to close file ")" << filename << R"(": )" << err;
|
||||
});
|
||||
return out;
|
||||
|
@ -654,7 +654,7 @@ namespace mamba::solver::libsolv
|
|||
[&](util::CFile&& file_ptr) -> tl::expected<void, std::string>
|
||||
{
|
||||
auto out = repo.write(file_ptr.raw());
|
||||
file_ptr.try_close().or_else([&](auto const& err) { //
|
||||
file_ptr.try_close().or_else([&](const auto& err) { //
|
||||
LOG_WARNING << R"(Fail to close file ")" << filename << R"(": )" << err;
|
||||
});
|
||||
return out;
|
||||
|
@ -710,9 +710,11 @@ namespace mamba::solver::libsolv
|
|||
repo.set_pip_added(true);
|
||||
}
|
||||
|
||||
auto
|
||||
make_abused_namespace_dep_args(solv::ObjPool& pool, std::string_view dependency, const MatchFlags& flags)
|
||||
-> std::pair<solv::StringId, solv::StringId>
|
||||
auto make_abused_namespace_dep_args(
|
||||
solv::ObjPool& pool,
|
||||
std::string_view dependency,
|
||||
const MatchFlags& flags
|
||||
) -> std::pair<solv::StringId, solv::StringId>
|
||||
{
|
||||
return {
|
||||
pool.add_string(dependency),
|
||||
|
@ -907,7 +909,7 @@ namespace mamba::solver::libsolv
|
|||
return;
|
||||
}
|
||||
|
||||
auto const type = trans.step_type(
|
||||
const auto type = trans.step_type(
|
||||
pool,
|
||||
id,
|
||||
SOLVER_TRANSACTION_SHOW_OBSOLETES | SOLVER_TRANSACTION_OBSOLETE_IS_UPGRADE
|
||||
|
@ -977,8 +979,8 @@ namespace mamba::solver::libsolv
|
|||
}
|
||||
}
|
||||
|
||||
auto transaction_to_solution_all(const solv::ObjPool& pool, const solv::ObjTransaction& trans)
|
||||
-> Solution
|
||||
auto
|
||||
transaction_to_solution_all(const solv::ObjPool& pool, const solv::ObjTransaction& trans) -> Solution
|
||||
{
|
||||
return transaction_to_solution_impl(pool, trans, [](const auto&) { return true; });
|
||||
}
|
||||
|
@ -1088,8 +1090,7 @@ namespace mamba::solver::libsolv
|
|||
|
||||
namespace
|
||||
{
|
||||
auto action_refers_to(const Solution::Action& unknown_action, std::string_view pkg_name)
|
||||
-> bool
|
||||
auto action_refers_to(const Solution::Action& unknown_action, std::string_view pkg_name) -> bool
|
||||
{
|
||||
return std::visit(
|
||||
[&](const auto& action)
|
||||
|
@ -1109,7 +1110,8 @@ namespace mamba::solver::libsolv
|
|||
return true;
|
||||
}
|
||||
}
|
||||
if constexpr (std::is_same_v<Action, Solution::Reinstall> || std::is_same_v<Action, Solution::Omit>)
|
||||
if constexpr (std::is_same_v<Action, Solution::Reinstall>
|
||||
|| std::is_same_v<Action, Solution::Omit>)
|
||||
{
|
||||
if (action.what.name == pkg_name)
|
||||
{
|
||||
|
@ -1137,7 +1139,7 @@ namespace mamba::solver::libsolv
|
|||
auto s_in_sol = std::find_if(
|
||||
solution.actions.begin(),
|
||||
solution.actions.end(),
|
||||
[&](auto const& action) { return action_refers_to(action, s.name()); }
|
||||
[&](const auto& action) { return action_refers_to(action, s.name()); }
|
||||
);
|
||||
|
||||
if (s_in_sol == solution.actions.end())
|
||||
|
@ -1285,7 +1287,7 @@ namespace mamba::solver::libsolv
|
|||
// ``numpy>=1.0``, leading to an update.
|
||||
// This is especially tricky with channel-specific MatchSpec.
|
||||
|
||||
auto const clean_deps = job.clean_dependencies ? SOLVER_CLEANDEPS : 0;
|
||||
const auto clean_deps = job.clean_dependencies ? SOLVER_CLEANDEPS : 0;
|
||||
|
||||
// In this case, libsolv and mamba meanings are the same.
|
||||
if (job.spec.is_only_package_name())
|
||||
|
@ -1338,7 +1340,7 @@ namespace mamba::solver::libsolv
|
|||
.transform(
|
||||
[&](solv::ObjSolvableView pin_solv)
|
||||
{
|
||||
auto const name_id = pool.add_string(pin_solv.name());
|
||||
const auto name_id = pool.add_string(pin_solv.name());
|
||||
// WARNING keep separate or libsolv does not understand
|
||||
// Force verify the dummy solvable dependencies, as this is not the
|
||||
// default for installed packages.
|
||||
|
|
|
@ -38,8 +38,8 @@ namespace mamba::solver::libsolv
|
|||
{
|
||||
void set_solvable(solv::ObjPool& pool, solv::ObjSolvableView solv, const specs::PackageInfo& pkg);
|
||||
|
||||
auto make_package_info(const solv::ObjPool& pool, solv::ObjSolvableViewConst s)
|
||||
-> specs::PackageInfo;
|
||||
auto
|
||||
make_package_info(const solv::ObjPool& pool, solv::ObjSolvableViewConst s) -> specs::PackageInfo;
|
||||
|
||||
[[nodiscard]] auto libsolv_read_json( //
|
||||
solv::ObjRepoView repo,
|
||||
|
@ -135,8 +135,8 @@ namespace mamba::solver::libsolv
|
|||
const Request::Flags& flags
|
||||
) -> Solution;
|
||||
|
||||
[[nodiscard]] auto installed_python(const solv::ObjPool& pool)
|
||||
-> std::optional<solv::ObjSolvableViewConst>;
|
||||
[[nodiscard]] auto
|
||||
installed_python(const solv::ObjPool& pool) -> std::optional<solv::ObjSolvableViewConst>;
|
||||
|
||||
[[nodiscard]] auto solution_needs_python_relink( //
|
||||
const solv::ObjPool& pool,
|
||||
|
|
|
@ -182,8 +182,8 @@ namespace mamba::solver::libsolv
|
|||
.value();
|
||||
}
|
||||
|
||||
auto Matcher::get_channels(const specs::UnresolvedChannel& uc)
|
||||
-> expected_t<channel_list_const_ref>
|
||||
auto
|
||||
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.
|
||||
|
|
|
@ -70,9 +70,9 @@ namespace mamba::solver::libsolv
|
|||
solver().for_each_problem_id(
|
||||
[&](solv::ProblemId pb)
|
||||
{
|
||||
for (solv::RuleId const rule : solver().problem_rules(pb))
|
||||
for (const solv::RuleId rule : solver().problem_rules(pb))
|
||||
{
|
||||
auto const info = solver().get_rule_info(pool, rule);
|
||||
const auto info = solver().get_rule_info(pool, rule);
|
||||
problems << " - " << solver().rule_info_to_string(pool, info) << "\n";
|
||||
}
|
||||
}
|
||||
|
@ -152,7 +152,7 @@ namespace mamba::solver::libsolv
|
|||
solver.for_each_problem_id(
|
||||
[&](solv::ProblemId pb)
|
||||
{
|
||||
for (solv::RuleId const rule : solver.problem_rules(pb))
|
||||
for (const solv::RuleId rule : solver.problem_rules(pb))
|
||||
{
|
||||
auto info = solver.get_rule_info(pool, rule);
|
||||
res.push_back(make_solver_problem(
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace mamba::solver
|
|||
{
|
||||
if (old_graph.out_degree(n) == 1)
|
||||
{
|
||||
node_id const s = old_graph.successors(n).front();
|
||||
const node_id s = old_graph.successors(n).front();
|
||||
// If s is of constraint type, it has conflicts
|
||||
assert(!is_constraint(old_graph.node(s)) || old_conflicts.has_conflict(s));
|
||||
return is_constraint(old_graph.node(s));
|
||||
|
@ -214,9 +214,10 @@ namespace mamba::solver
|
|||
* @return For each node type, a partition of the the indices in @p of that type..
|
||||
*/
|
||||
template <typename CompFunc>
|
||||
auto
|
||||
merge_node_indices(const node_type_list<old_node_id_list>& nodes_by_type, CompFunc&& merge_criteria)
|
||||
-> node_type_list<std::vector<old_node_id_list>>
|
||||
auto merge_node_indices(
|
||||
const node_type_list<old_node_id_list>& nodes_by_type,
|
||||
CompFunc&& merge_criteria
|
||||
) -> node_type_list<std::vector<old_node_id_list>>
|
||||
{
|
||||
auto merge_func = [&merge_criteria](const auto& node_indices_of_one_node_type)
|
||||
{
|
||||
|
@ -515,8 +516,8 @@ namespace mamba::solver
|
|||
{
|
||||
auto add_new_edge = [&](ProblemsGraph::node_id old_from, ProblemsGraph::node_id old_to)
|
||||
{
|
||||
auto const new_from = old_to_new.at(old_from);
|
||||
auto const new_to = old_to_new.at(old_to);
|
||||
const auto new_from = old_to_new.at(old_from);
|
||||
const auto new_to = old_to_new.at(old_to);
|
||||
if (!new_graph.has_edge(new_from, new_to))
|
||||
{
|
||||
new_graph.add_edge(new_from, new_to, CompressedProblemsGraph::edge_t());
|
||||
|
@ -532,9 +533,10 @@ namespace mamba::solver
|
|||
* If two groups contain a node that are respectively in conflicts, then they are in
|
||||
* conflicts.
|
||||
*/
|
||||
auto
|
||||
merge_conflicts(const ProblemsGraph::conflicts_t& old_conflicts, const node_id_mapping& old_to_new)
|
||||
-> CompressedProblemsGraph::conflicts_t
|
||||
auto merge_conflicts(
|
||||
const ProblemsGraph::conflicts_t& old_conflicts,
|
||||
const node_id_mapping& old_to_new
|
||||
) -> CompressedProblemsGraph::conflicts_t
|
||||
{
|
||||
auto new_conflicts = CompressedProblemsGraph::conflicts_t();
|
||||
for (const auto& [old_from, old_with] : old_conflicts)
|
||||
|
@ -1108,7 +1110,7 @@ namespace mamba::solver
|
|||
{
|
||||
return true;
|
||||
}
|
||||
auto same = [&first](TreeNode const& tn)
|
||||
auto same = [&first](const TreeNode& tn)
|
||||
{ return (tn.type == first->type) && (tn.status == first->status); };
|
||||
return std::all_of(first, last, same);
|
||||
};
|
||||
|
@ -1253,8 +1255,8 @@ namespace mamba::solver
|
|||
template <typename Node>
|
||||
auto concat_nodes_impl(const std::vector<node_id>& ids) -> Node;
|
||||
auto concat_nodes(const std::vector<node_id>& ids) -> node_t;
|
||||
auto concat_edges(const std::vector<node_id>& from, const std::vector<node_id>& to)
|
||||
-> edge_t;
|
||||
auto
|
||||
concat_edges(const std::vector<node_id>& from, const std::vector<node_id>& to) -> edge_t;
|
||||
};
|
||||
|
||||
/*************************************
|
||||
|
@ -1299,7 +1301,7 @@ namespace mamba::solver
|
|||
using Node = std::remove_cv_t<std::remove_reference_t<decltype(node)>>;
|
||||
if constexpr (!std::is_same_v<Node, CompressedProblemsGraph::RootNode>)
|
||||
{
|
||||
auto const style = tn.status ? m_format.available : m_format.unavailable;
|
||||
const auto style = tn.status ? m_format.available : m_format.unavailable;
|
||||
auto [versions_trunc, size] = node.versions_trunc();
|
||||
write(fmt::format(style, (size == 1 ? "{} {}" : "{} [{}]"), node.name(), versions_trunc)
|
||||
);
|
||||
|
@ -1418,7 +1420,8 @@ namespace mamba::solver
|
|||
{
|
||||
assert(false);
|
||||
}
|
||||
else if constexpr (std::is_same_v<Node, PackageListNode> || std::is_same_v<Node, ConstraintListNode>)
|
||||
else if constexpr (std::is_same_v<Node, PackageListNode>
|
||||
|| std::is_same_v<Node, ConstraintListNode>)
|
||||
{
|
||||
write_pkg_repr(tn);
|
||||
if (tn.status)
|
||||
|
@ -1608,8 +1611,8 @@ namespace mamba::solver
|
|||
return out;
|
||||
}
|
||||
|
||||
auto problem_tree_msg(const CompressedProblemsGraph& pbs, const ProblemsMessageFormat& format)
|
||||
-> std::string
|
||||
auto
|
||||
problem_tree_msg(const CompressedProblemsGraph& pbs, const ProblemsMessageFormat& format) -> std::string
|
||||
{
|
||||
std::stringstream ss;
|
||||
print_problem_tree_msg(ss, pbs, format);
|
||||
|
|
|
@ -87,15 +87,15 @@ std::hash<mamba::specs::BasicHTTPAuthentication>::operator()(
|
|||
}
|
||||
|
||||
auto
|
||||
std::hash<mamba::specs::BearerToken>::operator()(const mamba::specs::BearerToken& auth) const
|
||||
-> std::size_t
|
||||
std::hash<mamba::specs::BearerToken>::operator()(const mamba::specs::BearerToken& auth
|
||||
) const -> std::size_t
|
||||
{
|
||||
return std::hash<std::string>{}(auth.token);
|
||||
}
|
||||
|
||||
auto
|
||||
std::hash<mamba::specs::CondaToken>::operator()(const mamba::specs::CondaToken& auth) const
|
||||
-> std::size_t
|
||||
std::hash<mamba::specs::CondaToken>::operator()(const mamba::specs::CondaToken& auth
|
||||
) const -> std::size_t
|
||||
{
|
||||
return std::hash<std::string>{}(auth.token);
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ namespace mamba::specs
|
|||
* BuildNumberPredicate BinaryOperators Implementation *
|
||||
*********************************************************/
|
||||
|
||||
auto BuildNumberPredicate::free_interval::operator()(const BuildNumber&, const BuildNumber&) const
|
||||
-> bool
|
||||
auto
|
||||
BuildNumberPredicate::free_interval::operator()(const BuildNumber&, const BuildNumber&) const -> bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
@ -98,8 +98,8 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
auto
|
||||
fmt::formatter<mamba::specs::BuildNumberPredicate>::parse(format_parse_context& ctx)
|
||||
-> decltype(ctx.begin())
|
||||
fmt::formatter<mamba::specs::BuildNumberPredicate>::parse(format_parse_context& ctx
|
||||
) -> decltype(ctx.begin())
|
||||
{
|
||||
// make sure that range is empty
|
||||
if (ctx.begin() != ctx.end() && *ctx.begin() != '}')
|
||||
|
@ -253,8 +253,8 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
auto
|
||||
fmt::formatter<mamba::specs::BuildNumberSpec>::parse(format_parse_context& ctx)
|
||||
-> decltype(ctx.begin())
|
||||
fmt::formatter<mamba::specs::BuildNumberSpec>::parse(format_parse_context& ctx
|
||||
) -> decltype(ctx.begin())
|
||||
{
|
||||
// make sure that range is empty
|
||||
if (ctx.begin() != ctx.end() && *ctx.begin() != '}')
|
||||
|
|
|
@ -20,14 +20,14 @@ namespace mamba::specs
|
|||
* NameWeakener Implementation *
|
||||
*********************************/
|
||||
|
||||
auto ChannelResolveParams::NameWeakener::make_first_key(std::string_view key) const
|
||||
-> std::string_view
|
||||
auto ChannelResolveParams::NameWeakener::make_first_key(std::string_view key
|
||||
) const -> std::string_view
|
||||
{
|
||||
return key;
|
||||
}
|
||||
|
||||
auto ChannelResolveParams::NameWeakener::weaken_key(std::string_view key) const
|
||||
-> std::optional<std::string_view>
|
||||
auto ChannelResolveParams::NameWeakener::weaken_key(std::string_view key
|
||||
) const -> std::optional<std::string_view>
|
||||
{
|
||||
return std::get<0>(util::rsplit_once(key, '/'));
|
||||
}
|
||||
|
@ -328,8 +328,7 @@ namespace mamba::specs
|
|||
return uri.pretty_str();
|
||||
}
|
||||
|
||||
auto resolve_path_location(std::string location, ChannelResolveParamsView params)
|
||||
-> std::string
|
||||
auto resolve_path_location(std::string location, ChannelResolveParamsView params) -> std::string
|
||||
{
|
||||
if (util::url_has_scheme(location))
|
||||
{
|
||||
|
@ -388,8 +387,8 @@ namespace mamba::specs
|
|||
return url.pretty_str(StripScheme::no, '/', Credentials::Remove);
|
||||
}
|
||||
|
||||
auto resolve_url(UnresolvedChannel&& uc, ChannelResolveParamsView params)
|
||||
-> expected_parse_t<Channel>
|
||||
auto
|
||||
resolve_url(UnresolvedChannel&& uc, ChannelResolveParamsView params) -> expected_parse_t<Channel>
|
||||
{
|
||||
assert(util::url_has_scheme(uc.location()));
|
||||
assert(util::url_get_scheme(uc.location()) != "file");
|
||||
|
@ -451,8 +450,7 @@ namespace mamba::specs
|
|||
return out;
|
||||
}
|
||||
|
||||
auto resolve_name_from_alias(UnresolvedChannel&& uc, ChannelResolveParamsView params)
|
||||
-> Channel
|
||||
auto resolve_name_from_alias(UnresolvedChannel&& uc, ChannelResolveParamsView params) -> Channel
|
||||
{
|
||||
auto url = params.channel_alias;
|
||||
url.append_path(uc.location());
|
||||
|
@ -464,8 +462,8 @@ namespace mamba::specs
|
|||
};
|
||||
}
|
||||
|
||||
auto resolve_name(UnresolvedChannel&& uc, ChannelResolveParamsView params)
|
||||
-> Channel::channel_list
|
||||
auto
|
||||
resolve_name(UnresolvedChannel&& uc, ChannelResolveParamsView params) -> Channel::channel_list
|
||||
{
|
||||
if (auto it = params.custom_channels.find_weaken(uc.location());
|
||||
it != params.custom_channels.cend())
|
||||
|
@ -563,8 +561,8 @@ namespace mamba::specs
|
|||
* Implementation of std::hash *
|
||||
*********************************/
|
||||
|
||||
auto ::std::hash<mamba::specs::Channel>::operator()(const mamba::specs::Channel& chan) const
|
||||
-> std::size_t
|
||||
auto ::std::hash<mamba::specs::Channel>::operator()(const mamba::specs::Channel
|
||||
& chan) const -> std::size_t
|
||||
{
|
||||
return mamba::util::hash_combine(
|
||||
mamba::util::hash_vals(chan.url(), chan.display_name()),
|
||||
|
|
|
@ -125,8 +125,8 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
auto
|
||||
fmt::formatter<mamba::specs::ChimeraStringSpec>::parse(format_parse_context& ctx)
|
||||
-> decltype(ctx.begin())
|
||||
fmt::formatter<mamba::specs::ChimeraStringSpec>::parse(format_parse_context& ctx
|
||||
) -> decltype(ctx.begin())
|
||||
{
|
||||
// make sure that range is empty
|
||||
if (ctx.begin() != ctx.end() && *ctx.begin() != '}')
|
||||
|
|
|
@ -24,8 +24,8 @@ namespace mamba::specs
|
|||
*
|
||||
* Not a static function, it is needed in "channel_spec.cpp".
|
||||
*/
|
||||
auto find_slash_and_platform(std::string_view path)
|
||||
-> std::tuple<std::size_t, std::size_t, std::optional<KnownPlatform>>
|
||||
auto find_slash_and_platform(std::string_view path
|
||||
) -> std::tuple<std::size_t, std::size_t, std::optional<KnownPlatform>>
|
||||
{
|
||||
static constexpr auto npos = std::string_view::npos;
|
||||
|
||||
|
|
|
@ -104,7 +104,7 @@ namespace mamba::specs
|
|||
{
|
||||
constexpr auto is_hash_char = [](char c) -> bool
|
||||
{
|
||||
auto const lower = util::to_lower(c);
|
||||
const auto lower = util::to_lower(c);
|
||||
return util::is_digit(c) || (lower == 'a') || (lower == 'b') || (lower == 'c')
|
||||
|| (lower == 'd') || (lower == 'e') || (lower == 'f');
|
||||
};
|
||||
|
@ -311,8 +311,8 @@ namespace mamba::specs
|
|||
);
|
||||
}
|
||||
|
||||
[[nodiscard]] auto split_attribute_val(std::string_view key_val)
|
||||
-> expected_parse_t<std::tuple<std::string_view, std::optional<std::string_view>>>
|
||||
[[nodiscard]] auto split_attribute_val(std::string_view key_val
|
||||
) -> expected_parse_t<std::tuple<std::string_view, std::optional<std::string_view>>>
|
||||
{
|
||||
// Forbid known ambiguity
|
||||
if (util::starts_with(key_val, "version"))
|
||||
|
@ -437,8 +437,8 @@ namespace mamba::specs
|
|||
);
|
||||
}
|
||||
|
||||
auto split_version_and_build(std::string_view str)
|
||||
-> std::pair<std::string_view, std::string_view>
|
||||
auto split_version_and_build(std::string_view str
|
||||
) -> std::pair<std::string_view, std::string_view>
|
||||
{
|
||||
str = util::strip(str);
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ namespace mamba::specs
|
|||
{
|
||||
constexpr auto is_hash_char = [](char c) -> bool
|
||||
{
|
||||
auto const lower = util::to_lower(c);
|
||||
const auto lower = util::to_lower(c);
|
||||
return util::is_digit(c) || (lower == 'a') || (lower == 'b') || (lower == 'c')
|
||||
|| (lower == 'd') || (lower == 'e') || (lower == 'f');
|
||||
};
|
||||
|
|
|
@ -99,8 +99,10 @@ fmt::formatter<mamba::specs::RegexSpec>::parse(format_parse_context& ctx) -> dec
|
|||
}
|
||||
|
||||
auto
|
||||
fmt::formatter<mamba::specs::RegexSpec>::format(const ::mamba::specs::RegexSpec& spec, format_context& ctx)
|
||||
-> decltype(ctx.out())
|
||||
fmt::formatter<mamba::specs::RegexSpec>::format(
|
||||
const ::mamba::specs::RegexSpec& spec,
|
||||
format_context& ctx
|
||||
) -> decltype(ctx.out())
|
||||
{
|
||||
return fmt::format_to(ctx.out(), "{}", spec.str());
|
||||
}
|
||||
|
|
|
@ -25,8 +25,8 @@
|
|||
namespace mamba::specs
|
||||
{
|
||||
// Defined in conda_url.cpp
|
||||
[[nodiscard]] auto find_slash_and_platform(std::string_view path)
|
||||
-> std::tuple<std::size_t, std::size_t, std::optional<KnownPlatform>>;
|
||||
[[nodiscard]] auto find_slash_and_platform(std::string_view path
|
||||
) -> std::tuple<std::size_t, std::size_t, std::optional<KnownPlatform>>;
|
||||
|
||||
auto UnresolvedChannel::parse_platform_list(std::string_view plats) -> platform_set
|
||||
{
|
||||
|
@ -67,8 +67,8 @@ namespace mamba::specs
|
|||
return { {}, {} };
|
||||
}
|
||||
|
||||
auto split_location_platform(std::string_view str)
|
||||
-> expected_parse_t<std::pair<std::string, dynamic_platform_set>>
|
||||
auto split_location_platform(std::string_view str
|
||||
) -> expected_parse_t<std::pair<std::string, dynamic_platform_set>>
|
||||
{
|
||||
if (util::ends_with(str, ']'))
|
||||
{
|
||||
|
@ -239,8 +239,10 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
auto
|
||||
fmt::formatter<mamba::specs::UnresolvedChannel>::format(const UnresolvedChannel& uc, format_context& ctx) const
|
||||
-> format_context::iterator
|
||||
fmt::formatter<mamba::specs::UnresolvedChannel>::format(
|
||||
const UnresolvedChannel& uc,
|
||||
format_context& ctx
|
||||
) const -> format_context::iterator
|
||||
{
|
||||
auto out = fmt::format_to(ctx.out(), "{}", uc.location());
|
||||
if (!uc.platform_filters().empty())
|
||||
|
|
|
@ -143,9 +143,8 @@ namespace mamba::specs
|
|||
auto VersionPartAtom::operator==(const VersionPartAtom& other) const -> bool
|
||||
{
|
||||
// More efficient thatn 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() };
|
||||
};
|
||||
auto attrs = [](const VersionPartAtom& a) -> std::tuple<std::size_t, const std::string&>
|
||||
{ return { a.numeral(), a.literal() }; };
|
||||
return attrs(*this) == attrs(other);
|
||||
}
|
||||
|
||||
|
@ -177,8 +176,8 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
auto
|
||||
fmt::formatter<mamba::specs::VersionPartAtom>::parse(format_parse_context& ctx)
|
||||
-> decltype(ctx.begin())
|
||||
fmt::formatter<mamba::specs::VersionPartAtom>::parse(format_parse_context& ctx
|
||||
) -> decltype(ctx.begin())
|
||||
{
|
||||
// make sure that range is empty
|
||||
if (ctx.begin() != ctx.end() && *ctx.begin() != '}')
|
||||
|
@ -405,8 +404,8 @@ namespace mamba::specs
|
|||
{
|
||||
};
|
||||
|
||||
[[maybe_unused]] auto starts_with_three_way(const AlwaysEqual&, const AlwaysEqual&)
|
||||
-> strong_ordering
|
||||
[[maybe_unused]] auto
|
||||
starts_with_three_way(const AlwaysEqual&, const AlwaysEqual&) -> strong_ordering
|
||||
{
|
||||
// This comparison should not happen with the current usage.
|
||||
assert(false);
|
||||
|
@ -425,8 +424,8 @@ namespace mamba::specs
|
|||
return strong_ordering::equal;
|
||||
}
|
||||
|
||||
auto starts_with_three_way(const VersionPartAtom& a, const VersionPartAtom& b)
|
||||
-> strong_ordering
|
||||
auto
|
||||
starts_with_three_way(const VersionPartAtom& a, const VersionPartAtom& b) -> strong_ordering
|
||||
{
|
||||
if ((a.numeral() == b.numeral()) && b.literal().empty())
|
||||
{
|
||||
|
@ -534,8 +533,8 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
template <typename Int>
|
||||
auto parse_leading_epoch(std::string_view str)
|
||||
-> expected_parse_t<std::pair<Int, std::string_view>>
|
||||
auto parse_leading_epoch(std::string_view str
|
||||
) -> expected_parse_t<std::pair<Int, std::string_view>>
|
||||
{
|
||||
const auto delim_pos = str.find(Version::epoch_delim);
|
||||
// No epoch is specified
|
||||
|
@ -575,8 +574,8 @@ namespace mamba::specs
|
|||
return { maybe_integer.value(), rest };
|
||||
}
|
||||
|
||||
auto parse_leading_literal(std::string_view str)
|
||||
-> std::pair<std::string_view, std::string_view>
|
||||
auto
|
||||
parse_leading_literal(std::string_view str) -> std::pair<std::string_view, std::string_view>
|
||||
{
|
||||
const auto [literal, rest] = util::lstrip_if_parts(
|
||||
str,
|
||||
|
@ -585,8 +584,8 @@ namespace mamba::specs
|
|||
return { literal, rest };
|
||||
}
|
||||
|
||||
auto parse_leading_part_atom(std::string_view str)
|
||||
-> std::pair<VersionPartAtom, std::string_view>
|
||||
auto
|
||||
parse_leading_part_atom(std::string_view str) -> std::pair<VersionPartAtom, std::string_view>
|
||||
{
|
||||
assert(!str.empty());
|
||||
|
||||
|
@ -695,8 +694,8 @@ namespace mamba::specs
|
|||
return { std::move(parts) };
|
||||
}
|
||||
|
||||
auto parse_trailing_local_version(std::string_view str)
|
||||
-> expected_parse_t<std::pair<std::string_view, CommonVersion>>
|
||||
auto parse_trailing_local_version(std::string_view str
|
||||
) -> expected_parse_t<std::pair<std::string_view, CommonVersion>>
|
||||
{
|
||||
const auto delim_pos = str.rfind(Version::local_delim);
|
||||
// No local is specified
|
||||
|
@ -712,11 +711,8 @@ namespace mamba::specs
|
|||
);
|
||||
}
|
||||
return parse_common_version(str.substr(delim_pos + 1))
|
||||
.transform(
|
||||
[&](CommonVersion&& version) {
|
||||
return std::pair{ str.substr(0, delim_pos), std::move(version) };
|
||||
}
|
||||
);
|
||||
.transform([&](CommonVersion&& version)
|
||||
{ return std::pair{ str.substr(0, delim_pos), std::move(version) }; });
|
||||
}
|
||||
|
||||
auto parse_version(std::string_view str) -> expected_parse_t<CommonVersion>
|
||||
|
@ -807,7 +803,7 @@ fmt::formatter<mamba::specs::Version>::format(const ::mamba::specs::Version v, f
|
|||
|
||||
auto format_version_to = [this](auto l_out, const auto& version)
|
||||
{
|
||||
auto const n_levels = m_level.value_or(version.size());
|
||||
const auto n_levels = m_level.value_or(version.size());
|
||||
for (std::size_t i = 0; i < n_levels; ++i)
|
||||
{
|
||||
if (i != 0)
|
||||
|
|
|
@ -29,8 +29,8 @@ namespace mamba::specs
|
|||
return true;
|
||||
}
|
||||
|
||||
auto VersionPredicate::starts_with::operator()(const Version& point, const Version& prefix) const
|
||||
-> bool
|
||||
auto
|
||||
VersionPredicate::starts_with::operator()(const Version& point, const Version& prefix) const -> bool
|
||||
{
|
||||
return point.starts_with(prefix);
|
||||
}
|
||||
|
@ -41,8 +41,7 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
auto
|
||||
VersionPredicate::not_starts_with::operator()(const Version& point, const Version& prefix) const
|
||||
-> bool
|
||||
VersionPredicate::not_starts_with::operator()(const Version& point, const Version& prefix) const -> bool
|
||||
{
|
||||
return !point.starts_with(prefix);
|
||||
}
|
||||
|
@ -53,14 +52,13 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
auto
|
||||
VersionPredicate::compatible_with::operator()(const Version& point, const Version& older) const
|
||||
-> bool
|
||||
VersionPredicate::compatible_with::operator()(const Version& point, const Version& older) const -> bool
|
||||
{
|
||||
return point.compatible_with(older, level);
|
||||
}
|
||||
|
||||
auto operator==(VersionPredicate::compatible_with lhs, VersionPredicate::compatible_with rhs)
|
||||
-> bool
|
||||
auto
|
||||
operator==(VersionPredicate::compatible_with lhs, VersionPredicate::compatible_with rhs) -> bool
|
||||
{
|
||||
return lhs.level == rhs.level;
|
||||
}
|
||||
|
@ -182,8 +180,8 @@ namespace mamba::specs
|
|||
}
|
||||
|
||||
auto
|
||||
fmt::formatter<mamba::specs::VersionPredicate>::parse(format_parse_context& ctx)
|
||||
-> decltype(ctx.begin())
|
||||
fmt::formatter<mamba::specs::VersionPredicate>::parse(format_parse_context& ctx
|
||||
) -> decltype(ctx.begin())
|
||||
{
|
||||
if (auto it = std::find(ctx.begin(), ctx.end(), 'b'); it < ctx.end())
|
||||
{
|
||||
|
|
|
@ -144,8 +144,8 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
// TODO(C++20): use iterators return type
|
||||
auto hex_to_bytes_to(std::string_view hex, std::byte* out) noexcept
|
||||
-> tl::expected<void, EncodingError>
|
||||
auto
|
||||
hex_to_bytes_to(std::string_view hex, std::byte* out) noexcept -> tl::expected<void, EncodingError>
|
||||
{
|
||||
auto error = EncodingError::Ok;
|
||||
hex_to_bytes_to(hex, out, error);
|
||||
|
|
|
@ -285,8 +285,8 @@ namespace mamba::util
|
|||
* Implementation of remove prefix/suffix functions *
|
||||
******************************************************/
|
||||
|
||||
auto split_prefix(std::string_view str, std::string_view prefix)
|
||||
-> std::array<std::string_view, 2>
|
||||
auto
|
||||
split_prefix(std::string_view str, std::string_view prefix) -> std::array<std::string_view, 2>
|
||||
{
|
||||
if (starts_with(str, prefix))
|
||||
{
|
||||
|
@ -315,8 +315,8 @@ namespace mamba::util
|
|||
return std::get<1>(split_prefix(str, c));
|
||||
}
|
||||
|
||||
auto split_suffix(std::string_view str, std::string_view suffix)
|
||||
-> std::array<std::string_view, 2>
|
||||
auto
|
||||
split_suffix(std::string_view str, std::string_view suffix) -> std::array<std::string_view, 2>
|
||||
{
|
||||
if (ends_with(str, suffix))
|
||||
{
|
||||
|
@ -478,14 +478,14 @@ namespace mamba::util
|
|||
return lstrip_parts_impl(input, c);
|
||||
}
|
||||
|
||||
auto lstrip_parts(std::string_view input, std::string_view chars)
|
||||
-> std::array<std::string_view, 2>
|
||||
auto
|
||||
lstrip_parts(std::string_view input, std::string_view chars) -> std::array<std::string_view, 2>
|
||||
{
|
||||
return lstrip_parts_impl(input, chars);
|
||||
}
|
||||
|
||||
auto lstrip_parts(std::wstring_view input, std::wstring_view chars)
|
||||
-> std::array<std::wstring_view, 2>
|
||||
auto
|
||||
lstrip_parts(std::wstring_view input, std::wstring_view chars) -> std::array<std::wstring_view, 2>
|
||||
{
|
||||
return lstrip_parts_impl(input, chars);
|
||||
}
|
||||
|
@ -517,14 +517,14 @@ namespace mamba::util
|
|||
return rstrip_parts_impl(input, c);
|
||||
}
|
||||
|
||||
auto rstrip_parts(std::string_view input, std::string_view chars)
|
||||
-> std::array<std::string_view, 2>
|
||||
auto
|
||||
rstrip_parts(std::string_view input, std::string_view chars) -> std::array<std::string_view, 2>
|
||||
{
|
||||
return rstrip_parts_impl(input, chars);
|
||||
}
|
||||
|
||||
auto rstrip_parts(std::wstring_view input, std::wstring_view chars)
|
||||
-> std::array<std::wstring_view, 2>
|
||||
auto
|
||||
rstrip_parts(std::wstring_view input, std::wstring_view chars) -> std::array<std::wstring_view, 2>
|
||||
{
|
||||
return rstrip_parts_impl(input, chars);
|
||||
}
|
||||
|
@ -558,14 +558,14 @@ namespace mamba::util
|
|||
return strip_parts_impl(input, c);
|
||||
}
|
||||
|
||||
auto strip_parts(std::string_view input, std::string_view chars)
|
||||
-> std::array<std::string_view, 3>
|
||||
auto
|
||||
strip_parts(std::string_view input, std::string_view chars) -> std::array<std::string_view, 3>
|
||||
{
|
||||
return strip_parts_impl(input, chars);
|
||||
}
|
||||
|
||||
auto strip_parts(std::wstring_view input, std::wstring_view chars)
|
||||
-> std::array<std::wstring_view, 3>
|
||||
auto
|
||||
strip_parts(std::wstring_view input, std::wstring_view chars) -> std::array<std::wstring_view, 3>
|
||||
{
|
||||
return strip_parts_impl(input, chars);
|
||||
}
|
||||
|
@ -767,8 +767,8 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
// TODO(C++20) lazy_split_view is a range
|
||||
auto split(std::wstring_view input, wchar_t sep, std::size_t max_split)
|
||||
-> std::vector<std::wstring>
|
||||
auto
|
||||
split(std::wstring_view input, wchar_t sep, std::size_t max_split) -> std::vector<std::wstring>
|
||||
{
|
||||
const auto sep_arr = std::array<wchar_t, 2>{ sep, L'\0' };
|
||||
return split<decltype(input)::value_type>(input, sep_arr.data(), max_split);
|
||||
|
@ -796,8 +796,8 @@ namespace mamba::util
|
|||
}
|
||||
|
||||
// TODO(C++20) lazy_split_view is a range
|
||||
auto rsplit(std::wstring_view input, wchar_t sep, std::size_t max_split)
|
||||
-> std::vector<std::wstring>
|
||||
auto
|
||||
rsplit(std::wstring_view input, wchar_t sep, std::size_t max_split) -> std::vector<std::wstring>
|
||||
{
|
||||
const auto sep_arr = std::array<wchar_t, 2>{ sep, L'\0' };
|
||||
return rsplit<decltype(input)::value_type>(input, sep_arr.data(), max_split);
|
||||
|
@ -897,8 +897,8 @@ namespace mamba::util
|
|||
return concat_dedup_splits_impl(str1, str2, sep);
|
||||
}
|
||||
|
||||
auto concat_dedup_splits(std::string_view str1, std::string_view str2, std::string_view sep)
|
||||
-> std::string
|
||||
auto
|
||||
concat_dedup_splits(std::string_view str1, std::string_view str2, std::string_view sep) -> std::string
|
||||
{
|
||||
return concat_dedup_splits_impl(str1, str2, sep);
|
||||
}
|
||||
|
|
|
@ -52,8 +52,8 @@ namespace mamba::util
|
|||
|
||||
CurlUrl();
|
||||
|
||||
[[nodiscard]] auto get_part(::CURLUPart part, flag_type flags = 0) const
|
||||
-> std::optional<std::string>;
|
||||
[[nodiscard]] auto
|
||||
get_part(::CURLUPart part, flag_type flags = 0) const -> std::optional<std::string>;
|
||||
|
||||
private:
|
||||
|
||||
|
@ -99,8 +99,8 @@ namespace mamba::util
|
|||
size_type m_len = { -1 };
|
||||
};
|
||||
|
||||
auto CurlUrl::parse(const std::string& url, flag_type flags)
|
||||
-> tl::expected<CurlUrl, URL::ParseError>
|
||||
auto
|
||||
CurlUrl::parse(const std::string& url, flag_type flags) -> tl::expected<CurlUrl, URL::ParseError>
|
||||
{
|
||||
auto out = CurlUrl();
|
||||
const CURLUcode uc = ::curl_url_set(out.m_handle.get(), CURLUPART_URL, url.c_str(), flags);
|
||||
|
@ -445,8 +445,8 @@ namespace mamba::util
|
|||
);
|
||||
}
|
||||
|
||||
auto URL::authority_elems(Credentials credentials, Decode::yes_type) const
|
||||
-> std::array<std::string, 7>
|
||||
auto
|
||||
URL::authority_elems(Credentials credentials, Decode::yes_type) const -> std::array<std::string, 7>
|
||||
{
|
||||
return authority_elems_impl<std::string>(
|
||||
authentication_elems(credentials, Decode::yes),
|
||||
|
|
|
@ -42,8 +42,8 @@ namespace mamba::validation
|
|||
namespace
|
||||
{
|
||||
template <size_t S, class B>
|
||||
[[nodiscard]] auto hex_to_bytes_arr(const B& buffer, int& error_code) noexcept
|
||||
-> std::array<std::byte, S>
|
||||
[[nodiscard]] auto
|
||||
hex_to_bytes_arr(const B& buffer, int& error_code) noexcept -> std::array<std::byte, S>
|
||||
{
|
||||
auto out = std::array<std::byte, S>{};
|
||||
auto err = util::EncodingError::Ok;
|
||||
|
@ -53,8 +53,8 @@ namespace mamba::validation
|
|||
}
|
||||
|
||||
template <class B>
|
||||
[[nodiscard]] auto hex_to_bytes_vec(const B& buffer, int& error_code) noexcept
|
||||
-> std::vector<std::byte>
|
||||
[[nodiscard]] auto
|
||||
hex_to_bytes_vec(const B& buffer, int& error_code) noexcept -> std::vector<std::byte>
|
||||
{
|
||||
auto out = std::vector<std::byte>(buffer.size() / 2);
|
||||
auto err = util::EncodingError::Ok;
|
||||
|
@ -133,8 +133,8 @@ namespace mamba::validation
|
|||
}
|
||||
|
||||
auto generate_ed25519_keypair() -> std::pair<
|
||||
std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>,
|
||||
std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>>
|
||||
std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>,
|
||||
std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>>
|
||||
{
|
||||
std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES> pk, sk;
|
||||
generate_ed25519_keypair(pk.data(), sk.data());
|
||||
|
@ -288,15 +288,14 @@ namespace mamba::validation
|
|||
return verify(data, bin_pk.data(), bin_signature.data());
|
||||
}
|
||||
|
||||
auto verify_gpg_hashed_msg(const std::byte* data, const std::byte* pk, const std::byte* signature)
|
||||
-> int
|
||||
auto
|
||||
verify_gpg_hashed_msg(const std::byte* data, const std::byte* pk, const std::byte* signature) -> int
|
||||
{
|
||||
return verify(data, MAMBA_SHA256_SIZE_BYTES, pk, signature);
|
||||
}
|
||||
|
||||
auto
|
||||
verify_gpg_hashed_msg(const std::string& data, const std::byte* pk, const std::byte* signature)
|
||||
-> int
|
||||
verify_gpg_hashed_msg(const std::string& data, const std::byte* pk, const std::byte* signature) -> int
|
||||
{
|
||||
int error = 0;
|
||||
auto data_bin = hex_to_bytes_arr<MAMBA_SHA256_SIZE_BYTES>(data, error);
|
||||
|
|
|
@ -146,8 +146,8 @@ namespace mamba::validation::v0_6
|
|||
}
|
||||
|
||||
auto
|
||||
RootImpl::upgraded_signature(const nlohmann::json& j, const std::string& pk, const std::byte* sk) const
|
||||
-> RoleSignature
|
||||
RootImpl::upgraded_signature(const nlohmann::json& j, const std::string& pk, const std::byte* sk)
|
||||
const -> RoleSignature
|
||||
{
|
||||
std::array<std::byte, MAMBA_ED25519_SIGSIZE_BYTES> sig_bin;
|
||||
sign(j.dump(), sk, sig_bin.data());
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace mamba
|
|||
|
||||
TEST_CASE_FIXTURE(LockDirTest, "different_pid")
|
||||
{
|
||||
std::string const lock_exe = mambatests::testing_libmamba_lock_exe.string();
|
||||
const std::string lock_exe = mambatests::testing_libmamba_lock_exe.string();
|
||||
std::string out, err;
|
||||
std::vector<std::string> args;
|
||||
|
||||
|
@ -241,7 +241,7 @@ namespace mamba
|
|||
|
||||
TEST_CASE_FIXTURE(LockFileTest, "different_pid")
|
||||
{
|
||||
std::string const lock_exe = mambatests::testing_libmamba_lock_exe.string();
|
||||
const std::string lock_exe = mambatests::testing_libmamba_lock_exe.string();
|
||||
std::string out, err;
|
||||
std::vector<std::string> args;
|
||||
{
|
||||
|
|
|
@ -22,8 +22,8 @@ using namespace mamba::solver;
|
|||
|
||||
namespace
|
||||
{
|
||||
auto mkpkg(std::string name, std::string version, std::vector<std::string> deps = {})
|
||||
-> specs::PackageInfo
|
||||
auto
|
||||
mkpkg(std::string name, std::string version, std::vector<std::string> deps = {}) -> specs::PackageInfo
|
||||
{
|
||||
auto out = specs::PackageInfo();
|
||||
out.name = std::move(name);
|
||||
|
@ -197,7 +197,7 @@ TEST_SUITE("solver::libsolv::database")
|
|||
[&](const specs::PackageInfo& pkg)
|
||||
{
|
||||
found_python = true;
|
||||
for (auto const& dep : pkg.dependencies)
|
||||
for (const auto& dep : pkg.dependencies)
|
||||
{
|
||||
CHECK_FALSE(util::contains(dep, "pip"));
|
||||
}
|
||||
|
@ -227,7 +227,7 @@ TEST_SUITE("solver::libsolv::database")
|
|||
{
|
||||
found_python = true;
|
||||
auto found_pip = false;
|
||||
for (auto const& dep : pkg.dependencies)
|
||||
for (const auto& dep : pkg.dependencies)
|
||||
{
|
||||
found_pip |= util::contains(dep, "pip");
|
||||
}
|
||||
|
|
|
@ -25,8 +25,7 @@ using namespace mamba;
|
|||
using namespace mamba::solver;
|
||||
|
||||
auto
|
||||
find_actions_with_name(const Solution& solution, std::string_view name)
|
||||
-> std::vector<Solution::Action>
|
||||
find_actions_with_name(const Solution& solution, std::string_view name) -> std::vector<Solution::Action>
|
||||
{
|
||||
auto out = std::vector<Solution::Action>();
|
||||
for (const auto& action : solution.actions)
|
||||
|
|
|
@ -272,9 +272,10 @@ namespace
|
|||
return create_pubgrub_hard_(ctx, channel_context, true);
|
||||
}
|
||||
|
||||
auto
|
||||
make_platform_channels(std::vector<std::string>&& channels, const std::vector<std::string>& platforms)
|
||||
-> std::vector<std::string>
|
||||
auto make_platform_channels(
|
||||
std::vector<std::string>&& channels,
|
||||
const std::vector<std::string>& platforms
|
||||
) -> std::vector<std::string>
|
||||
{
|
||||
auto add_plat = [&platforms](const auto& chan)
|
||||
{ return fmt::format("{}[{}]", chan, fmt::join(platforms, ",")); };
|
||||
|
@ -522,7 +523,8 @@ namespace
|
|||
{
|
||||
return false;
|
||||
}
|
||||
else if constexpr (std::is_same_v<Node, ProblemsGraph::UnresolvedDependencyNode> || std::is_same_v<Node, ProblemsGraph::ConstraintNode>)
|
||||
else if constexpr (std::is_same_v<Node, ProblemsGraph::UnresolvedDependencyNode>
|
||||
|| std::is_same_v<Node, ProblemsGraph::ConstraintNode>)
|
||||
{
|
||||
return util::starts_with(std::invoke(&Node::name, n).str(), "__");
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ TEST_SUITE("solver::solution")
|
|||
[&](const PackageInfo& pkg)
|
||||
{
|
||||
remove_count++;
|
||||
auto const has_remove = util::ends_with(pkg.name, "remove")
|
||||
const auto has_remove = util::ends_with(pkg.name, "remove")
|
||||
|| (pkg.name == "reinstall");
|
||||
CHECK(has_remove);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ TEST_SUITE("solver::solution")
|
|||
[&](const PackageInfo& pkg)
|
||||
{
|
||||
install_count++;
|
||||
auto const has_install = util::ends_with(pkg.name, "install")
|
||||
const auto has_install = util::ends_with(pkg.name, "install")
|
||||
|| (pkg.name == "reinstall");
|
||||
CHECK(has_install);
|
||||
}
|
||||
|
|
|
@ -233,7 +233,7 @@ TEST_SUITE("specs::channel")
|
|||
{
|
||||
auto make_typical_params = []() -> ChannelResolveParams
|
||||
{
|
||||
auto make_channel = [](std::string_view loc, ChannelResolveParams const& params) {
|
||||
auto make_channel = [](std::string_view loc, const ChannelResolveParams& params) {
|
||||
return Channel::resolve(UnresolvedChannel::parse(loc).value(), params).value().at(0);
|
||||
};
|
||||
|
||||
|
|
|
@ -384,7 +384,7 @@ TEST_SUITE("util::graph")
|
|||
}
|
||||
|
||||
template <typename Graph, typename Iter>
|
||||
auto is_node_id_permutation(const Graph& g, Iter first, Iter last)->bool
|
||||
auto is_node_id_permutation(const Graph& g, Iter first, Iter last) -> bool
|
||||
{
|
||||
using node_id = typename Graph::node_id;
|
||||
auto node_ids = std::vector<node_id>();
|
||||
|
@ -429,11 +429,7 @@ TEST_SUITE("util::graph")
|
|||
|
||||
SUBCASE("dfs_preorder starting on a given node")
|
||||
{
|
||||
dfs_preorder_nodes_for_each_id(
|
||||
g,
|
||||
[&nodes](node_id n) { nodes.push_back(n); },
|
||||
n0
|
||||
);
|
||||
dfs_preorder_nodes_for_each_id(g, [&nodes](node_id n) { nodes.push_back(n); }, n0);
|
||||
CHECK_EQ(nodes, std::vector<node_id>{ n0, n1 });
|
||||
}
|
||||
|
||||
|
@ -449,11 +445,7 @@ TEST_SUITE("util::graph")
|
|||
|
||||
SUBCASE("dfs_postorder starting on a given node")
|
||||
{
|
||||
dfs_postorder_nodes_for_each_id(
|
||||
g,
|
||||
[&nodes](node_id n) { nodes.push_back(n); },
|
||||
n0
|
||||
);
|
||||
dfs_postorder_nodes_for_each_id(g, [&nodes](node_id n) { nodes.push_back(n); }, n0);
|
||||
CHECK_EQ(nodes, std::vector<node_id>{ n1, n0 });
|
||||
}
|
||||
|
||||
|
@ -499,10 +491,10 @@ TEST_SUITE("util::graph")
|
|||
[&](node_id from, node_id to)
|
||||
{
|
||||
CAPTURE(std::pair(g.node(from), g.node(to)));
|
||||
auto const from_pos = std::find(sorted.cbegin(), sorted.cend(), from);
|
||||
const auto from_pos = std::find(sorted.cbegin(), sorted.cend(), from);
|
||||
// Must be true given the permuation assumption
|
||||
REQUIRE_LT(from_pos, sorted.cend());
|
||||
auto const to_pos = std::find(sorted.cbegin(), sorted.cend(), to);
|
||||
const auto to_pos = std::find(sorted.cbegin(), sorted.cend(), to);
|
||||
// Must be true given the permuation assumption
|
||||
REQUIRE_LT(to_pos, sorted.cend());
|
||||
// The topological sort property
|
||||
|
|
|
@ -169,8 +169,8 @@ protected:
|
|||
|
||||
std::unique_ptr<TemporaryDirectory> channel_dir;
|
||||
|
||||
auto generate_role_secrets(int count)
|
||||
-> std::map<std::string, std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>>
|
||||
auto generate_role_secrets(int count
|
||||
) -> std::map<std::string, std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>>
|
||||
{
|
||||
std::map<std::string, std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>> role_secrets;
|
||||
|
||||
|
@ -750,8 +750,8 @@ public:
|
|||
return update_key_mgr.patch(sig_patch);
|
||||
}
|
||||
|
||||
auto write_key_mgr_file(const nl::json& j, const std::string& filename = "key_mgr.json")
|
||||
-> fs::u8path
|
||||
auto
|
||||
write_key_mgr_file(const nl::json& j, const std::string& filename = "key_mgr.json") -> fs::u8path
|
||||
{
|
||||
fs::u8path p = channel_dir->path() / filename;
|
||||
|
||||
|
@ -1023,8 +1023,8 @@ public:
|
|||
return update_pkg_mgr.patch(sig_patch);
|
||||
}
|
||||
|
||||
auto write_pkg_mgr_file(const nl::json& j, const std::string& filename = "pkg_mgr.json")
|
||||
-> fs::u8path
|
||||
auto
|
||||
write_pkg_mgr_file(const nl::json& j, const std::string& filename = "pkg_mgr.json") -> fs::u8path
|
||||
{
|
||||
fs::u8path p = channel_dir->path() / filename;
|
||||
|
||||
|
|
|
@ -133,8 +133,8 @@ protected:
|
|||
|
||||
secrets_type secrets;
|
||||
|
||||
auto generate_role_secrets(int count)
|
||||
-> std::map<std::string, std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>>
|
||||
auto generate_role_secrets(int count
|
||||
) -> std::map<std::string, std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>>
|
||||
{
|
||||
std::map<std::string, std::array<std::byte, MAMBA_ED25519_KEYSIZE_BYTES>> role_secrets;
|
||||
|
||||
|
|
|
@ -335,6 +335,7 @@ class CompressedProblemsGraph:
|
|||
remove_duplicates: bool = True,
|
||||
) -> typing.Tuple[str, int]: ...
|
||||
pass
|
||||
|
||||
def conflicts(self) -> ProblemsGraph.ConflictMap: ...
|
||||
@staticmethod
|
||||
@typing.overload
|
||||
|
@ -498,6 +499,7 @@ class Context:
|
|||
def extract_threads(self, arg0: int) -> None:
|
||||
pass
|
||||
pass
|
||||
|
||||
def __init__(self) -> None: ...
|
||||
def set_log_level(self, arg0: LogLevel) -> None: ...
|
||||
def set_verbosity(self, arg0: int) -> None: ...
|
||||
|
@ -1183,6 +1185,7 @@ class ProblemsGraph:
|
|||
|
||||
class UnresolvedDependencyNode(MatchSpec):
|
||||
pass
|
||||
|
||||
def conflicts(self) -> ProblemsGraph.ConflictMap: ...
|
||||
@staticmethod
|
||||
def from_solver(arg0: Solver, arg1: Pool) -> ProblemsGraph: ...
|
||||
|
@ -1477,35 +1480,93 @@ class SolverRuleinfo:
|
|||
"""
|
||||
:type: int
|
||||
"""
|
||||
SOLVER_RULE_BEST: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_BEST: 2304>
|
||||
SOLVER_RULE_BLACK: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_BLACK: 3072>
|
||||
SOLVER_RULE_CHOICE: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_CHOICE: 1792>
|
||||
SOLVER_RULE_DISTUPGRADE: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_DISTUPGRADE: 1280>
|
||||
SOLVER_RULE_FEATURE: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_FEATURE: 768>
|
||||
SOLVER_RULE_INFARCH: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_INFARCH: 1536>
|
||||
SOLVER_RULE_JOB: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_JOB: 1024>
|
||||
SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: 1025>
|
||||
SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: 1026>
|
||||
SOLVER_RULE_JOB_UNKNOWN_PACKAGE: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_JOB_UNKNOWN_PACKAGE: 1027>
|
||||
SOLVER_RULE_JOB_UNSUPPORTED: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_JOB_UNSUPPORTED: 1028>
|
||||
SOLVER_RULE_LEARNT: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_LEARNT: 2048>
|
||||
SOLVER_RULE_PKG: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG: 256>
|
||||
SOLVER_RULE_PKG_CONFLICTS: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_CONFLICTS: 261>
|
||||
SOLVER_RULE_PKG_CONSTRAINS: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_CONSTRAINS: 267>
|
||||
SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: 264>
|
||||
SOLVER_RULE_PKG_INSTALLED_OBSOLETES: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_INSTALLED_OBSOLETES: 265>
|
||||
SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: 258>
|
||||
SOLVER_RULE_PKG_NOT_INSTALLABLE: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_NOT_INSTALLABLE: 257>
|
||||
SOLVER_RULE_PKG_OBSOLETES: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_OBSOLETES: 263>
|
||||
SOLVER_RULE_PKG_RECOMMENDS: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_RECOMMENDS: 266>
|
||||
SOLVER_RULE_PKG_REQUIRES: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_REQUIRES: 259>
|
||||
SOLVER_RULE_PKG_SAME_NAME: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_SAME_NAME: 262>
|
||||
SOLVER_RULE_PKG_SELF_CONFLICT: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_PKG_SELF_CONFLICT: 260>
|
||||
SOLVER_RULE_RECOMMENDS: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_RECOMMENDS: 2816>
|
||||
SOLVER_RULE_STRICT_REPO_PRIORITY: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_STRICT_REPO_PRIORITY: 3328>
|
||||
SOLVER_RULE_UNKNOWN: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_UNKNOWN: 0>
|
||||
SOLVER_RULE_UPDATE: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_UPDATE: 512>
|
||||
SOLVER_RULE_YUMOBS: libmambapy.core.bindings.SolverRuleinfo # value = <SolverRuleinfo.SOLVER_RULE_YUMOBS: 2560>
|
||||
SOLVER_RULE_BEST: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_BEST: 2304>
|
||||
SOLVER_RULE_BLACK: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_BLACK: 3072>
|
||||
SOLVER_RULE_CHOICE: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_CHOICE: 1792>
|
||||
SOLVER_RULE_DISTUPGRADE: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_DISTUPGRADE: 1280>
|
||||
SOLVER_RULE_FEATURE: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_FEATURE: 768>
|
||||
SOLVER_RULE_INFARCH: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_INFARCH: 1536>
|
||||
SOLVER_RULE_JOB: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_JOB: 1024>
|
||||
SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: 1025>
|
||||
SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: 1026>
|
||||
SOLVER_RULE_JOB_UNKNOWN_PACKAGE: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_JOB_UNKNOWN_PACKAGE: 1027>
|
||||
SOLVER_RULE_JOB_UNSUPPORTED: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_JOB_UNSUPPORTED: 1028>
|
||||
SOLVER_RULE_LEARNT: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_LEARNT: 2048>
|
||||
SOLVER_RULE_PKG: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG: 256>
|
||||
SOLVER_RULE_PKG_CONFLICTS: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_CONFLICTS: 261>
|
||||
SOLVER_RULE_PKG_CONSTRAINS: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_CONSTRAINS: 267>
|
||||
SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: 264>
|
||||
SOLVER_RULE_PKG_INSTALLED_OBSOLETES: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_INSTALLED_OBSOLETES: 265>
|
||||
SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: 258>
|
||||
SOLVER_RULE_PKG_NOT_INSTALLABLE: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_NOT_INSTALLABLE: 257>
|
||||
SOLVER_RULE_PKG_OBSOLETES: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_OBSOLETES: 263>
|
||||
SOLVER_RULE_PKG_RECOMMENDS: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_RECOMMENDS: 266>
|
||||
SOLVER_RULE_PKG_REQUIRES: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_REQUIRES: 259>
|
||||
SOLVER_RULE_PKG_SAME_NAME: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_SAME_NAME: 262>
|
||||
SOLVER_RULE_PKG_SELF_CONFLICT: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_PKG_SELF_CONFLICT: 260>
|
||||
SOLVER_RULE_RECOMMENDS: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_RECOMMENDS: 2816>
|
||||
SOLVER_RULE_STRICT_REPO_PRIORITY: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_STRICT_REPO_PRIORITY: 3328>
|
||||
SOLVER_RULE_UNKNOWN: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_UNKNOWN: 0>
|
||||
SOLVER_RULE_UPDATE: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_UPDATE: 512>
|
||||
SOLVER_RULE_YUMOBS: (
|
||||
libmambapy.core.bindings.SolverRuleinfo
|
||||
) # value = <SolverRuleinfo.SOLVER_RULE_YUMOBS: 2560>
|
||||
__members__: dict # value = {'SOLVER_RULE_UNKNOWN': <SolverRuleinfo.SOLVER_RULE_UNKNOWN: 0>, 'SOLVER_RULE_PKG': <SolverRuleinfo.SOLVER_RULE_PKG: 256>, 'SOLVER_RULE_PKG_NOT_INSTALLABLE': <SolverRuleinfo.SOLVER_RULE_PKG_NOT_INSTALLABLE: 257>, 'SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP': <SolverRuleinfo.SOLVER_RULE_PKG_NOTHING_PROVIDES_DEP: 258>, 'SOLVER_RULE_PKG_REQUIRES': <SolverRuleinfo.SOLVER_RULE_PKG_REQUIRES: 259>, 'SOLVER_RULE_PKG_SELF_CONFLICT': <SolverRuleinfo.SOLVER_RULE_PKG_SELF_CONFLICT: 260>, 'SOLVER_RULE_PKG_CONFLICTS': <SolverRuleinfo.SOLVER_RULE_PKG_CONFLICTS: 261>, 'SOLVER_RULE_PKG_SAME_NAME': <SolverRuleinfo.SOLVER_RULE_PKG_SAME_NAME: 262>, 'SOLVER_RULE_PKG_OBSOLETES': <SolverRuleinfo.SOLVER_RULE_PKG_OBSOLETES: 263>, 'SOLVER_RULE_PKG_IMPLICIT_OBSOLETES': <SolverRuleinfo.SOLVER_RULE_PKG_IMPLICIT_OBSOLETES: 264>, 'SOLVER_RULE_PKG_INSTALLED_OBSOLETES': <SolverRuleinfo.SOLVER_RULE_PKG_INSTALLED_OBSOLETES: 265>, 'SOLVER_RULE_PKG_RECOMMENDS': <SolverRuleinfo.SOLVER_RULE_PKG_RECOMMENDS: 266>, 'SOLVER_RULE_PKG_CONSTRAINS': <SolverRuleinfo.SOLVER_RULE_PKG_CONSTRAINS: 267>, 'SOLVER_RULE_UPDATE': <SolverRuleinfo.SOLVER_RULE_UPDATE: 512>, 'SOLVER_RULE_FEATURE': <SolverRuleinfo.SOLVER_RULE_FEATURE: 768>, 'SOLVER_RULE_JOB': <SolverRuleinfo.SOLVER_RULE_JOB: 1024>, 'SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP': <SolverRuleinfo.SOLVER_RULE_JOB_NOTHING_PROVIDES_DEP: 1025>, 'SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM': <SolverRuleinfo.SOLVER_RULE_JOB_PROVIDED_BY_SYSTEM: 1026>, 'SOLVER_RULE_JOB_UNKNOWN_PACKAGE': <SolverRuleinfo.SOLVER_RULE_JOB_UNKNOWN_PACKAGE: 1027>, 'SOLVER_RULE_JOB_UNSUPPORTED': <SolverRuleinfo.SOLVER_RULE_JOB_UNSUPPORTED: 1028>, 'SOLVER_RULE_DISTUPGRADE': <SolverRuleinfo.SOLVER_RULE_DISTUPGRADE: 1280>, 'SOLVER_RULE_INFARCH': <SolverRuleinfo.SOLVER_RULE_INFARCH: 1536>, 'SOLVER_RULE_CHOICE': <SolverRuleinfo.SOLVER_RULE_CHOICE: 1792>, 'SOLVER_RULE_LEARNT': <SolverRuleinfo.SOLVER_RULE_LEARNT: 2048>, 'SOLVER_RULE_BEST': <SolverRuleinfo.SOLVER_RULE_BEST: 2304>, 'SOLVER_RULE_YUMOBS': <SolverRuleinfo.SOLVER_RULE_YUMOBS: 2560>, 'SOLVER_RULE_RECOMMENDS': <SolverRuleinfo.SOLVER_RULE_RECOMMENDS: 2816>, 'SOLVER_RULE_BLACK': <SolverRuleinfo.SOLVER_RULE_BLACK: 3072>, 'SOLVER_RULE_STRICT_REPO_PRIORITY': <SolverRuleinfo.SOLVER_RULE_STRICT_REPO_PRIORITY: 3328>}
|
||||
pass
|
||||
|
||||
|
|
|
@ -439,11 +439,8 @@ bind_submodule_impl(pybind11::module_ m)
|
|||
|
||||
py::class_<History>(m, "History")
|
||||
.def(
|
||||
py::init(
|
||||
[](const fs::u8path& path, ChannelContext& channel_context) {
|
||||
return History{ path, channel_context };
|
||||
}
|
||||
),
|
||||
py::init([](const fs::u8path& path, ChannelContext& channel_context)
|
||||
{ return History{ path, channel_context }; }),
|
||||
py::arg("path"),
|
||||
py::arg("channel_context")
|
||||
)
|
||||
|
|
|
@ -55,9 +55,8 @@ namespace mambapy
|
|||
py::class_<Request::Remove>(py_request, "Remove")
|
||||
.def(
|
||||
py::init(
|
||||
[](specs::MatchSpec spec, bool clean) -> Request::Remove {
|
||||
return { std::move(spec), clean };
|
||||
}
|
||||
[](specs::MatchSpec spec, bool clean) -> Request::Remove
|
||||
{ return { std::move(spec), clean }; }
|
||||
),
|
||||
py::arg("spec"),
|
||||
py::arg("clean_dependencies") = true
|
||||
|
@ -70,9 +69,8 @@ namespace mambapy
|
|||
py::class_<Request::Update>(py_request, "Update")
|
||||
.def(
|
||||
py::init(
|
||||
[](specs::MatchSpec spec, bool clean) -> Request::Update {
|
||||
return { std::move(spec), clean };
|
||||
}
|
||||
[](specs::MatchSpec spec, bool clean) -> Request::Update
|
||||
{ return { std::move(spec), clean }; }
|
||||
),
|
||||
py::arg("spec"),
|
||||
py::arg("clean_dependencies") = true
|
||||
|
@ -165,9 +163,8 @@ namespace mambapy
|
|||
.def(
|
||||
// Big copy unfortunately
|
||||
py::init(
|
||||
[](Request::job_list jobs, Request::Flags flags) -> Request {
|
||||
return { std::move(flags), std::move(jobs) };
|
||||
}
|
||||
[](Request::job_list jobs, Request::Flags flags) -> Request
|
||||
{ return { std::move(flags), std::move(jobs) }; }
|
||||
),
|
||||
py::arg("jobs"),
|
||||
py::arg("flags") = Request::Flags()
|
||||
|
@ -207,9 +204,8 @@ namespace mambapy
|
|||
py::class_<Solution::Upgrade>(py_solution, "Upgrade")
|
||||
.def(
|
||||
py::init(
|
||||
[](specs::PackageInfo remove, specs::PackageInfo install) -> Solution::Upgrade {
|
||||
return { std::move(remove), std::move(install) };
|
||||
}
|
||||
[](specs::PackageInfo remove, specs::PackageInfo install) -> Solution::Upgrade
|
||||
{ return { std::move(remove), std::move(install) }; }
|
||||
),
|
||||
py::arg("remove"),
|
||||
py::arg("install")
|
||||
|
@ -222,9 +218,8 @@ namespace mambapy
|
|||
py::class_<Solution::Downgrade>(py_solution, "Downgrade")
|
||||
.def(
|
||||
py::init(
|
||||
[](specs::PackageInfo remove, specs::PackageInfo install) -> Solution::Downgrade {
|
||||
return { std::move(remove), std::move(install) };
|
||||
}
|
||||
[](specs::PackageInfo remove, specs::PackageInfo install) -> Solution::Downgrade
|
||||
{ return { std::move(remove), std::move(install) }; }
|
||||
),
|
||||
py::arg("remove"),
|
||||
py::arg("install")
|
||||
|
@ -237,9 +232,8 @@ namespace mambapy
|
|||
py::class_<Solution::Change>(py_solution, "Change")
|
||||
.def(
|
||||
py::init(
|
||||
[](specs::PackageInfo remove, specs::PackageInfo install) -> Solution::Change {
|
||||
return { std::move(remove), std::move(install) };
|
||||
}
|
||||
[](specs::PackageInfo remove, specs::PackageInfo install) -> Solution::Change
|
||||
{ return { std::move(remove), std::move(install) }; }
|
||||
),
|
||||
py::arg("remove"),
|
||||
py::arg("install")
|
||||
|
@ -315,7 +309,7 @@ namespace mambapy
|
|||
out.reserve(solution.actions.size()); // Upper bound
|
||||
for_each_to_install(
|
||||
solution.actions,
|
||||
[&](auto const& pkg) { out.push_back(pkg); }
|
||||
[&](const auto& pkg) { out.push_back(pkg); }
|
||||
);
|
||||
return out;
|
||||
}
|
||||
|
@ -326,7 +320,7 @@ namespace mambapy
|
|||
{
|
||||
auto out = std::vector<specs::PackageInfo>{};
|
||||
out.reserve(solution.actions.size()); // Upper bound
|
||||
for_each_to_remove(solution.actions, [&](auto const& pkg) { out.push_back(pkg); });
|
||||
for_each_to_remove(solution.actions, [&](const auto& pkg) { out.push_back(pkg); });
|
||||
return out;
|
||||
}
|
||||
)
|
||||
|
@ -336,7 +330,7 @@ namespace mambapy
|
|||
{
|
||||
auto out = std::vector<specs::PackageInfo>{};
|
||||
out.reserve(solution.actions.size()); // Upper bound
|
||||
for_each_to_omit(solution.actions, [&](auto const& pkg) { out.push_back(pkg); });
|
||||
for_each_to_omit(solution.actions, [&](const auto& pkg) { out.push_back(pkg); });
|
||||
return out;
|
||||
}
|
||||
)
|
||||
|
@ -388,7 +382,7 @@ namespace mambapy
|
|||
"graph",
|
||||
[](const ProblemsGraph& self)
|
||||
{
|
||||
auto const& g = self.graph();
|
||||
const auto& g = self.graph();
|
||||
return std::pair(g.nodes(), g.edges());
|
||||
}
|
||||
)
|
||||
|
@ -483,7 +477,7 @@ namespace mambapy
|
|||
"graph",
|
||||
[](const CompressedProblemsGraph& self)
|
||||
{
|
||||
auto const& g = self.graph();
|
||||
const auto& g = self.graph();
|
||||
return std::pair(g.nodes(), g.edges());
|
||||
}
|
||||
)
|
||||
|
|
|
@ -296,7 +296,7 @@ namespace mambapy
|
|||
std::string_view rstrip_path,
|
||||
CondaURL::Credentials credentials)
|
||||
{
|
||||
auto const scheme = strip_scheme ? CondaURL::StripScheme::yes
|
||||
const auto scheme = strip_scheme ? CondaURL::StripScheme::yes
|
||||
: CondaURL::StripScheme::no;
|
||||
const char rstrip = rstrip_path.empty() ? '\0' : rstrip_path.front();
|
||||
return self.pretty_str(scheme, rstrip, credentials);
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace mambapy
|
|||
[](const py::dict& py_db)
|
||||
{
|
||||
auto db = Map();
|
||||
for (auto const& [name, auth] : py_db)
|
||||
for (const auto& [name, auth] : py_db)
|
||||
{
|
||||
db.emplace(py::cast<key_type>(name), py::cast<mapped_type>(auth));
|
||||
}
|
||||
|
|
|
@ -64,9 +64,9 @@ set_activate_command(CLI::App* subcom)
|
|||
subcom->callback(
|
||||
[&]()
|
||||
{
|
||||
std::string const guessed_shell = guess_shell();
|
||||
const std::string guessed_shell = guess_shell();
|
||||
|
||||
std::string const message = fmt::format(
|
||||
const std::string message = fmt::format(
|
||||
"\n'{exe}' is running as a subprocess and can't modify the parent shell.\n"
|
||||
"Thus you must initialize your shell before using activate and deactivate.\n"
|
||||
"\n"
|
||||
|
|
|
@ -151,7 +151,7 @@ set_env_command(CLI::App* com, Configuration& config)
|
|||
}
|
||||
)
|
||||
.or_else(
|
||||
[&](auto const&) -> specs::expected_parse_t<std::string>
|
||||
[&](const auto&) -> specs::expected_parse_t<std::string>
|
||||
{ return record.package_url; }
|
||||
)
|
||||
.value();
|
||||
|
@ -211,7 +211,7 @@ set_env_command(CLI::App* com, Configuration& config)
|
|||
dependencies << "\n";
|
||||
}
|
||||
|
||||
for (auto const& chan : chans)
|
||||
for (const auto& chan : chans)
|
||||
{
|
||||
channels.insert(chan.display_name());
|
||||
}
|
||||
|
|
|
@ -97,9 +97,9 @@ namespace
|
|||
[&]()
|
||||
{
|
||||
// Set remote when a channel is passed
|
||||
bool const channel_passed = config.at("channels").cli_configured();
|
||||
auto const format = compute_format(query, config, options);
|
||||
bool const success = repoquery(
|
||||
const bool channel_passed = config.at("channels").cli_configured();
|
||||
const auto format = compute_format(query, config, options);
|
||||
const bool success = repoquery(
|
||||
config,
|
||||
query,
|
||||
format,
|
||||
|
@ -141,9 +141,9 @@ namespace
|
|||
subcmd->callback(
|
||||
[&]()
|
||||
{
|
||||
bool const channel_passed = config.at("channels").cli_configured();
|
||||
auto const format = compute_format(query, config, options);
|
||||
bool const success = repoquery(config, query, format, use_local, options.specs);
|
||||
const bool channel_passed = config.at("channels").cli_configured();
|
||||
const auto format = compute_format(query, config, options);
|
||||
const bool success = repoquery(config, query, format, use_local, options.specs);
|
||||
if (!success && (format != mamba::QueryResultFormat::Json))
|
||||
{
|
||||
if (!use_local && !channel_passed)
|
||||
|
|
|
@ -210,7 +210,7 @@ set_run_command(CLI::App* subcom, Configuration& config)
|
|||
|
||||
auto& ctx = config.context();
|
||||
|
||||
auto const get_prefix = [&]()
|
||||
const auto get_prefix = [&]()
|
||||
{
|
||||
if (auto prefix = ctx.prefix_params.target_prefix; !prefix.empty())
|
||||
{
|
||||
|
|
|
@ -325,7 +325,7 @@ namespace
|
|||
subcmd->callback(
|
||||
[all_subsubcmds, &config]()
|
||||
{
|
||||
bool const got_subsubcmd = std::any_of(
|
||||
const bool got_subsubcmd = std::any_of(
|
||||
all_subsubcmds.cbegin(),
|
||||
all_subsubcmds.cend(),
|
||||
[](auto* subsubcmd) -> bool { return subsubcmd->parsed(); }
|
||||
|
@ -338,7 +338,7 @@ namespace
|
|||
consolidate_prefix_options(config);
|
||||
config.load();
|
||||
|
||||
auto const get_shell = []() -> std::string
|
||||
const auto get_shell = []() -> std::string
|
||||
{
|
||||
if constexpr (util::on_win)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue