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 MatchSpec roundtrip parsing #9980

Closed
wants to merge 1 commit into from

Conversation

wolfv
Copy link
Contributor

@wolfv wolfv commented Jun 5, 2020

We have an issue in mamba where the MatchSpec looses some information through the representation.

If you parse libblas=*=*mkl, the repr of that is libblas=[build=*mkl]
When parsing libblas=[build=*mkl] one hits a assert because the version is empty.

I believe it would be better to have libblas=*[build=*mkl] and I attached a fix for this.

@wolfv wolfv requested a review from a team as a code owner June 5, 2020 07:46
@cla-bot
Copy link

cla-bot bot commented Jun 5, 2020

We require contributors to sign our Contributor License Agreement, and we don't have one on file for @wolfv. In order for us to review and merge your code, please e-sign the PDF at https://conda.io/en/latest/contributing.html#conda-contributor-license-agreement. We then need to manually verify your signature. We will ping the bot to refresh the PR status when we have confirmed your signature.

@jjhelmus
Copy link
Contributor

jjhelmus commented Jun 5, 2020

@cla-bot check

@cla-bot cla-bot bot added the cla-signed [bot] added once the contributor has signed the CLA label Jun 5, 2020
@cla-bot
Copy link

cla-bot bot commented Jun 5, 2020

The cla-bot has been summoned, and re-checked this pull request!

mcg1969
mcg1969 previously approved these changes Jul 15, 2020
Copy link
Contributor

@mcg1969 mcg1969 left a comment

Choose a reason for hiding this comment

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

Thanks!

def test_roundtrip(self):
a = MatchSpec("numpy=*=*bla")
b = MatchSpec(a.__repr__())
assert (a == b)
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like it is failing here

@@ -534,6 +537,8 @@ def _parse_version_plus_build(v_plus_b):
('*', '*')
"""
parts = re.search(r'((?:.+?)[^><!,|]?)(?:(?<![=!|,<>~])(?:[ =])([^-=,|<>~]+?))?$', v_plus_b)

Copy link
Contributor

Choose a reason for hiding this comment

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

flake is complaining about the extra blank here :-(

@jezdez
Copy link
Member

jezdez commented Jun 1, 2021

@wolfv Hey Wolf, I'm not sure if this is current or not, could you let me know if this is still an issue?

@wolfv
Copy link
Contributor Author

wolfv commented Jun 22, 2021

@jezdez yes, this is still an issue, I just checked.

Also, there is another issue I've been hitting before in micromamba. When requesting a spec from the command line like so numpy=1.23 it means "loose 1.23" requirement, and is equal to numpy 1.23.*.
However, when requesting numpy=1.23=*123, the first single-equals is translated into a double equals, e.g. numpy==1.23=*123. However, the double-equals signifies a strong pin so that numpy==1.23.0 which is a lot less flexible.

>>> a = MatchSpec("numpy=1.23=*123")
>>> a.__str__()
'numpy==1.23=*123'
>>> a.conda_build_form()
'numpy 1.23 123'

@github-actions
Copy link

github-actions bot commented Aug 9, 2023

Hi there, thank you for your contribution!

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this pull request to remain open please:

  1. Rebase and verify the changes still work
  2. Leave a comment with the current status

NOTE: If this pull request was closed prematurely, please leave a comment.

Thanks!

@github-actions github-actions bot added the stale [bot] marked as stale due to inactivity label Aug 9, 2023
@github-actions
Copy link

github-actions bot commented Aug 9, 2023

Hi there, thank you for your contribution!

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed automatically if no further activity occurs.

If you would like this pull request to remain open please:

  1. Rebase and verify the changes still work
  2. Leave a comment with the current status

NOTE: If this pull request was closed prematurely, please leave a comment.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed [bot] added once the contributor has signed the CLA plugins::env pertains to conda-env source::partner created by or for an Anaconda, Inc. partner company stale::closed [bot] closed after being marked as stale stale [bot] marked as stale due to inactivity
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants