Commit Graph

1112 Commits

Author SHA1 Message Date
Ayaz Salikhov 6467000748
Fix some warnings (#3595) 2024-11-14 13:27:08 +01:00
Ayaz Salikhov 0f4ad44c2e
Update pre-commit hooks except clang-format (#3599) 2024-11-14 10:27:18 +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
Klaim (Joël Lamotte) 48df20618f
Fix: json parsing error due to wrong encoding of Python output (#3584) 2024-11-12 10:27:10 +01:00
ChaonengQuan 554d9264da
fix: Skip misformatted configuration files (#3580)
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Chaoneng Quan <chaonengquan@Chaonengs-MacBook-Pro.local>
2024-11-12 10:16:22 +01:00
Klaim (Joël Lamotte) a638f702e2
Adds logs clarifying the source of the error "could not load prefix data (#3581) 2024-11-07 17:32:48 +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
Hind-M 94bb087acb
Fix locking error (#3572) 2024-10-30 14:50:16 +01:00
Hind-M 0075a24e4c
pip packages support with `list` (#3565) 2024-10-30 10:20:25 +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
Hind-M 47e962968d
Fix test on windows (#3555) 2024-10-28 09:43:29 +01:00
Julien Jerphanion bd8c1d2e4d
fix: Only register channels in the context once (#3521)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-10-23 11:09:48 +02:00
Klaim (Joël Lamotte) 651622b72d
windows shell init files use executable name (#3546)
* shell-init: Windows bat paths are factorized and depend on exe name (micromamba or mamba) except for mamba_hook.bat which for now needs to keep that name whatever the exe name;
* Fixed windows version detection: When more than one line of output appears at the start of cmd (because of AUTORUN), we parsed only the first line which failed the version detection. This version simply search every line instead of just the first one.
It also clarifies through more precise logs the exact reason why enabling long-paths actually failed.
* Improved error output for clarity on failure to create shell-init files (.bat) or directories.

---------

Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
2024-10-21 17:31:18 +02:00
Hind-M 3d9486fea5
Fix relative path in local channel (#3540)
Fix relative path in local channels
2024-10-21 15:09:57 +02:00
Hind-M 607c39035c
Correctly rename test to be run (#3545)
* Correctly rename test to be run

* Fix test

* Skip oci test

* Real fix hopefully

* Skip test on windows

* Adjust comment
2024-10-21 09:18:57 +02:00
Hind-M 3d71f57517
Create empty base prefix with `env update` (#3519) 2024-10-16 10:53:51 +02:00
Julien Jerphanion c329ca0401
fix: Use POSIX-compliant scripts (#3522)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-10-15 18:30:46 +02:00
Julien Jerphanion 764f85f881
maint: Clarify `env` subcommand documentation in help menu (cont'd) (#3539)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-10-15 18:30:24 +02:00
NewUserHa 9eb24012fc
fix: Handle space in `mamba` and `micromamba` executable absolute paths (#3525) 2024-10-15 18:06:57 +02:00
Julien Jerphanion 5e30f9f777
maint: Clarify `env` subcommand documentation in help menu (#3502)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com>
2024-10-15 17:07:20 +02:00
Hind-M 215e5e522a
Add recommendation if error with root prefix (#3513)
Add recommendation if error
2024-10-07 19:43:03 +02:00
Julien Jerphanion c4068d3117
fix: Ignore inline comment in environment specification (#3512)
Fix https://github.com/mamba-org/mamba/issues/3509

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-10-07 19:18:31 +02:00
mleistner-bgr 1e8694e1fc
Replace `[System.IO.Path]::GetFileNameWithoutExtension` with `-replace` (#3510) 2024-10-07 18:25:02 +02:00
Johan Mabille 553eace9d7
Replaced rstrip reimplementation with call to remove_suffix (#3508) 2024-10-04 16:46:37 +02:00
Hind-M 80c8b184d0
Fix warnings and co (#3507) 2024-10-04 14:41:50 +02: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
Julien Jerphanion b7367417f7
fix: Handle `MatchSpec` with brackets when parsing environments' history (#3490)
* fix: Adapt `parse_comment_line` to handle more `MatchSpec`

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

* test: Add non-regression python test

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

* test: Add non-regression C++ test

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

* Apply review comments

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

Co-authored-by: Johan Mabille <johan.mabille@gmail.com>

* test: Skip test on Windows

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

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
2024-10-02 17:21:57 +02:00
Johan Mabille d162759107
Win activate (#3489)
* Fixed activation scripts for cmd.exe

* Fixed get_PATH on Windows

* linter
2024-10-02 15:06:53 +02:00
Hind-M 45c437a3c8
Fix `channel` and `base_url` in `list` cmd (#3488)
* Fix channel and base_url in list cmd

* Add func

* Fix oci tests
2024-10-02 14:01:07 +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 f8bfd115df
Fixed channel output in umamba list (#3486)
Fixed channel output in umamba list
2024-09-30 21:49:44 +02:00
Johan Mabille b23a07956a
--full-name option for list (#3485)
Added --full-name option to the list command
2024-09-30 19:28:04 +02:00
Julien Jerphanion 0b824fe252
fix: Support for PEP 440 "Compatible Releases" (operator `~=` for `MatchSpec`) (#3483)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
2024-09-30 16:41:49 +02:00
Johan Mabille 2e8b3ee7bc
Fix micromamba activate on Windows (#3484)
Fixed mamba_hook.bat
2024-09-30 16:06:13 +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
Julien Jerphanion 860ae0ea04
test: `MatchSpec` edges cases (#3458)
Add edge case test

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-09-20 14:49:54 +02:00
Hind-M ad8ca3cf02
Compute `root prefix` as mamba install path (#3447)
* Compute root prefix as mamba install path

* Run test only on linux

* Test conflict between conda and mamba with same base env in CI

* Change strategy

* Use target_compile_definitions instead of add_definitions

* Add test logs

* Add ENABLE_MAMBA_ROOT_PREFIX_FALLBACK OPTION
2024-09-20 14:36:17 +02:00
Julien Jerphanion 1c755675bf
fix: Handle extra white-space in `MatchSpec` (#3456)
* test: Add non-regression test for #3453

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

* Minimal suboptimal fix

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

* Add edge cases to the env specification

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

* test: Add `MatchSpec` parsing subcases

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

* test: Complete `test_env_create_whitespace`

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

* Add kytea test case

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

* Merge replacement of binary operators

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

* Lint with pre-commit

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

* Adapt MatchSpec

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

Co-authored-by: Hind Montassif <hind.montassif@gmail.com>

* Remove redundant test

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

Co-authored-by: Hind Montassif <hind.montassif@gmail.com>

* Rename subcase

Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com>

* Adapt comparison on versions

Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com>

* Adapt test case

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

* Remove pytorch-cpu as it is not available on windows

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

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Hind Montassif <hind.montassif@gmail.com>
Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com>
2024-09-19 16:54:58 +02:00
Sylvain Corlay 6db44c8a64
Support CONDA_DEFAULT_ENV (#3445)
* Support CONDA_DEFAULT_ENV

* Fix test
2024-09-19 16:40:00 +02:00
Julien Jerphanion 81c099c3a1
fix: Environment removal confirmation (#3450)
* fix: Environment removal confirmation

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

* Handle empty environment deletion

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

* Handle 'n'

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

* Reoder logic

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

* Use enum class for `RemoveResult`

Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com>

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com>
2024-09-17 17:38: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-M 12fef58c37
Add fallback to root prefix (#3435)
* Add fallback to root prefix

* Fix test_not_env

* Fix tests

* Add tests with no env var
2024-09-10 15:10:21 +02:00
Silvio Traversaro 841b272cef
Fix x86_64 to use underscore instead of dash (#3433)
See https://github.com/mamba-org/mamba/issues/3222#issuecomment-2284324975 .

Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
2024-09-10 10:39:25 +02:00
Johan Mabille f8bb11c853
Fixed micromamba static build after cctools and ld64 upgrade on conda… (#3436)
Fixed micromamba static build after cctools and ld64 upgrade on conda-forge
2024-09-09 16:53:28 +02:00
Julien Jerphanion c4a6e78a78
fix: PyPI support for `env update` (#3419)
* Simple fix

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

* Factor elements in `pip_utils.{hpp,cpp}`

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

* docs: Add TODO

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

* test: Creation and update of env with pip sections

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

* Use quiet mode for pip

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

* Address review comments

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

Co-authored-by: Johan Mabille <johan.mabille@gmail.com>

* Invert headers' inclusion

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

* Address review comments

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

Co-authored-by: Hind Montassif <hind.montassif@gmail.com>

* Add more tests

* Use enum instead of bool

* Adapt tests

* Add warning

* Clean up

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
Co-authored-by: Hind Montassif <hind.montassif@gmail.com>
2024-09-05 15:41:39 +02:00
Hind-M 1bdf6f1748
Fix output (#3428)
Only print activation message when target prefix is not active
2024-09-02 14:25:20 +02:00
Sylvain Corlay d51cd0e451
Execute remove action before install actions (#3424) 2024-08-31 00:30:24 +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
Julien Jerphanion 0a01ecfc9d
fix: Reduce logging system overhead (#3416)
* test: Non-regression test

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

* fix: Use penultimate libsolv's log level

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

* Only run `test_env_spdlog_overhead_regression` on Linux

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

Co-authored-by: Johan Mabille <johan.mabille@gmail.com>

* Add time-out on test and rename conda env

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

Co-authored-by: Hind Montassif <hind.montassif@gmail.com>

* Decrease timout to 15 seconds and use dry-run

A dry run takes slightly less than 10 seconds.

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

* Use bounded value of `output_params.verbosity` as in 1.x

See: https://github.com/mamba-org/mamba/blob/1.x/libmamba/src/core/pool.cpp#L72

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

* Instead define and use and alternative `set_level`

I was hesitating between the previous solution and
this one (which is not really ideal either) but
which at least does not leak the `Context`.

Friend function could be used but we get this kind of
issue, but I am currently meeting this problem:
https://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#2174

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

* Revert "Instead define and use and alternative `set_level`"

This reverts commit f1f41b71d0.

* Simply hardcode the verbosity level to 3

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

Co-authored-by: Hind Montassif <hind.montassif@gmail.com>

* Increase timeout from 15 to 30 seconds

15 seconds is not sufficient as shown on the CI.

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

* From 30 sec to 60 sec

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

* DEBUG No timeout

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

* test: Remove edge-case for unlinks

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

* test: Adapt number of unlinks on Linux

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

* Assert success

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

Co-authored-by: Hind Montassif <hind.montassif@gmail.com>

* docs: Update comments

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

* `const`-qualify `level`

* Use 100 seconds for the timeout

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

Co-authored-by: Hind Montassif <hind.montassif@gmail.com>

* Use 200 seconds for the timeout

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

* Adapt according to `1.x`'s behavior

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

* fixup! Adapt according to `1.x`'s behavior

* Revert changes to handle CI failures

This is handled by another PR.

See: https://github.com/mamba-org/mamba/pull/3417

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

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Johan Mabille <johan.mabille@gmail.com>
Co-authored-by: Hind Montassif <hind.montassif@gmail.com>
2024-08-29 14:03:18 +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
Hind-M d17ebc52cc
[micromamba] Fix behavior of `env update` (to mimick conda) (#3396)
* Fix behavior of env update (to mimick conda)

* Code review:
Use struct and enum class for update parameters
2024-08-08 12:00:45 +02:00
Casper van Elteren c7563b8617
Reset the prompt back to default (#3392) 2024-08-06 10:54:34 +02:00
Hind-M 9663cbfdac
Add missing header (#3389) 2024-08-02 14:52:17 +02:00
Julien Jerphanion ca8cee50fe
test: Comparability and hashability of `PackageInfo` and `MatchSpec` (#3369)
test: Add test for comparability and hashability

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-07-30 17:35:50 +02:00
Julien Jerphanion d0d7eea49a
build: Support fmt 11 (follow-up) (#3371)
* build: Support fmt 11

A few other elements were required, as observed in:
https://github.com/mamba-org/mamba/pull/3352

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

* Unpin python on 3.9

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

* ci: use libcxx<18 for macOS

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

* Add TODO comment

Co-authored-by: Hind-M <Hind-M@users.noreply.github.com>

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

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-07-30 15:57:15 +02:00
Hind-M de040eb225
Restore previous behavior of `MAMBA_ROOT_PREFIX` (#3365)
Restore previous behavior
2024-07-30 10:57:23 +02:00
Julien Jerphanion 4fbd22a9c0
build: Support fmt 11 (#3368)
* build: Support fmt 11

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

* fixup! build: Support fmt 11

Required for Windows.

See: https://github.com/mamba-org/mamba/actions/runs/10144210776/job/28047211432?pr=3368#step:8:955

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-07-29 16:28:56 +02:00
Julien Jerphanion b09f1d162f
Make more classes hashable and comparable (#3363)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Klaim <Klaim@users.noreply.github.com>
2024-07-29 11:06:45 +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
Andy Kipp 4cc78c87ac
Update mamba.xsh: support xonsh >= 0.18.0 (#3355)
Update mamba.xsh
2024-07-25 10:44:52 +02:00
Hind-M ce1c4f22bd
Allow leading lowercase letter in version (#3361) 2024-07-25 09:23:39 +02:00
Hind-M a10a532fd8
Remove logs for every package (#3335) 2024-07-23 13:32:55 +02:00
Hind-M c6f2f24d5a
Allow spaces in version after operator (#3358)
Allow spaces in version after operator
2024-07-23 13:28:12 +02:00
Paul Brit 413285c7b7
fix: micromamba run when cwd does not exist (#3336)
fail micromamba run if cwd does not exist

Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com>
2024-07-15 17:30:32 +02:00
Hind-M 43da6b02a2
Fix repo usage after removal (#3340)
not use repo after removal
2024-07-15 15:20:42 +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) 855b533dd1
Fixed restoring the previous signal handler for example in python case (Windows only for now) (#3297)
* Fixed restoring the previous signal handler for example in python case

* formatting

* Fix formatting

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

Co-authored-by: Klaim <Klaim@users.noreply.github.com>

---------

Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Klaim <Klaim@users.noreply.github.com>
2024-07-01 16:54:15 +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
Julien Jerphanion 123d521521
maint: Remove declaration of `PrefixData::load` (#3325)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-06-14 15:09:22 +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
Julien Jerphanion d12f3711e6
maint: Remove some warnings (#3320)
* maint: Remove some warnings

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

* Lint

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

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-06-13 16:56:17 +02:00
Julien Jerphanion 0793fad741
maint: Remove `PrefixData::load` (#3318)
Merge its content within `PrefixData::PrefixData`.

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-06-13 16:16:52 +02:00
Hind-M 287bf22de2
OCI/Conda mapping (#3310)
* Map packages names starting with '_' to match OCI registries rules (and CEP 70)

* Use _go_select instead of _libgcc_mutex in tests
Remove dry-run and check result with umamba_list
2024-06-13 09:38:24 +02: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
Hind-M 56c0a8397c
Fix osx version test (#3308) 2024-06-07 10:27:55 +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 9300a6530c
[OCI Registry] Handle compressed repodata (#3300)
* Handle fetching zstd encoded repodata from OCI registry

* Rename AuthenticationData and corresponding func to be more relevant
2024-05-28 09:50:58 +02:00
Hind-M 36d2035764
[CEP-15] Support `base_url` with `repodata_version: 2` using `mamba` parser (#3282)
* Support repodata_version:2/cep-15 with mamba parser

* Fix behavior when base_url is missing with repodata_version 2
2024-05-28 09:48:33 +02:00
Hind-M 93d565e75f
Fix OCIMirror use (#3296)
* Modifications for a first test (forcing params/not cleaned up yet)

* Handle specs checksums

* Remove cout and unnecessary code

* Handle zst extension of repodata

* Add missing invoke_on_failure
Add back curl config

* Organize comments and remove useless leftovers

* Correctly use hide_secrets

* Handle "oci" scheme
2024-05-27 14:11:41 +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
Klaim (Joël Lamotte) 69ef891ea9
Hotfix to allow Ctrl+C in python scipts (#3285)
* Ignore _skbuild dirs

* Fixed `Context::use_default_signal_handler(bool)` not having any effect

* formatting
2024-05-03 21:33:49 +02:00
Ryan Carsten Schmidt 46036e1917
Fix typos in comments (#3272) 2024-04-17 14:17:14 +02:00
Antoine Prouvost 453c9667a5
Fix VersionSpec equal and glob (#3269) 2024-04-10 10:22:02 +02:00
Antoine Prouvost a425e4b487
Fix pin repr in solver error messages (#3268)
* Add solver pin test

* Improve pin repr in SAT error messages
2024-04-09 17:15:37 +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 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
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
Johan Mabille 3a31b8390a release libmamba 2.0.0alpha4, libmambapy 2.0.0alpha4, micromamba 2.0.0alpha4 2024-03-26 06:34:09 +01:00
Johan Mabille bf378ddfb4
Implemented OCI mirrors (#3246) 2024-03-26 06:20:49 +01:00
Johan Mabille 2925054891
Passed url_path to request_generators (#3245) 2024-03-25 10:59:02 +01:00
Antoine Prouvost 7942d3feaf
Handle regex in build string (#3239) 2024-03-20 18:52:22 +01:00
Hind-M cad6793e21
[mamba-content-trust] Add integration test (#3234)
* -Fix trusted_channels in ctx not working with more than one item
-Add test for mamba-content-trust (mamba client side) using conda-content-trust (server side)
-Add missing install with pip (to fix)

* Remove repo_signed (supposed to be generated with testserver_pkg_signing.sh)

* Add MAMBA_ROOT_PREFIX to Taskfile.dist.yml
2024-03-20 10:58:29 +01:00
Antoine Prouvost 4270dd400d
Release libsolv memory before installation (#3238) 2024-03-19 19:59:42 +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 02b36ba5a2
Mamba 2.0 name fixes (#3225)
* Change default mamba root prefix

* Name generic rc_file_content

* Refactor other rc content executable names

* Allow mamba name in sh shells

* Adapt test_activate.py to use mamba/micromamba name

* Allow mamba name in tcsh shells

* Fix micromamba names

* Rename extrac_subroc_mode::micromamba ? mamba_exe

* Rename is_micromamba > is_mamba_exe

* Change more micromamba names

* Fix test_shell.py

* Adapt mamba name in Win shell wrappers

* Adapt mamba name in Win powershell wrappers

* Remove an occurence of micromamba

* Fix wrap_call on Windows

* Deactivate failing test
2024-03-14 16:01:05 +01:00
s22chan 089095fb82
fix(micromamba): anaconda private channels not working (#3220)
Similar to https://github.com/mamba-org/boa/pull/81, the search key and db is slightly out of sync.

In this case, the key are the (weakened) urls without the scheme.

The anaconda tokens are stored with the scheme, so they are ignored.
2024-03-13 18:02:30 +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
Antoine Prouvost daccab0c0e
Add more MatchSpec tests (#3211)
* Refactor test_matchspec

* Add more MatchSpec tests
2024-03-04 16:55:41 +01:00
Antoine Prouvost 1f7b9de94f
Expected in specs parse API (#3207)
* Expected in CondaURL::parse

* Expected in Channel::resolve

* Expected in MatchSpec::parse

* Expected in MatchSpec::parse_url

* Return errors in exepcted in MatchSpec::parse

* Expected in PackageInfo::from_url
2024-03-04 14:27:04 +01:00
Antoine Prouvost 9141381ca3
Refactor MatchSpec::parse (#3205)
* Add find_not_in_parentheses with multiple parens

* Refactor MatchSpec URL with md5

* Refactor find_not_in_parentheses

* Refactor find_not_in_parentheses for genericity

* Use npos ins find_not_in_parentheses

* Add rfind_not_in_parentheses

* Use rfind_not_in_parentheses in MatchSpec

* Refactor chan ns spec split

* Allocation guard

* Refactor MatchSpec filename handling

* Remove MatchSpec::url

* Refactor MatchSpec::subdirs

* Refactor MatchSpec attribute parsing

* Flexible build and version setting

* Refactor find_matching_parenthesis

* Refactor find_matching_parenthesis

* Simplify parsers

* Add find_matching_parentheses with multiple parenthesese

* Add rfind_matching_parentheses

* Refactor MatchSpec section parsing

* Refacator MatchSpec name parsing

* Simplify version and build parsing
2024-02-29 09:42:25 +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 86b2b8c121
Refactor ObjPool to use views in callbacks (#3199)
* Refactor ObjPool to allow ObjPoolView

* Use ObjPoolView in callbacks

* Add extra solver test

* Private ObjPoolView inheritance
2024-02-23 16:38:44 +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 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 afdb5a185d
Simple logging fix (#3184) 2024-02-08 23:02:22 -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 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
Antoine Prouvost 23b90a9b73
Rewrite Query with Pool functions (wrapping libsolv) (#3168)
* Add MPool::for_each_package_matching

* Use MPool::for_each_package_matching in self-update

* Add test for pool.select_solvables

* Add MPool::for_each_package_depending_on

* Implement some queries with MPool

* Reorganize query.cpp

* Refactor Query Graph walk to not use libsolv

* Rewrite Query::whoneeds in PkgInfo space

* Remove unused functions

* Improve string param
2024-02-05 11:45:48 -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
Bela Stoyan 4075f0b58d
add manually given .tar.bz2 / .conda packages to solver pool (#3164)
* add packages to solver pool

* lint
2024-02-01 13:51:06 -05: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 d4c9f96dea
Proper sorting of display actions (#3165)
* Add variant compare

* Sort actions not strings
2024-01-31 14:27:22 -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 f7c763082d
Implemented support for mirrors (#3157)
* Implemented support for mirrors

* Changes according to reviews
2024-01-30 18:31:07 +01:00
Julien Jerphanion b8ceffeab0
Remove outdated commented code snippet (#3160)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-01-30 13:23:54 +01:00
Johan Mabille a63587da2e
Moved download related files to dedicated folder (#3155) 2024-01-25 20:45:54 +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 a310d31da9
Improve Solution usage (#3148)
* Rename Solution > solver::Solution

* Try noarch relink in solution space

* Remove dead code

* Move relink computation to helpers

* Refactor find_installed_python

* Add Loop control break to Solution

* Refactor find_new_python_in_solution

* Add  solution_needs_python_relink

* Change Py relink decision

* Remove dead relink_noarch

* Delete TransationContext copy ctor in favor of default move ctor.

* Refactor transaction_to_solution

* Refactor MSolver::add_request

* Free MSolver::add_reinstall_job

* Refactor Solution filter

* Refactor is_any_of

* Add solver Request for_each_of

* Remove MSolcer remove/installed_specs

* Refactor add_job_impl

* Use expected_t in add_job_impl

* Remove MSolver::m_jobs

* Refactor request_to_decision_queue
2024-01-25 15:23:15 +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 75b0dc48c0
Sort transaction table entries (#3146) 2024-01-23 09:29:39 +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 81504b5614
Explcit transaction duplicate code (#3138)
* Add channel and subdir to PackageInfo::from_url

* Remove duplicate code
2024-01-18 11:03:38 +01:00
Antoine Prouvost 0324bd74b0
No M (#3137) 2024-01-18 08:44:23 +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
Josh Chorlton 7c70ca7fed
handle other deps in multiple env files (#3096) 2024-01-17 15:28:48 +01:00
pwnfan 43567a768c
Fix verbose and strange prefix in Powershell (#3116) 2024-01-17 13:52:48 +01:00
Antoine Prouvost a534d49fea
Revert "Fix info and debug logging" (#3133) 2024-01-16 15:52:14 +01:00
Ben Moss 1e7c369128
Fix info and debug logging (#3127)
* Fix info and debug logging in libmamba

Fixes #3112

* Don't use compile-time loggers

---------

Co-authored-by: Ben Moss <bmoss40@bloomberg.com>
2024-01-16 15:38:44 +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
Johan Mabille 67f36d4a48
Added mirrored channels (#3125) 2024-01-15 14:57:43 +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 f99c4288c6
Remove micromamba shell init -p (#3092)
* Remove micromamba shell init -p

* Fix rc content
2024-01-05 14:07:11 +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 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 108bc9f5a4
Bump MAMBA libsolv file ABI (#3093) 2024-01-02 12:53:14 +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 3f6484c23c
Fix VersionSpec free ranges (#3088) 2023-12-28 13:33:48 +01:00
Antoine Prouvost 4ee7531fd6
Clean up url_manip (#3086) 2023-12-27 14:15:31 +01:00
Josh Chorlton bcf8141e9e
gracefully handle conflicting names in yaml specs (#3083)
* Revert "Remove hard coded mamba (#3069)"

This reverts commit 212d1e9ad2.

* gracefully handle conflicting names in yaml specs

* Revert "Revert "Remove hard coded mamba (#3069)""

This reverts commit b5717e6871.
2023-12-27 10:08:43 +01:00
Antoine Prouvost 773e6a5cf2
Reformat string (#3085) 2023-12-26 21:32:07 +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
Antoine Prouvost 77484f5a63
Fix URL enconding in repodata.json (#3076)
* Fix filename URL encoding

* Remove dead code

* Fix Channel URL encoding

* Improve test_create caching
2023-12-21 13:54:34 +01:00
Jonas Haag 443c3e35d5
Update shell hook comments (#3051) 2023-12-19 15:08:00 +01:00
Josh Chorlton 57a6a691be
Support multiple env yaml specs (#2993)
* tested and working

* docs update

* disallow multiple spec types

* add test for only one yaml specifies channel

* fix install yaml test

* Update micromamba/tests/test_create.py

Co-authored-by: Jonas Haag <jonas@lophus.org>

* Update micromamba/tests/test_create.py

Co-authored-by: Jonas Haag <jonas@lophus.org>

* suggestions

* separate loop

* appease the linter

* another test

---------

Co-authored-by: Jonas Haag <jonas@lophus.org>
2023-12-19 08:56:59 +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
Johan Mabille c54c4b530e release libmamba 2.0.0alpha0, libmambapy 2.0.0alpha0, micromamba 2.0.0alpha0 2023-12-14 16:42:44 +01:00
Johan Mabille 4f2d1ebd43
Added mamba as dynamic build of micromamba (#3060) 2023-12-14 14:22:31 +01:00
Orion Poplawski 72d5eb1895
Fix libmamba cmake version file (#3013) 2023-12-07 23:33:39 +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
Orion Poplawski 96e9be052b
Drop unneeded dependencies (#3016) 2023-12-07 16:02:01 +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 df4aeaca4c
Remove duplicate function (#3042) 2023-12-06 21:27:10 +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 edb7565462
Default to conda-forge channel (#3035)
* Default to conda-forge channel

* Fix test

* Refactor umamba repoquery to drop --use-local=int

* Fix tests
2023-12-06 09:32:20 +01:00
Antoine Prouvost 4d709016fb
Use std::array<std::byte, ...> (#3037)
* Use std::byte

* Use std::array
2023-12-05 16:58:10 +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 32ffc54249
Default to hide credentials (#3017)
* Default to hide credentials in util::URL

* Default to hide credentials in CondaURL::pretty_str

* Default to hide credentials in CondaURL::str
2023-11-29 12:47:30 +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
Bela Stoyan 7f325df6ad
fix config precedence for base env (#3009)
Co-authored-by: Daniel Elsner <daniel.elsner@quantco.com>
2023-11-27 14:40:47 +02:00
Antoine Prouvost 1340d712eb
Improve ChannelContext and Channel (#3003) 2023-11-23 19:14:35 +01:00
Antoine Prouvost acd357df95
Remove ChannelContext ctor (#3002) 2023-11-22 18:45:43 +01:00