Commit Graph

82 Commits

Author SHA1 Message Date
Antoine Prouvost 7ce51b3de9
Compile with C++20 (#3965) 2025-06-04 11:28:11 +02:00
Antoine Prouvost e807e690ee
Constexpr `fmt::formatter::parse` for C++20 with `from_chars` (#3944) 2025-05-20 13:40:42 +02:00
Antoine Prouvost 06000139c9
Refactor `SubdirData` > `SubdirIndexLoader` (#3940) 2025-05-15 16:57:52 +02:00
Hind-M 8824be1105
Use correct `url` in metadata and mirrors (#3816) 2025-02-21 10:48:45 +01:00
Hind-M 211d79db77
Fix windows paths and add tests (#3787) 2025-02-18 13:14:55 +01:00
Ayaz Salikhov 76d06a7f5a
maint: Cleanup CMake files and delete not compiled files (#3667) 2024-12-09 20:27:12 +01:00
Ayaz Salikhov c3a2c1c66e
maint: Use Catch2 instead of doctest (#3618) 2024-12-06 08:57:33 +01:00
Hind-M 7f8d5649c0
[OCI - Mirrors] Add tests and doc (#3307)
* Add doc and micromamba python test

* Add some tests for mirrors

* Use another channel name to avoid interfering with conda-forge

* Add test parameter to use libsolv parser

* Remove dry-run from tests
2024-06-12 16:36:31 +02:00
Antoine Prouvost 327534724a
Refactor os utilities (#3248)
* Refactor make_virtual_package

* Refactor macos_version

* Add new windows_version

* Add __win virtual package version

* Use new util::windows_version

* Add virtual packages version test

* Add Plaform os detection

* Refactor linux_version

* Fix linux_version on mac with unix_name_version
2024-03-28 14:08:35 +01:00
Antoine Prouvost 7942d3feaf
Handle regex in build string (#3239) 2024-03-20 18:52:22 +01:00
Antoine Prouvost 6d535ea5ff
Finalized Solver bindings and add solver doc (#3195)
* Fix cross reference in docs

* Rename Request::Item > Job

* Add missing Request python test

* Add Solver usage documentation

* Add tests for ProblemsGraph

* Adjust 2.0 changes

* use mambatest directories

* Remove channel from test repodata.json

* Add simple solver tests
2024-02-21 17:27:35 +01:00
Antoine Prouvost 4db0c06cfa
Add (some) solver Database tests (#3185)
* Add test_request.cpp

* Add test_solution.cpp

* Fix wrong forward declaration

* Add libsolv database test
2024-02-09 10:32:20 -05:00
Antoine Prouvost daeb96cb08
Make libsolv wrappers into standalone library (#3181)
* Move solv-cpp into standalone library

* Remove mamba namespace from solv-cpp

* Switch solv-cpp to object library

* Install solv-cpp object library

* Fix doctest

* Fix windows path
2024-02-08 10:49:53 -05:00
Antoine Prouvost a2a2d26445
Simplify MPool Interface (#3177)
* Remove some use to MPool::ChannelContext

* Explicit palette in UnSolvable

* Explicit option for use_only_tar_bz2 in Pool

* Remove context from Pool

* Remove Context capture in Pool

* Remove ChannelContext capture in Pool

* Silence warnings

* Chane Unsolvable to use solv::ObjPool

* Fine grain control of MPoll raw access

* Remove MPool::id2pkginfo

* Remove MPool::matchspec2id and select_solvables

* Remove MPool::dep2str

* Auto create_whatprovides in repoquery

* Remove MPool::create_whatprovides

* Change MPool::remove_repo API

* Private libsolv
2024-02-07 09:25:37 -05:00
Antoine Prouvost dedf072874
Split Solver and Unsolvable (#3156)
* No capture MPool in Solver

* Solution in MSolver

* Change MTransaction solver ctor

* Split UnSolvable from MSolver

* Implement MSolver Outcome

* Private SolverProblem

* Move UnSolvable to solve::libsolv

* Move sat* solver::problems_graph

* Clean test_problems_graph

* Move MSolver to solver::libsolv

* Rename MSolver > Solver

* Add minimal 2.0 doc

* Bind solver::Solution

* Move problems_graph bindings to libmambapy.solver

* Change Solver namespace

* Move Solver bindings to libmambapy.solver.libsolv
2024-01-30 22:20:36 +01:00
Johan Mabille a63587da2e
Moved download related files to dedicated folder (#3155) 2024-01-25 20:45:54 +01:00
Antoine Prouvost 8e9b376161
Move util_random.hpp > util/random.hpp (#3129)
* Move util_random.hpp > util/random.hpp

* Use new random in libmamba

* Use template instanciation instead
2024-01-16 10:14:45 +01:00
Antoine Prouvost 13d034147f
Rename ChannelSpec > UndefinedChannel (#3117)
* Rename ChannelSpec > UndefinedChannel

* Rename UndefinedChannel > UnresolvedChannel
2024-01-09 13:52:23 +01:00
Antoine Prouvost 328457276a
Add some PackageInfo tests" (#3115)
* Add PackageInfo::from_url

* Add PakcageInfo tests

* Bind PackageInfo::from_url
2024-01-09 09:38:01 +01:00
Antoine Prouvost 1633630e68
Refactor MatchSpec unlikey data (#3099)
* Fix test names

* Hide MatchSpec implementation detail

* Add heap_optional

* Refactor MatchSpec unlikely members

* Make private use of MatchSpec bracket

* Refactor MatchSpec switch

* Remove map from MatchSpec
2024-01-04 18:14:21 +01:00
Antoine Prouvost 276321427e
Add BuildNumberSpec (#3098)
* Add BuildNumberSpec

* Fix test case name

* use BuildNumberSpec in MatchSpec

* Fix BuildNumberSpec

* Simplify BuildNumberPredicate
2024-01-04 11:57:58 +01:00
Antoine Prouvost 18b77d62be
GlobSpec (#3094)
* Fix include guard

* Add GlobSpec

* Use GlobSpec for MatchSpec build_string

* Make MatchSpec::name a GlobSpec
2024-01-03 09:17:17 +01:00
Antoine Prouvost 1b56e38001
Add parsing utilities (#3090)
* Add util/parsers skeletton

* Add find_matching_parentheses

* conditional refactor

* Add find_not_in_parentheses

* Add some doc

* Add find_not_in_parentheses substr overload

* Add glob_match

* Remove warning
2024-01-02 10:52:44 +01:00
Antoine Prouvost 15e8056029
Some future proofing MatchSpec (#3082)
* Private MatchSpec::name

* Private MatchSpec::filename

* Private MatchSpec::url

* Make MatchSpec::is_file a function

* Private MatchSpec::namespace

* Private MatchSpec::build_number

* Remove dead affectation

* Private MatchSpec::optional

* Remove dead code

* Clean MatchSpec dist parsing

* Fix MatchSpec dist parse

* Private MatchSpec::version

* Private MatchSpec::build_string

* Private MatchSpec::channel

* Add missing MatchSpec setters

* Put MatchSpec in specs::
2023-12-26 17:23:33 +01:00
Antoine Prouvost dfcb8c249e
MatchSpec small improvements (#3043)
* Small CQA

* Add ChannelSpec::str

* Add ChannelContext::make_channel for ChannelSpec

* Split MatchSpec tests
2023-12-07 09:20:58 +01:00
Antoine Prouvost c529199eef
Split validate.[ch]pp (#3041)
* Split validation errors

* Split validation keys

* Fix header include

* Split validation versioned namespaces

* Trailing return types

* Split update framework implementation

* Finish validation split

* Fix missing header
2023-12-06 19:34:19 +01:00
Antoine Prouvost 9c68ee239b
Refactor (some) OpenSSL functions (#3024)
* Add sha256 to cryptography

* Refactor cryptographic hasher

* Use new hasher in validation

* Split util::encoding

* Improve hash tests

* Move and refactor cache_name_from_url

* Fix conversion

* Fix namespace

* Fix conversion

* Refactor Base64 encoding

* Move URL percent encoding

* Document encoding.hpp

* Move EVPContextDeleter

* Add doc to DigestHasher

* Remove util::hex_string

* Add UTF8 source file encoding on Windows

* Add hex_to_bytes

* Use util::hex_to_bytes

* Private Digest inheritance

* Make thread_local hasher

* Use digester in validation

* Fix Win
2023-12-04 16:11:35 +01:00
Antoine Prouvost 0a0df09481
Validation QA (#3022)
* RAII EVP_MD_CTX

* Remove wrong noexcept

* constexpr constants

* Forward nlohman

* No using namespace in public validation.hpp

* Remove wrong noexcept

* Prefer std::array

* Restore noexcept

* Fix nlohman namespace

* Split test_validate.cpp

* Cleanup after test
2023-11-29 17:19:25 +01:00
Antoine Prouvost 1ee4893eeb
Move core/channel > specs/channel (#3000)
* Move core/channel > specs/channel

* Remove unnecessary [[nodiscard]]

* Minor specs::Channel improvements

* Add value based ChannelResolveParams

* Add specs::Channel tests

* Add more Channel tests

* ChannelContext::context const only

* Remove unnecessary ChannelContext functions

* Rename core/channel.hpp > core/channel_context.hpp

* Sort (some) CMake files

* Refactor ChannelContext constructor

* Review comments

* Const reference

* Use ChannelContext::make_conda_compatible
2023-11-22 15:29:34 +01:00
Antoine Prouvost 2210f7db06
Add weakening_map (#2981)
* Add weakening_map

* Use weakening_map in Channel
2023-11-16 11:27:37 +01:00
Antoine Prouvost d116ff8917
Add cmake-format (#2962)
* Add cmake-format

* Apply cmake-format
2023-11-07 11:08:26 +01:00
Hind-M 2b948ce1cc
Add mirrors (#2795)
* Add mirrors

* Add test for split_path_tag

* Return string instead of vector when getting auth header

* Simplify data callback

* Update comment
2023-11-07 05:29:36 +01:00
Antoine Prouvost 80e3475e06
Explicit and smart CMake target (#2935)
* Explicit and smart CMake target

* Only expose explicit CMake targets
2023-10-31 12:07:03 +01:00
Antoine Prouvost 33649d1005
Add refactor getenv setenv unsetenv (#2944)
* Add refactor getenv setenv unsetenv

* Move to refactored env functions
2023-10-31 10:56:33 +01:00
Antoine Prouvost bca398a5dc
Refactor win encoding conversion (#2939) 2023-10-26 19:00:17 +02:00
Antoine Prouvost c7aba975b5
Resolve ChannelSpec into a Channel (#2899)
* Change URL custom_channel matcher

* Cannot change location at once

* Simpler channel_alias_location

* Change URL channel_alias matcher

* Refactor ChannelContext::from_url

* Add Windows URL path encoding test

* Simplify URL::set_path

* Fix URL encoding parsing

* Refactor platforms urls

* Fix missing forward declaration

* Fix Win file URL encoding

* Split Channel url functions

* Remove no-URL ctor from ChannelContext::from_name

* Remove no-URL ctor from ChannelContext::make_simple_channel

* Remove old Channel ctor

* Remove channel_alias_location

* Refactor Channel::base_url

* Try not to use location mamba.py

* Remove Channel comparison

* Try Channel::platform_url

* Refactor Channel::platform_urls to use platform_url

* Remove build_url

* Remove concat_scheme_url

* Use spec in from_name

* Tuple equality for URL

* Add tuple_hash

* Add std::hash<mamba::util::URL>

* Make CondaURL hashable

* Refactor make_channel

* New algorithm for authetification map

* Add specs::AutheticationDataBase

* Fix typo authentification > authentication

* Use AuthenticationDataBase

* Fix AuthenticationDataBase

* use AuthenticationDataBase::find_compatible

* Use canonical_name

* Add Credential check to URL

* Simplify crendential check in channel

* Refactor AuthDB credential setters

* No Channel::location in tests

* Remove Channel user scheme password

* Document AuthenticationInfo

* Remove Channel token

* Remove Channel::auth

* Remove Channel::package_name

* More replacement name > canonical_name

* Remove unused function

* No credential from URLs

* Remove unneeded header

* Disable Channel::repo_checker

This is disbled as TUF implementation is not well defined and this
function is not used except in experimental conditions.

* Apply auth info as needed

* Simplify custom_channels instanciation

* Simplify custom_multi_channels instanciation

* Review improvements
2023-10-25 19:06:46 +02:00
Antoine Prouvost 4e93b7967a
Add ChannelSpec (#2870)
* Make find_slash_and_platform private-lib

* Add ChannelSpec

* Add ChannelSpec::Type

* Add abs_path_or_url_to_url

* Add ChannelSpec path normalization and type detection

* Add ChannelSpec::location

* Allow any platform string in ChannelSpec

* Channel::platforms is a flat_set

* Move flat_set_caster to own file

* More flat_set in Channel

* Regenerate Python stubs

* Plug ChannelSpec into Channel

* Resolve path in ChannelSpec

* Fix env export channels

* No resolve symlink in ChannelSpec

* Fix tests on Windows

* Add ChannelSpec attribute extractors

* Add raw domain ChannelSpec test

* Use URL in read_channel_configuration

* Fix local channel name

* Improve path_to_url

* Construct from Channel from URL

* Properly parse channel alias

* Fix wrong move

* Channel alias is a CondaURL

* Add defaulted scheme to URL

* Add defaulted host to URL

* CondaURL tokens can only be at the begining

* Add CondaURL::path_without_token

* Add option to remove credentials in URLs

* Add empty cretendial URL tests

* Add str Credential options

* Add credential option to CondaURL::str

* Add split_prefix/suffix

* Add ChannelContext::from_package_path

* URL::pretty_path only on Windows

* Add ChannelContext::from_path

* Do not resolve paths in ChannelSpec

* Change mapping order in path resolving

* Compute URL canonical_name in read_channel_configurations

* Add URL::authority credentials

* Rename private URL::authentification > URL::authentifaction_elems

* Refactor URL::authority

* Refactor some read_channel_configurations

* Remove empty path URL case

* Add path_is_prefix

* Fix url_match

* Add flat_set doctest printer

* Add CondaURL doctest printer

* Alias dynamic_platform_set in ChannelSpec

* Use util:concat

* Restore subdir in matchspecs

* Make find_slash_and_platform private
2023-10-12 15:56:49 +02:00
Antoine Prouvost 0fbb0e4fab
Use CMake targets for reproc (#2883)
* Use CMake targets for reproc

* Use reproc-cpp-static on Windows

* Upper pin on Mamba
2023-10-02 18:01:14 +02:00
Johan Mabille bb08805c7e
Fixed libmamba tests static build (#2855) 2023-09-20 14:12:31 +02:00
Antoine Prouvost a527511c14
Add CondaURL (#2805)
* No build pattern in util::URL

* URL move string for already encoded operations

* Add exclusion characters to util::url_encode

* Add encoding of URL path

* Simplify URL file empty host handling

* Add raw URL::str

* Add path_get_drive_letter

* Url encode with char exclude

* Handle Windows drive encoding

* Add URL::clear_xxx

* Add CondaURL

* Add specs::known_platforms

* Fix CondaURL::token

* Add CondaURL::platform

* Fix pybind tests

* Add CondaURL::package

* Rename specs/url.hpp > specs/conda_url.hpp
2023-09-07 16:59:46 +02:00
Klaim (Joël Lamotte) bbac096a04
Context: not a singleton (#2615)
Context is not a singleton anymore.

---------

Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
2023-09-05 10:55:43 +02:00
Antoine Prouvost 3fcff3904b
Windows path manipulation and other cleanups (#2801)
* Add path_win_to_posix

* Move path_has_drive_letter and is_path

* Refactor on_[plat]

* Add util::path_to_posix

* Fix static builds
2023-08-31 22:10:18 +02:00
Antoine Prouvost 7b23f51c75
Various fixes (#2800) 2023-08-31 15:31:00 +02:00
Antoine Prouvost e5abd4249f
Fix pins (#2786)
* Add libsolv test scenarios

* Fix pins

* Add test for python pinning

* Fix test

* Deactivate test on Windows
2023-08-29 03:32:09 +02:00
Johan Mabille 6e4d91e2ec
New apis for downloading (#2695)
* New apis for downloading

* Changes according to review

* Added minimal test and fixed issues

* Python backward compatibility
2023-08-23 09:07:20 +02:00
Antoine Prouvost df918ccf06
Isolate URL object (#2744)
* Add remove_(prefix|suffix)

* Refactor and document unc_url

* Remove unused functions

* Add CURLUrl wrapper

* Hide CURL from URLHandler

* Rename URLHandler > URL

* Simplify test_url

* Fix path setter

* Add URL builder tests

* Rename URL::url > URL::str

* Rename URL ctor URL::parse

* Refactor has_scheme

* Add get_scheme

* Add scheme option to URL::parse

* Add scheme option to URL::str

* Fix build

* Add has_drive_letter

* Rename and document scheme functions

* Stronger URL invariant

* Rename URL::auth > URL::authentication

* Add URL::authority

* Add URL IP tests

* Document URL

* Fxi rebase util/string

* Fix channel tests

* Allow password without user in URL

* Scope util::URL

* No context in test_url_manip

* Remove unused CURLEasyHandle

* remove declaration

* Add case handling to URL

* Add URL::operator==

* Add URL::operator/

* Test url encoding

* Reimplement URL encoding without CURL

* Fix MSVC

* Add URL::user encoding

* Add URL::password encoding

* Add URL::host encoding

* Add URL::str options

* Small URL imrovement in channel.cpp

* Fix URL auth encoding

* Added review suggestions from @Hind-M
2023-08-21 11:43:09 +02:00
Antoine Prouvost 03e34174dc
Move util_string to utility library (#2739) 2023-08-11 13:32:15 +02:00
Antoine Prouvost 3c3fa084e2
specs platform (#2729)
* Add platform enum

* Use specs::Platform in context

* Use specs::Platform in RepoData

* Fix MSVC builds

* Fix msvc build
2023-08-08 11:45:36 +02:00
Antoine Prouvost 2fe055d00f
Add VersionSpec (#2502)
* Add specs::Version default ctor

* Add spec::VersionInterval

* Add VersionSpec

* Add starts_with char overloads

* Partial VersionSpec::parse

* Improve layout

* Remove merge conflict

* Add empty version constructor test

* Add missing headers

* Rewrite VersionSpec in term of VersionPredicate

* Handle empty expressions in Postfix and Infix parsers

* Add tests and fix to VersionSpec::parse

* Add util_string is_punct

* Add VersionPredicate::not_starts_with

* Fix Version::starts_with

* Refactor VersionSpec::parse to better handle globs

* Add Version and VersionSpec litterals

* Fix '*' and '~=1.1' cases in VersionSpec::parse

* Refactor VersionSpec tests and add conda tests

* Fix std::max overload on MSVC
2023-07-20 11:41:26 +02:00
Antoine Prouvost a5f9742165
Add boolean expression tree (#2591)
* flat_bool_expr_tree postfix ctor and evaluation

* Add simple binary tree

* Add Postfix parser

* Rewrite flat_bool_expr_tree to use parser

* Add InfixParser

* Refactor exponential bool loop

* Add Infix extended test

* Fix missing header

* Add negative parser testing

* Change Postfix tree building

* Add advanced Infix expression validation

* Add flat_bool_expr_tree doc

* Remove not implemented function

* Implement revision suggestion

* Split flat_binary_tree in own header

* Add more documentation on flat_binary_tree

* Explicitly default flat_bool_expr_tree ctor

* Add is_ostreamable type_trait

* Add op/ver repr in flat_bool_tree exception
2023-07-19 16:56:22 +02:00