Skip to content

fix: Adaptive level for compatible Version formatting #3818

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

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

jjerphan
Copy link
Member

Fix #3647.
Fix #3472 properly, reverting parts of #3483.

out = fmt::format_to(
out,
"{}{}",
VersionSpec::compatible_str,
pred.m_version.str(op.level)
Copy link
Member Author

@jjerphan jjerphan Feb 12, 2025

Choose a reason for hiding this comment

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

Note to reviewers: this line caused the bug as the solver relies on the valid assumption that:

std::string match_spec_as_str = "numpy~=1.26"; // for instance.
match_spec_as_str == MatchSpec::parse(match_spec_as_str).value().str()

here:

const auto [first, second] = make_abused_namespace_dep_args(pool, ms.str());

which was not verified for compatible versions.

I think we need to add tests cases (in another PR) to test that this is valid for many MatchSpec.

Comment on lines +140 to +142
// TODO: test this assumption for many more cases
auto ms2 = MatchSpec::parse(ms.str()).value();
REQUIRE(ms2 == ms);
Copy link
Member Author

Choose a reason for hiding this comment

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

Note to reviewers: this can be implemented in another PR.

@jjerphan jjerphan marked this pull request as ready for review February 12, 2025 14:41
@JohanMabille JohanMabille merged commit 402b2d4 into mamba-org:main Feb 13, 2025
35 checks passed
@jjerphan jjerphan deleted the fix/adaptive-level-compatible branch February 13, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release::bug_fixes For PRs fixing bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MatchSpec parsing error with ~= version operator Micromamba v2.0 unable to parse environment.yml
2 participants