Commit Graph

315 Commits

Author SHA1 Message Date
Ayaz Salikhov 0a8128d23e
maint: Enable `-Werror` compiler flag for GCC, Clang and AppleClang (#3611) 2024-11-21 13:50:09 +01:00
Hind Montassif feafaf0e96 release libmamba 2.0.4alpha3, libmambapy 2.0.4alpha3, micromamba 2.0.4alpha3 2024-11-21 13:02:28 +01:00
Ayaz Salikhov ad9b2d6b88
maint: Update clang-format to v19 (#3600) 2024-11-18 17:29:18 +01:00
Hind Montassif 333abd0eea release libmamba 2.0.4alpha2, libmambapy 2.0.4alpha2, micromamba 2.0.4alpha2 2024-11-14 18:00:59 +01:00
Hind Montassif 538ab0b476 release libmamba 2.0.4alpha1, libmambapy 2.0.4alpha1, micromamba 2.0.4alpha1 2024-11-12 15:24:25 +01:00
Hind Montassif e1bdc942af release libmamba 2.0.4alpha0, libmambapy 2.0.4alpha0, micromamba 2.0.4alpha0 2024-11-12 11:56:23 +01:00
Johan Mabille c511d5c9f7 release libmamba 2.0.3, libmambapy 2.0.3, micromamba 2.0.3 2024-11-05 21:41:04 +01:00
Henry Schreiner 5bfdd90adf
chore: some CMake cleanup (#3564)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2024-10-28 11:58:57 +01:00
Johan Mabille 31b23473e0 release libmamba 2.0.2, libmambapy 2.0.2, micromamba 2.0.2 2024-10-02 18:03:58 +02:00
Johan Mabille 9fc7b99ea3 release libmamba 2.0.1, libmambapy 2.0.1, micromamba 2.0.1 2024-09-30 22:05:50 +02:00
Johan Mabille a656fe9524 release libmamba 2.0.0, libmambapy 2.0.0, micromamba 2.0.0 2024-09-25 11:31:42 +02:00
Hind Montassif d3cb2f8a0c release libmamba 2.0.0rc6, libmambapy 2.0.0rc6, micromamba 2.0.0rc6 2024-09-20 15:58:06 +02:00
Hind Montassif f1f0827e08 release libmamba 2.0.0rc5, libmambapy 2.0.0rc5, micromamba 2.0.0rc5 2024-09-13 10:55:58 +02:00
Wolf Vollprecht a261cd461d
fix: add warning when using defaults (#3434)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Hind Montassif <hind.montassif@gmail.com>
Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
Co-authored-by: Sylvain Corlay <sylvain.corlay@gmail.com>
2024-09-12 19:28:40 +02:00
Hind Montassif 3bc31adbf0 release libmamba 2.0.0rc4, libmambapy 2.0.0rc4, micromamba 2.0.0rc4 2024-08-29 15:35:30 +02:00
Hind Montassif aaf8d206ae release libmamba 2.0.0rc3, libmambapy 2.0.0rc3, micromamba 2.0.0rc3 2024-08-26 15:44:46 +02:00
Hind Montassif f4ab0b2377 release libmamba 2.0.0rc2, libmambapy 2.0.0rc2, micromamba 2.0.0rc2 2024-08-19 09:16:57 +02:00
Julien Jerphanion 154012f256
Replace `Context` with `Context::platform` where possible (#3364)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-07-29 10:59:27 +02:00
Johan Mabille bdae0a1405 release libmamba 2.0.0rc1, libmambapy 2.0.0rc1, micromamba 2.0.0rc1 2024-07-27 01:08:20 +02:00
Johan Mabille 5c954c75c8 release libmamba 2.0.0rc0, libmambapy 2.0.0rc0, micromamba 2.0.0rc0 2024-07-08 09:32:53 +02:00
Klaim (Joël Lamotte) 76570f83b8
Splitt `ContextOptions::enable_logging_and_signal_handling` into 2 different options (#3329)
Splitt `ContextOptions::enable_logging_and_signal_handling` into 2 different options.
2024-06-19 16:29:47 +02:00
Johan Mabille f5abb6e1c7 release libmamba 2.0.0beta3, libmambapy 2.0.0beta3, micromamba 2.0.0beta3 2024-06-14 11:34:27 +02:00
Klaim (Joël Lamotte) ab088e5d8a
libmambapy: use `Context` explicitly (#3309)
* All python singletons lifetime are bound to a unique `Context` instance lifetime

In `libmambapy`:
- bound singletons lifetime to the first `Context` instance created
- throw an error if more than one `Context` instance are created at any time
(this only applies to python and will be changed at another time)
- therefore the python user must create a `Context` before using any other functions

This specific change does not (yet) changes the other functions APIs to take
explicitly the `Context` object.

* simplify python expressions

* python API change, added requirement for a `Context` instance

affected functions:
- MultiPackageCache (constructor)
- SubdirData.create_repo
- SubdirIndex.create
- SubdirIndex.download
- clean
- transmute
- get_virtual_packages
- cancel_json_output

* libmamba loggers are now unregistered when Context instance is destroyed

* fixed: dont use `default` as a name

* remove quick-test file

* linter fixes

* Updated documentation

* temptative fix for potential data race in libmamba tests

* libmamba tests: added an assertion to be sure

* linter pass

* fixup libmambatests

* added log for helping understanding ci failure

* review fixes
2024-06-14 09:50:58 +02:00
Hind Montassif 45e4b7c8ba release libmamba 2.0.0beta2, libmambapy 2.0.0beta2, micromamba 2.0.0beta2 2024-06-07 10:21:19 +02:00
Hind-M 3e1e97b0e6
Add checking typos to pre-commit (#3278)
* Add checking typos to pre-commit

* Add missed corrections

* Add more corrections to doc
2024-05-27 09:16:14 +02:00
Johan Mabille 9006fb963b release libmamba 2.0.0beta1, libmambapy 2.0.0beta1, micromamba 2.0.0beta1 2024-05-04 17:16:21 +02:00
Johan Mabille a0d2333a03 release libmamba 2.0.0beta0, libmambapy 2.0.0beta0, micromamba 2.0.0beta0 2024-05-03 23:06:07 +02:00
Antoine Prouvost 80f1e84d49
Bind text_style and graphic params (#3266)
* Rename binding utils.hpp > bind_utils.hpp

* Bind fmt::text_style

* Change format type in Unsolvable explain message

* Bind attributes

* Bind GraphicsParams
2024-04-08 16:39:38 +02:00
Johan Mabille b5195d96b0 release libmamba 2.0.0beta0, libmambapy 2.0.0beta0, micromamba 2.0.0beta0 2024-04-04 09:29:13 +02:00
Antoine Prouvost 43be9b51d2
Add missing pybind header (#3256) 2024-03-29 18:19:28 +01:00
Antoine Prouvost 9ad283aa46
Bind VersionPredicate (#3255) 2024-03-29 18:00:02 +01:00
Antoine Prouvost 08d7b4e9cb
Don't add duplicate .conda and .tar.bz2 packages (#3253)
* Refactor signatures arg

* Remove set_solvables_with_sigs

* Fix optional signature type

* Change Database package type interface

* Change PackageType for libsolv parser

* Change PackageType for mamba parser

* Don't duplicate .conda and .tar.bz2 in mamba exe

* Fix error message disconnected graph
2024-03-29 12:07:35 +01:00
Antoine Prouvost 245de2009e
Update pre-commit hooks" (#3252)
* Update Pre-commit hooks

* Apply updated hook
2024-03-28 16:18:19 +01:00
Johan Mabille 3a31b8390a release libmamba 2.0.0alpha4, libmambapy 2.0.0alpha4, micromamba 2.0.0alpha4 2024-03-26 06:34:09 +01:00
Antoine Prouvost 7942d3feaf
Handle regex in build string (#3239) 2024-03-20 18:52:22 +01:00
Antoine Prouvost 43e38efb18
Custom resolve complex MatchSpec in Solver (#3233)
* Add ObjPool::current_error

* Support reference_wrapper in MatchSpec::contains

* Rename subdir > platform in solv-cpp

* Add Matcher as namespace callback

* Add MatcherFlags

* Redefine MatchSpec::is_simple

* Add VersionSpec::from_predicate

* Refactor reinstall jobs

* Fix MatchSpec::is_simple

* Handle complex MatchSpec in solver

* Add version cache in Matcher

* Add more pool namespace tests

* Handle exception in ObjPool callback

* Try removing SOLVABLE_PROVIDES

* Add unsolvable complex spec test

* Fix Database callback exceptions

* Add channel in Matcher

* Adapt channel_specific tests

* Fix updates
2024-03-19 19:52:56 +01:00
Antoine Prouvost 7125518164
Add MatchSpec::contains_except_channel" (#3231)
* Add MatchSpec::contains_except_channel

* Add MatchSpec::contains_except_channel overload

* Bind MatchSpec::contains_except_channel

* Add documentation for MatchSpec::contains
2024-03-13 16:37:25 +01:00
Hind-M ce840bbf8c
[mamba content trust] Enable verifying packages signatures (#3192)
* Enable verifying packages signatures

* Remove post hook and use LOG_DEBUG instead of LOG_INFO

* Move getting "signatures" from `pkg_signatures` to `verify_package`

* Add tests for solvable and PackageInfo
Remove signatures from field in PackageInfo

* Add const and reorganize repo_checker
Add text in description for verify-package flag

* Add bindings and make `trusted_channels` configurable

* Define MAX_CONDA_TIMESTAMP

* Code review

* Add tests for add_repo_from_repodata_json in test_database

* Remove fake_signatures in favor of optional
2024-03-08 20:37:18 +01:00
Antoine Prouvost c54ab6ce7b
Refactor MatchSpec::str (#3215)
* Add split_once_on_any

* Split MatchSpec::track_features

* Add VersionSpec::expression_size

* Add UnresolvedChannel::is_package

* Refactor MatchSpec::str to use fmt

* Forbid version of in MatchSpec in attributes

* Document more Conda discrepencies
2024-03-08 17:09:22 +01:00
Antoine Prouvost fd42d8dd8e
Subdir renaming (#3214)
* Rename PackageInfo::depends > dependencies

* Change BuildNumberSpec nuild number type

* Rename MatchSpec::subdirs > platforms

* Rename Platform > KnownPlatform

* Add DynamicPlatform alias

* Rename PackageInfo::subdir > platform

* Fix build platform

* Fix PackageInfo::platform on OSX
2024-03-05 16:31:54 +01:00
Antoine Prouvost 9965527410
Fully bind MatchSpec (#3213)
* Fix MatchSpec name_space bounds

* Bind MatchSpec to Python

* Add specs binding negative tests
2024-03-04 21:35:58 +01:00
Johan Mabille 7da42636df release libmamba 2.0.0alpha3, libmambapy 2.0.0alpha3, micromamba 2.0.0alpha3 2024-02-28 06:09:54 +01:00
Johan Mabille 8f276cbefa
Added HTTP Mirrors (#3178)
* Added HTTP Mirrors

* Mirror mirror on the wall...

* True hope lies beyond the coast

* You're a damned kind can't you see

* That the winds will change

* Mirror mirror on the wall

* True hope lies beyond the coast

* You're a damned kind can't you see

* That tomorrow bears insanity
2024-02-27 18:47:30 +01:00
Antoine Prouvost 88748be956
Use expected for specs parsing (#3201)
* Expected in Version::parse

* Use boolean check in expr trees

* Expected in VersionSpec::parse

* Add assert caster safeguard

* Expected in BuildNumberSpec::parse

* Minor improvement in GlobSpec

* Expected in UnresolvedChannel::parse

* Expected in URL::parse
2024-02-27 09:35:27 +01:00
Antoine Prouvost e276fa3d2e
Add more solver tests and other small features (#3198)
* Add clean_dependencies to Request::Update

* Allow pins without installed repo

* Add more solver tests

* Filename repodata fallback

* Fix repodata test

* Add channel specific solver test

* Add solver conflict test
2024-02-22 17:33:54 +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 00219a578e
Add libsolv.Database Bindings and tests (#3186) 2024-02-12 08:47:53 -05:00
Antoine Prouvost d20d176b86
Rename MPool into solver::libsolv::Database (#3180)
* Move only MPool

* Rename MPool > Database

* Move Database to solver::libsolv

* Add missing explicit

* Rename pool in function names

* Rename core/pool.hpp package_database_loader
2024-02-08 16:41:11 +01: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 b3cb456764
Clean libsolv use in Transaction (#3171)
* Take by value and move in TransactionContext

* Refactor Transaction from Lockfile

* Refactor remove/install Transaction ctor

* Add MPool::for_each_package_in_repo

* Attempt fix forced remove

* Move Python search in MPool not ObjPool

* Use solver functions

* Move Solution post-processing to solver

* Remove Pool, Context, ChannelContext captrure from Transaction
2024-02-05 13:40:47 -05:00
Hind Montassif 6618349cba release libmamba 2.0.0alpha2, libmambapy 2.0.0alpha2, micromamba 2.0.0alpha2 2024-02-02 17:37:25 +01:00
Antoine Prouvost 551540ba0a
Improve Query API (#3167)
* Clean Query

* Bind Query alike to C++
2024-02-01 10:21:41 -05:00
Antoine Prouvost a182b1d453
Bind solver::libsolv::UnSolvable (#3166) 2024-01-31 16:34:55 -05:00
Antoine Prouvost 9f1b5b7e06
Solver sort deps (#3163)
* Improve Solver::solve

* Add Solver request ordering

* Refactor context solver flags

* Add config option order_solver_request

* Fix config

* Change pin test expected solution

* Refactor custom variant comparison

* Add 2.0 order_solver_request doc
2024-01-31 16:21:29 -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
Antoine Prouvost b270d9f6b3
Refactor solver flags (#3153)
* Rename Solver keep_specs > keep_user_specs

* Refactor hide libsolv solver flags

* Move Solver flags in Request
2024-01-25 17:07:54 +01:00
Antoine Prouvost a190d9394c
Solver Request (#3141)
* Change type for MSolver::add_pin

* Add Solver Request 1

* Add Solver Request 2

* Add Solver Request 3

* Cleanup retry flags

* Remove constant parameter

* Add Solver Request 4

* Add Request::Freeze

* Add Request::Keep

* Add Request::UpdateAll

* Remove MSolver::add_global_job

* Use MSolver::add_request for remove

* Remove MSolver::add_jobs

* Remove MSolver::add_pins

* Add api/install pins in request

* Add api/update pins in request

* Remove MSolver::add_pin

* Remove dead MSovler neuter_specs & pinned_specs

* Move Request to solver::Request

* Bind solver::Request

* Apply review comments
2024-01-23 13:38:11 +01:00
Antoine Prouvost e8793e59e6
Solver improvements (#3140)
* Change serializing of pin

* Change pin names

* Rename MSolverProblem > SolverProblem

* Move pool_add_matchspec to helpers

* Move transaction_to_solution to helpers

* Remove MSolver::add_constraints

* Move pool_add_pin to helpers

* Remove MSolver pointer convertion

* Remove MSolver macro flags
2024-01-19 10:04:45 +01:00
Antoine Prouvost 0324bd74b0
No M (#3137) 2024-01-18 08:44:23 +01:00
Antoine Prouvost a29f500d17
Fix expected caster (#3136) 2024-01-17 16:54:59 +01:00
Antoine Prouvost 7d6856e9b5
MRepo refactor (#3118)
* Rename Enum members in MRepo

* use solv::Pool in MRepo

* Free MRepo add_pip_as_python_dependency

* Free MRepo repodata reading

* Free MRepo read_solv

* Free MRepo write_solv

* Remove MRepo constructor

* Remove MPool capture from MRepo

* Add missing pip dependency

* Refactor solv file serialization

* No lock on non-existant files

* Cleanup dead code

* write_solve create-directories

* Clean MRepo member functions

* Decouple MRepo and Pool

* Finetune Clang-format

* Add filename location to error

* Do not fail on solv file write

* Load new pool loader for repodata and .solv files

* Remove repo name in favor of URL

* Refactor MRepo index loading

* Fix SubDirData.writable_solv_cache

* Fix solv file loading

* Lock repodata.json while reading metadata

* Refactor expected in load_subdir_in_pool

* use expected in solver helpers

* Refactor helpers functions and error messages in Repo

* Add MPool::create_repo_from_packages

* Use load_installed_packages_in_pool

* Remove MRepo ctor

* Fix rebase

* Refactor MRepo::priority

* Update Taskfile realpath to work on MacOS

* Fix virtual packages being removed

* Move MRepo::priority to MPool

* Rename MRepo > solver::libsolv::RepoInfo

* Move RepoInfo parameters for its own library

* Move make_package_info to helpers

* Add libmambapy.solver.libsolv

* Add solver::libsolv::Priorities op

* Bind libsolv parameters

* Bind RepodataOrigin

* Merge libsolv/serialization and libsolv/parameters

* Bind new MPool methods

* Add RepoInfo op

* Add RepoInfo changes to log

* Rename attribute

* Remove RepoInfo::repo
2024-01-17 16:44:47 +01:00
Antoine Prouvost cc95098a57
Add expected caster to Union (#3135) 2024-01-17 16:44:21 +01:00
Antoine Prouvost 8ab10efa07
Pool channel match (#3122)
* Add Match return type to Channel::contains_package

* Simplify channel specific matchspec in Pool

* (Dirty) fix force reinstall
2024-01-11 15:07:54 +01:00
Antoine Prouvost 43e24a864d
Add Channel::contains_package (#3121)
* Add CondaURL literals

* Add Channel::contains_package

* Fix test case name

* Bind Channel::contains_package
2024-01-11 10:10:36 +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 6bf43a6d4f
Change PackageInfo types (#3113)
Use NoArchType in PackageInfo
2024-01-08 17:52:17 +01:00
Antoine Prouvost 717456890a
Move PackageInfo in specs:: (#3109)
* Move PackageInfo in specs::

* Move PackageInfo in specs::

* Rename PackageInfo::url > PackageInfo::package_url

* Add changelog entry

* Add MatchSpec migration help
2024-01-08 16:06:22 +01:00
Antoine Prouvost dae5e0e378
NoArchType as standalone enum (#3108)
* NoArch as standalone enum

* Bind NoArchType
2024-01-08 14:26:42 +01:00
Antoine Prouvost 53a5171360
Clean PackageInfo interface (#3103)
* Refactor PackageInfo operator==

* Remove unused headers

* Simplify PackageInfo interface

* Move PackageInfo signature order

* Change type for PackageInfo::defaulted_keys

* Use nlohman::from_json for PackageInfo

* Use nlohman::to_json for PackageInfo

* Fallback in PackageInfo::str

* Rename PackageInfo::fn > filename
2024-01-05 18:26:51 +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 b9706dce32
MatchSpec use VersionSpec (#3089)
* Don't use members as wip vars

* Make conda-build compatible VersionSpec str

* Add VersionSpec::is_explicitly_free

* Strenghten sat attrs ref

* Try pluging VersionSpec in MatchSpec

* Change type of MatchSpec::version

* Fix MatchSpec::conda_build_str

* Adjust MatchSpec tests
2024-01-02 12:55:42 +01:00
Antoine Prouvost 3f6484c23c
Fix VersionSpec free ranges (#3088) 2023-12-28 13:33:48 +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 152857f059
Add VersionSpec::str (#3081)
* Add flat_bool_expr_tree:infix_for_each

* Add level to Version repr

* Add VersionSpec::str
2023-12-22 14:19:33 +01:00
Antoine Prouvost 2d85759c13
More specs bindings (#3080)
* Bind archive

* Minor specs::Version improvements

* Bind specs::Version

* Bind VersionSpec

* Use alias
2023-12-22 08:54:02 +01:00
Johan Mabille 29a19e1ef5 release libmamba 2.0.0alpha1, libmambapy 2.0.0alpha1, micromamba 2.0.0alpha1 2023-12-18 11:50:36 +01:00
Antoine Prouvost 6ed8c23721
Fix 2.0 alpha (#3067) 2023-12-18 10:50:47 +01:00
Johan Mabille c54c4b530e release libmamba 2.0.0alpha0, libmambapy 2.0.0alpha0, micromamba 2.0.0alpha0 2023-12-14 16:42:44 +01:00
Daniel Holth d12d77056c
restore use_default_signal_handler flag for libmambapy (#3028) 2023-12-07 23:33:23 +01:00
Antoine Prouvost 21675b6517
Enforce space between definitions (#3049) 2023-12-07 23:00:25 +01:00
Antoine Prouvost f36c3f222e
Change MatchSpec::parse to named constructor (#3048) 2023-12-07 16:06:02 +01:00
Antoine Prouvost d3b72c44fb
Plug ChannelSpec in MatchSpec (#3046)
* Plug ChannelSpec in MatchSpec

* Remove unused split_platform

* Fix channel specific error messages

* Fix MatchSpec tests

* Remove ChannelSpec Context and ChannelContext dep
2023-12-07 13:45:56 +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 ecd6de037c
Bind ChannelContext (#3034)
* Bind ChannelContext

* Deprecate Context() in Python

* Remove ChannelContext singleton
2023-12-05 17:52:13 +01:00
Antoine Prouvost 5509ed3044
Bind Channel (#3001)
* Rename binding functions

* Minimal specs bindings

* Add ChannelSpec setters

* Fix flat_set caster

* Bind ChannelSpecs

* Bind Platform

* Rename CondaURL::base > CondaURL::generic

* Automatically convert enums from strings

* Fix CondaURL encoding bug

* Bind CondaURL

* Add comparison for AuthenticationInfo

* Bind AuthenticationInfo

* Rename libmambapy tests

* Bind AuthenticationDataBase

* Fix binding size

* Add weakening_map comparison

* Refactor AuthenticationDataBase bindings

* Bind ChannelResolveParams

* Separate binding utility functions

* Bind CondaURL / subpath

* Fix Channel

* Bind Channel

* Modify specs import

* Remove ChannelSpec setters

* Simplify channel tests
2023-11-28 20:50:51 +01:00
Antoine Prouvost abd21ccc8c
Remove ChanelContext context capture (#3015)
* Remove some ChannelContext::context

* Explicit Context capture in SubdirData

* Explicit Context param in MatchSpec

* Move URL hardening to Transaction

* Remove Context capture in ChannelContext
2023-11-28 18:32:09 +01:00
Antoine Prouvost 1230b92094
Move to Ruff (#3011)
* Use Ruff LSP

* Remove unused imports

* More Ruff fixes

* Remove unused test vars

* Explicit import

* Explicit import

* Explicit import

* Explicit import

* Explicit import

* Warning fixes

* Import fixtures

* Add ruff pre-commit

* Remove pre-commits checks superceded by ruff

* Fix imports

* Fix ruff warning

* Fix test_linking fixtures

* Fix typo

* Fix test_update fixture import

* Python line-length to 100

* Reformat Python code line length

* Fix typo
2023-11-27 19:10:34 +01:00
Antoine Prouvost acd357df95
Remove ChannelContext ctor (#3002) 2023-11-22 18:45:43 +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 e874e7ea71
Migrate Channel::make_channel to resolve multi channels (#2986)
* Add one to many get_channels

* Refactor ChannelContext params

* ChannelContext::make_channel migration 1

* ChannelContext::make_channel migration 2

* ChannelContext::make_channel migration 3

* ChannelContext::make_channel migration 4

* ChannelContext::make_channel migration 5

* ChannelContext::make_channel migration 6

* ChannelContext::make_channel migration 7

* Remove Channel bindings

* Remove ChannelContext::make_channel

* ChannelContext::get_channels migration 1

* ChannelContext::get_channels migration 2

* ChannelContext::get_channels migration 3

* Remove get_channels bindings

* Remove ChannelContext::get_channels

* Channel::resolve return a list

* Resolve multi_channel in Channel::resolve

* Use weakening map for multi_channels

* Split Channel resolve_name

* Cleanup signatures

* Add Channel::clear_xxx

* Force removal of trailing '/' in Channel

* Add weak channel comparison

* Use better channel comparisons

* Remove Channel::base_url

* Rename Channel::make_chan > make_channel

* Add doc

* Resolve Channel paths from params

* Review from JohanMabille

* Fix absolute path
2023-11-21 12:07:19 +01:00
Antoine Prouvost cd744e765c
Channel initialization (#2953)
* Set default_channels at config level

* Resolve default multi channel at the config level

* Fix Yaml source printers

* Resolve local multi channel at the config level

* Remove ChannelContext::make_simple_channel

* Remove Channel::name usage

* Factorize split_once functions

* Try looking for name match in URL path

* Refactor ending_splits_in

* Code improvement

* Replace get_common_parts with concat_dedup

* Remove Channel::name

* Remove Channel::location

* Use URL for priority in channel loader

* Make Channel value-based

* Add range hashing

* Add Channel comparison and hash

* Make channel map/list return by value

* Resolve 1

* Resolve 2

* Resolve 3

* Remove unknown channels

* Hide get_known_platforms

* Add unknown ChannelSpec

* Remove unused function

* Rename Channel::canonical_name > display_name

* Remove Channel friend class

* Add Channel::resolve

* Remove ChannelContext::from_value
2023-11-15 15:52:59 +01:00
Antoine Prouvost 0d42e81667
Modularize libmambapy (#2960)
* Modularize libmambapy

* Add test-libmambapy to Taskfile

* Fix libmamba installation

* Fix standalone libmambapy configuration

* Change libmambapy layout

* Add scikit-build

* Fix libmambapy extension name

* Add submodules shims

* Fix libmambaoy tests

* Fix stubgen

* Adapt libmambapy tests to scikit-build

* Read version from Python

* Replace confusing names
2023-11-10 18:29:16 +01:00
Antoine Prouvost d116ff8917
Add cmake-format (#2962)
* Add cmake-format

* Apply cmake-format
2023-11-07 11:08:26 +01:00
Antoine Prouvost fdf2b65a27
Refactor CI and libamambapy tests (on Unix) (#2952)
* Add simple libmambapy test

* Use CMakePresets in CI

* Share workspace between jobs

* Add Conda dependency

* Remove CMake STRIP

* Fix menuinst skipping

* Refactor CMakePresets

* Change ccache key

* Add pkg-config
2023-11-02 13:55:39 +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
Julien Jerphanion cab1bbfdbb
fix: Parse `remote_connect_timeout_secs` as a double (#2949)
* fix: Parse `remote_connect_timeout_secs` as a double

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

* test: Test parsing of `.condarc`

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

* fixup! test: Test parsing of `.condarc`

* lint: Format .condarc

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2023-10-30 13:46:35 +01:00
Antoine Prouvost 6592c84084
Combine dev environments (#2937) 2023-10-26 12:48:50 +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