Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix micromamba env export to get channel name instead of full url #2260

Merged
merged 2 commits into from
Feb 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion micromamba/src/env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ set_env_command(CLI::App* com)
dependencies << "\n";
}

channels.insert(make_channel(v.url).base_url());
channels.insert(make_channel(v.url).name());
}

for (const auto& c : channels)
Expand Down
2 changes: 1 addition & 1 deletion micromamba/tests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def test_env_export(self):
create("", "-n", env_name, "-f", spec_file)
ret = yaml.safe_load(run_env("export", "-n", env_name))
assert ret["name"] == env_name
assert set(ret["channels"]) == {"https://conda.anaconda.org/conda-forge"}
assert set(ret["channels"]) == {"conda-forge"}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do add that the defaults naming, we should also add a test for it, so that we do not loose it through a refactoring.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed.

assert "micromamba=0.24.0=0" in ret["dependencies"]

def test_create(self):
Expand Down