Skip to content

Commit 4d681c5

Browse files
authored
Merge branch 'main' into fix-etc/profile.d
2 parents 73881ac + 5916001 commit 4d681c5

File tree

3 files changed

+40
-19
lines changed

3 files changed

+40
-19
lines changed

libmamba/data/mamba.fish

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ if not set -q MAMBA_NO_PROMPT
5454
end
5555

5656

57-
function micromamba --inherit-variable MAMBA_EXE
57+
function __fish_mamba_wrapper --inherit-variable MAMBA_EXE
5858
if test (count $argv) -lt 1 || contains -- --help $argv
5959
$MAMBA_EXE $argv
6060
else
@@ -72,7 +72,13 @@ function micromamba --inherit-variable MAMBA_EXE
7272
end
7373
end
7474

75+
function mamba --inherit-variable MAMBA_EXE
76+
__fish_mamba_wrapper
77+
end
7578

79+
function micromamba --inherit-variable MAMBA_EXE
80+
__fish_mamba_wrapper
81+
end
7682

7783
# Autocompletions below
7884

micromamba/tests/test_create.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2096,7 +2096,7 @@ def test_repodata_record_patch(tmp_home, tmp_clean_env, tmp_path):
20962096
out = helpers.update("--json", "-p", env_prefix, "--all")
20972097
assert out["success"]
20982098

2099-
assert len(out["actions"]["UNLINK"]) == 1
2099+
assert len(out["actions"]["UNLINK"]) >= 1
21002100
unlink_libarchive = next(pkg for pkg in out["actions"]["UNLINK"] if pkg["name"] == "libarchive")
21012101

21022102
# TODO: understand why the original linked libarchive has a full URL for the channel
@@ -2105,7 +2105,7 @@ def test_repodata_record_patch(tmp_home, tmp_clean_env, tmp_path):
21052105
unlink_libarchive["channel"] = originally_linked_libarchive["channel"]
21062106
assert unlink_libarchive == originally_linked_libarchive
21072107

2108-
assert len(out["actions"]["LINK"]) == 1
2108+
assert len(out["actions"]["LINK"]) >= 1
21092109
linked_libarchive = next(pkg for pkg in out["actions"]["LINK"] if pkg["name"] == "libarchive")
21102110

21112111
linked_libarchive_version = Version(linked_libarchive["version"])

micromamba/tests/test_pkg_cache.py

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,14 @@
1111
from . import helpers
1212

1313
package_to_check = "xtensor"
14+
package_version_to_check = "0.27.0"
1415
file_to_find_in_package = "xtensor.hpp"
1516

1617

