Commit Graph

56 Commits

Author SHA1 Message Date
Hind-M 3dcbf76a04
Fix display of env activation message and co (#3715) 2025-01-06 09:56:21 +01:00
Julien Jerphanion 178593351b
fix: Skip empty lines in environment spec files (#3662)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Klaim <Klaim@users.noreply.github.com>
2024-12-09 08:55:39 +01:00
Hind-M 6141540b94
Handle `.tar.gz` in pkg url (#3640) 2024-12-06 08:55:03 +01:00
Julien Jerphanion e67178ce8a
fix: Handle environment with empty or absent `dependencies` (#3657)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-12-05 15:00:15 +01:00
Hind-M 3f49aa5f6e
Uncomment test (#3641) 2024-12-02 11:56:42 +01:00
Julien Jerphanion b163ce9027
fix: Return JSON on environment creation dry run (#3627)
Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
2024-11-22 15:23:27 +01: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
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
Sylvain Corlay 6db44c8a64
Support CONDA_DEFAULT_ENV (#3445)
* Support CONDA_DEFAULT_ENV

* Fix test
2024-09-19 16:40:00 +02:00
Hind-M b08d40d4d7
Fix test in osx (#3448)
Use PRE_COMMIT_USE_MAMBA instead of PRE_COMMIT_USE_MICROMAMBA
2024-09-17 13:40:38 +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
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-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
Johan Mabille dcd777fbd1
Test with xtensor-python instead of unmaintained xframe (#3286)
Upgraded tests to use packages available on osx-arm64
2024-05-03 18:02:33 +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 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
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 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
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 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
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
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 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 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
Johan Mabille 21c6d73680
removed dependency on conda-index (#2964) 2023-11-08 22:15:05 +01:00
Antoine Prouvost 8683078464
Refactor CI and libamambapy tests (on Win) (#2955)
* TMP disable Unix tests

* Try refactor win CI

* Add libmambapy tests

* Run Windows libamamba tests via CMake

* Add Windows menuinst dependency

* Fix typo

* Debug libmambapy tests Win

* Add micromamba tests windows

* Call test_libmamba from different paths

* Merge workflow launchers

* Fix libmamba tests win

* Fxi

* Fix workspace key

* DEbug win

* Implement local channel tests as part of the intergration tests

* Try Win libmamba tests bash

* Cleanup

* Restore Unix tests

* Make test local channel noarch

* Fix workspace action number

* No error on test cleanup in CI

* Reduce number of threads to conda-index

* Disable local channel tests on Windows
2023-11-03 14:07:54 +01:00
Isuru Fernando f23e078f2c
Fix channels with slashes regression (#2926)
* Fix channels with slashes regression

* fix formatting

* make the test isolated

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>

* Add more tests

* Use pytest utilities for negative testing

* Add extra test doc

---------

Co-authored-by: Antoine Prouvost <AntoinePrv@users.noreply.github.com>
2023-10-24 18:35:31 +02:00
Isuru Fernando 24f26a0175
Allow defaults::* spec (#2927) 2023-10-23 20:03:58 +03:00
Antoine Prouvost a8464367c4
Make some fixture local (#2919)
* Make xdg fixtures local

* Make create fixtures local
2023-10-17 16:27:47 +02:00
Antoine Prouvost 7c02338cb5
Fix Ci (#2889)
* Pin pre-commit Python version

* update pre-commit config

* Try fix Mamba tests Windows

* use boltons

* Fix channel in tests
2023-10-03 22:20:29 +02:00
Hind-M b1c4950261
[Micromamba] Add mamba tests (#2877)
* Add mamba `test_api` tests to umamba

* Add more tests
2023-10-03 10:51:16 +02:00
rmittal87 a5c51980ba
Adding locks for cache directories in case multiple processes are try…. (#2811)
Adding locks for cache directories in case multiple processes are trying to create an environment at the same time
2023-09-13 15:04:29 +02:00
Antoine Prouvost 41bc4ee5f3
Speed up tests (a bit) (#2776)
Make independent long path test
2023-08-24 14:47:50 +02:00
ThomasBlauthQC a7cd3b6292
Respect subdir in match spec (#2300) 2023-07-26 10:33:55 +02:00
Antoine Prouvost 17232ca90e
Honor envs_dirs (#2538)
* Improve `is_writable` on non-existing sub-folders

Co-authored-by: Katrin Muck <katrin.muck@tuwien.ac.at>

* Add contains test case

* Include envs_dirs in target_prefix computation

* Use target_prefix and root_prefix in micromamba shell cmds

* Add umamba envs_dirs activation test

* Add envs_dirs create test

* Mantain umamba shell cmds backward compat

* Improve activate error message

* Fix activation on windows

---------

Co-authored-by: Katrin Muck <katrin.muck@tuwien.ac.at>
2023-05-25 10:16:56 +02:00
Antoine Prouvost d12ea01795
Fix segfault in add_pin/all_problems_structured (#2428)
Fix segfault in add_pin/all_problems_structured
2023-04-04 11:31:04 +02:00
Antoine Prouvost 05f1b9b6b3
Refactor test_create, test_proxy, and test_env for test isolation (#2416)
* Deactivate PyCQA line-length warnings

* Proper os.environ restore in pytest

* Add --mamba-pkgs-dir for cache reuse in Pytest

* Set pytest tmp retention policy

* Allow Path in test helpers

* Refactor test_create for isolation

* Improve pytest fixtures

* Refactor test_env.py for test isolation

* Refactor test_proxy for isolating tests
2023-03-29 19:30:38 +02:00
Thorsten Beier b7a60591cd
add option to relocate prefix. (#2385)
add option to relocate prefix
2023-03-27 10:26:19 +02:00
Wolf Vollprecht 87343ca7d6
fix up single download target perform finalization (#2274) 2023-02-09 09:17:07 +01:00
Wolf Vollprecht 1de3df2fc3
use new shebang style (#2211) 2023-01-11 13:39:58 +01:00
Jonas Haag 3f716332f9
Fix #1783: Add `micromamba env create` (#1790)
Fixes https://github.com/mamba-org/mamba/issues/1783
2023-01-10 17:40:25 +01:00
Joël Lamotte (Klaim) d04ab8641f Added test creating with env file using pip without specifying the parent directory 2022-10-03 12:55:22 +02:00
Joël Lamotte (Klaim) 29a2c5a9a2 Added micromamba test to reveal env-lock install-after-create crash 2022-09-02 16:34:47 +02:00
Klaim (Joël Lamotte) 0b8b9a7aab
Fixed create/install requiring pip install failing when the prefix have whitespaces on Windows (#1838)
* micromamba: add tests creating/installing with pip in prefix with whitespaces
* Fixed installing with pip when prefix have whitespaces on Windows

Co-authored-by: Jonas Haag <jonas@lophus.org>
2022-08-08 19:36:46 +02:00
Adrian Freund 126f9f5436
Add test to micromamba 2022-07-12 16:28:27 +02:00
Joël Lamotte (Klaim) 22d91d3f60 micromamba tests: added lockfile test 2022-04-07 12:13:27 +02:00
Klaim (Joël Lamotte) 048cb67f62
Fix JSON output issues (#1600)
* Fixed: `--json` throwing exceptions in some situations (lockfiles)
* Refactored Console pimpl handling
* Automatic json printing instead of explicit.
* added a way to cancel the print of json log from libmamba, used in mamba which already output the right json;
From now on the json output will be automatically printed at the end of the program
(after `main()` call) instead of explicitly invoked.
2022-04-07 11:17:22 +02:00
Chris Burr 43b3d21e34 Python 2.7 on Windows requires -c default 2022-02-02 12:41:09 +01:00