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

Discrepancy creating a MatchSpec from package strings (sometimes "==" gets stripped) #13932

Open
2 tasks done
bsyouness opened this issue May 21, 2024 · 3 comments
Open
2 tasks done
Labels
severity::3 major; broken functionality with a workaround source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type

Comments

@bsyouness
Copy link

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

In the source code here, the behavior of generating a MatchSpec object from a string dictates that if the string passed in doesn't have a build and the first two characters are "==", then the version should be stripped of "==". I read the comments above that snippet of code and I don't understand why that would be the case. This leads to this very confusing behavior:

In [23]: MatchSpec("awscli==2.15.37").get("version")
Out[23]: '2.15.37'

In [24]: MatchSpec("awscli==2.15.37=wghq").get("version")
Out[24]: '==2.15.37'

I would expect the two to be consistent. We have hardcoded behavior to make the two consistent for now but were hoping for an explanation or a code change.

Conda Info

No response

Conda Config

No response

Conda list

No response

Additional Context

No response

@bsyouness bsyouness added the type::bug describes erroneous operation, use severity::* to classify the type label May 21, 2024
@travishathaway travishathaway added source::community catch-all for issues filed by community members severity::3 major; broken functionality with a workaround labels May 22, 2024
@travishathaway
Copy link
Contributor

travishathaway commented May 22, 2024

Hi @bsyouness,

Thanks for reporting this. I think this may be related to this previously opened pull request:

This is another issue that also might be experiencing the same issue:

I unfortunately cannot offer an explanation about the exact behavior of MatchSpec in this case. My gut tells me you may be on to something though and have identified a bug. I will bring this up with more maintainers to see if this is something we want to address.

I have labeled this with severity::3 major; broken functionality with a workaround which indicates that you currently have a workaround for the issue.

@jaimergp
Copy link
Contributor

jaimergp commented Jun 7, 2024

We are currently analyzing this behaviour in this CEP too, feedback welcome.

@jaimergp
Copy link
Contributor

jaimergp commented Jun 7, 2024

I would expect the two to be consistent. We have hardcoded behavior to make the two consistent for now but were hoping for an explanation or a code change.

The key there is the presence of the build string, which must be using a different parsing logic because this syntax is an old one conda used to use, but still relevant in conda-build. I agree the discrepancy is odd and should be rectified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity::3 major; broken functionality with a workaround source::community catch-all for issues filed by community members type::bug describes erroneous operation, use severity::* to classify the type
Projects
Status: 🆕 New
Development

No branches or pull requests

3 participants