Skip to content

Commit

Permalink
Consider spec with version as arg
Browse files Browse the repository at this point in the history
  • Loading branch information
Hind-M committed Jan 20, 2025
1 parent 04e78bd commit 05b65a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 5 additions & 1 deletion libmamba/src/core/query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,7 +670,11 @@ namespace mamba
std::string depends_qualifier;
for (const auto& dep : pkg.dependencies)
{
if (util::starts_with(dep, args[i]))
// `args[i]` can be just `spec`, `spec=version`,
// or `spec` with some other constraints.
// Note: The condition below may be subject to modification if
// other use cases come up in the future
if (util::starts_with(dep, args[i]) || util::starts_with(args[i], dep))
{
depends_qualifier = dep;
break;
Expand Down
5 changes: 1 addition & 4 deletions micromamba/tests/test_repoquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ def test_whoneeds_not_installed_with_channel_no_json(yaml_env: Path, spec):
res = helpers.umamba_repoquery("whoneeds", "-c", "conda-forge", spec, "--platform", "osx-64")
res = helpers.remove_whitespaces(res)
assert "Name Version Build Depends Channel Subdir" in res
if spec == "xtensor=0.24.5": # `Depends` column is empty here (bug?)
assert "cascade 0.1.1 py38h5ce3968_0 conda-forge osx-64" in res
else:
assert "cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64" in res
assert "cascade 0.1.1 py38h5ce3968_0 xtensor conda-forge osx-64" in res


@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True)
Expand Down

0 comments on commit 05b65a4

Please sign in to comment.