Skip to content

Commit

Permalink
Remove hard-coded micromamba
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Dec 18, 2023
1 parent 8f8023b commit a646382
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion micromamba/tests/env-create-export.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
channels:
- https://conda.anaconda.org/conda-forge
dependencies:
- micromamba=0.24.0
- xtl=0.7.5
2 changes: 1 addition & 1 deletion micromamba/tests/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def get_umamba(cwd=os.getcwd()):
umamba_bin = "micromamba"
umamba = os.path.join(cwd, "build", "micromamba", umamba_bin)
if not Path(umamba).exists():
print("MICROMAMBA NOT FOUND!")
raise RuntimeError("Micromamba not found! Set TEST_MAMBA_EXE env variable")
return umamba


Expand Down
10 changes: 4 additions & 6 deletions micromamba/tests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,18 @@ def test_env_export(export_env, explicit_flag, md5_flag, channel_subdir_flag):
flags = filter(None, [explicit_flag, md5_flag, channel_subdir_flag])
output = helpers.run_env("export", "-n", export_env, *flags)
if explicit_flag:
assert "/micromamba-0.24.0-0." in output
assert "/xtl-0.7.5-0." in output
if md5_flag != "--no-md5":
assert re.search("#[a-f0-9]{32}$", output.replace("\r", ""))
else:
ret = yaml.safe_load(output)
assert ret["name"] == export_env
assert set(ret["channels"]) == {"conda-forge"}
assert "micromamba=0.24.0=0" in str(ret["dependencies"])
assert "xtl=0.7.5=0" in str(ret["dependencies"])
if md5_flag == "--md5":
assert re.search(r"micromamba=0.24.0=0\[md5=[a-f0-9]{32}\]", str(ret["dependencies"]))
assert re.search(r"xtl=0.7.5=0\[md5=[a-f0-9]{32}\]", str(ret["dependencies"]))
if channel_subdir_flag:
assert re.search(
r"conda-forge/[a-z0-9-]+::micromamba=0.24.0=0", str(ret["dependencies"])
)
assert re.search(r"conda-forge/[a-z0-9-]+::xtl=0.7.5=0", str(ret["dependencies"]))


def test_create():
Expand Down
5 changes: 3 additions & 2 deletions micromamba/tests/test_shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ def test_init(tmp_home, tmp_root_prefix, shell_type, prefix_selector, multiple_t

def test_dash(tmp_home, tmp_root_prefix):
skip_if_shell_incompat("dash")
subprocess.check_call(["dash", "-c", "eval $(micromamba shell hook -s dash)"])
subprocess.check_call(["dash", "-c", "eval $(micromamba shell hook -s posix)"])
umamba = helpers.get_umamba()
subprocess.check_call(["dash", "-c", f"eval $({umamba} shell hook -s dash)"])
subprocess.check_call(["dash", "-c", f"eval $({umamba} shell hook -s posix)"])


def test_implicitly_created_environment(tmp_home, tmp_root_prefix):
Expand Down

0 comments on commit a646382

Please sign in to comment.