18+
def package_to_check_requirements():
19+
return f"{package_to_check}={package_version_to_check}"
20+
21+
1722
def find_cache_archive(cache: Path, pkg_name: str) -> Optional[Path]:
1823
"""Find the archive used in cache from the complete build name."""
1924
tar_bz2 = cache / f"{pkg_name}.tar.bz2"
@@ -46,7 +51,7 @@ def tmp_shared_cache_test_pkg(tmp_path_factory: pytest.TempPathFactory):
4651
"-c",
4752
"conda-forge",
4853
"--no-deps",
49-
package_to_check,
54+
package_to_check_requirements(),
5055
no_dry_run=True,
5156
)
5257
return root / "pkgs"
@@ -99,7 +104,7 @@ def test_extracted_file_deleted(
99104
os.remove(tmp_cache_file_in_test_package)
100105

101106
env_name = "some_env"
102-
helpers.create(package_to_check, "-n", env_name, no_dry_run=True)
107+
helpers.create(package_to_check_requirements(), "-n", env_name, no_dry_run=True)
103108

104109
env_dir = tmp_root_prefix / "envs" / env_name
105110
pkg_checker = helpers.PackageChecker(package_to_check, env_dir)
@@ -122,7 +127,7 @@ def test_extracted_file_corrupted(
122127

123128
env_name = "x1"
124129
helpers.create(
125-
package_to_check,
130+
package_to_check_requirements(),
126131
"-n",
127132
env_name,
128133
"--json",
@@ -157,7 +162,7 @@ def test_tarball_deleted(
157162
os.remove(tmp_cache_test_pkg)
158163

159164
env_name = "x1"
160-
helpers.create(package_to_check, "-n", env_name, "--json", no_dry_run=True)
165+
helpers.create(package_to_check_requirements(), "-n", env_name, "--json", no_dry_run=True)
161166

162167
env_dir = tmp_root_prefix / "envs" / env_name
163168
pkg_checker = helpers.PackageChecker(package_to_check, env_dir)
@@ -178,7 +183,7 @@ def test_tarball_and_extracted_file_deleted(
178183
os.remove(tmp_cache_test_pkg)
179184

180185
env_name = "x1"
181-
helpers.create(package_to_check, "-n", env_name, "--json", no_dry_run=True)
186+
helpers.create(package_to_check_requirements(), "-n", env_name, "--json", no_dry_run=True)
182187

183188
env_dir = tmp_root_prefix / "envs" / env_name
184189
pkg_checker = helpers.PackageChecker(package_to_check, env_dir)
@@ -203,7 +208,7 @@ def test_tarball_corrupted_and_extracted_file_deleted(
203208
f.write("")
204209

205210
env_name = "x1"
206-
helpers.create(package_to_check, "-n", env_name, "--json", no_dry_run=True)
211+
helpers.create(package_to_check_requirements(), "-n", env_name, "--json", no_dry_run=True)
207212

208213
env_dir = tmp_root_prefix / "envs" / env_name
209214
pkg_checker = helpers.PackageChecker(package_to_check, env_dir)
@@ -233,7 +238,7 @@ def test_extracted_file_corrupted_no_perm(
233238

234239
env = "x1"
235240
cmd_args = (
236-
package_to_check,
241+
package_to_check_requirements(),
237242
"-n",
238243
"--safety-checks",
239244
safety_checks,
@@ -276,7 +281,9 @@ def test_different_caches(
276281

277282
os.environ["CONDA_PKGS_DIRS"] = f"{cache}"
278283
env_name = "some_env"
279-
res = helpers.create("-n", env_name, package_to_check, "-v", "--json", no_dry_run=True)
284+
res = helpers.create(
285+
"-n", env_name, package_to_check_requirements(), "-v", "--json", no_dry_run=True
286+
)
280287

281288
env_dir = tmp_root_prefix / "envs" / env_name
282289
pkg_checker = helpers.PackageChecker(package_to_check, env_dir)
@@ -304,7 +311,9 @@ def test_first_writable(
304311
os.environ["CONDA_PKGS_DIRS"] = f"{tmp_cache},{tmp_cache_alt}"
305312

306313
env_name = "some_env"
307-
res = helpers.create("-n", env_name, package_to_check, "--json", no_dry_run=True)
314+
res = helpers.create(
315+
"-n", env_name, package_to_check_requirements(), "--json", no_dry_run=True
316+
)
308317

309318
env_dir = tmp_root_prefix / "envs" / env_name
310319
pkg_checker = helpers.PackageChecker(package_to_check, env_dir)
@@ -330,7 +339,7 @@ def test_no_writable(self, tmp_home, tmp_root_prefix, tmp_cache, tmp_cache_alt):
330339

331340
os.environ["CONDA_PKGS_DIRS"] = f"{tmp_cache},{tmp_cache_alt}"
332341

333-
helpers.create("-n", "myenv", package_to_check, "--json", no_dry_run=True)
342+
helpers.create("-n", "myenv", package_to_check_requirements(), "--json", no_dry_run=True)
334343

335344
def test_no_writable_extracted_dir_corrupted(self, tmp_home, tmp_root_prefix, tmp_cache):
336345
old_cache_dir = tmp_cache / find_pkg_build(tmp_cache, package_to_check)
@@ -345,7 +354,9 @@ def test_no_writable_extracted_dir_corrupted(self, tmp_home, tmp_root_prefix, tm
345354
os.environ["CONDA_PKGS_DIRS"] = f"{tmp_cache}"
346355

347356
with pytest.raises(subprocess.CalledProcessError):
348-
helpers.create("-n", "myenv", package_to_check, "-vv", "--json", no_dry_run=True)
357+
helpers.create(
358+
"-n", "myenv", package_to_check_requirements(), "-vv", "--json", no_dry_run=True
359+
)
349360

350361
def test_first_writable_extracted_dir_corrupted(
351362
self, tmp_home, tmp_root_prefix, tmp_cache, tmp_cache_alt
@@ -365,7 +376,9 @@ def test_first_writable_extracted_dir_corrupted(
365376
os.environ["CONDA_PKGS_DIRS"] = f"{tmp_cache},{tmp_cache_alt}"
366377
env_name = "myenv"
367378

368-
helpers.create("-n", env_name, package_to_check, "-vv", "--json", no_dry_run=True)
379+
helpers.create(
380+
"-n", env_name, package_to_check_requirements(), "-vv", "--json", no_dry_run=True
381+
)
369382

370383
install_env_dir = helpers.get_env(env_name)
371384
pkg_checker = helpers.PackageChecker(package_to_check, install_env_dir)
@@ -410,7 +423,7 @@ def test_extracted_tarball_only_in_non_writable_cache(
410423
os.environ["CONDA_PKGS_DIRS"] = f"{tmp_cache},{tmp_cache_alt}"
411424
env_name = "myenv"
412425

413-
helpers.create("-n", env_name, package_to_check, "--json", no_dry_run=True)
426+
helpers.create("-n", env_name, package_to_check_requirements(), "--json", no_dry_run=True)
414427

415428
install_env_dir = helpers.get_env(env_name)
416429
pkg_checker = helpers.PackageChecker(package_to_check, install_env_dir)
@@ -450,7 +463,7 @@ def test_missing_extracted_dir_in_non_writable_cache(
450463
os.environ["CONDA_PKGS_DIRS"] = f"{tmp_cache},{tmp_cache_alt}"
451464
env_name = "myenv"
452465

453-
helpers.create("-n", env_name, package_to_check, "--json", no_dry_run=True)
466+
helpers.create("-n", env_name, package_to_check_requirements(), "--json", no_dry_run=True)
454467

455468
install_env_dir = helpers.get_env(env_name)
456469
pkg_checker = helpers.PackageChecker(package_to_check, install_env_dir)
@@ -496,7 +509,9 @@ def test_corrupted_extracted_dir_in_non_writable_cache(
496509
os.environ["CONDA_PKGS_DIRS"] = f"{tmp_cache},{tmp_cache_alt}"
497510
env_name = "myenv"
498511

499-
helpers.create("-n", env_name, "-vv", package_to_check, "--json", no_dry_run=True)
512+
helpers.create(
513+
"-n", env_name, "-vv", package_to_check_requirements(), "--json", no_dry_run=True
514+
)
500515

501516
install_env_dir = helpers.get_env(env_name)
502517
pkg_checker = helpers.PackageChecker(package_to_check, install_env_dir)
@@ -542,7 +557,7 @@ def test_expired_but_valid_repodata_in_non_writable_cache(
542557
helpers.create(
543558
"-n",
544559
env_name,
545-
package_to_check,
560+
package_to_check_requirements(),
546561
"-vv",
547562
"--json",
548563
"--repodata-ttl=0",

0 commit comments

Comments
 (0)