-
Notifications
You must be signed in to change notification settings - Fork 780
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
Can't get the latest version of miniconda3 #648
Comments
The command looks for all versions that start with the exact prefix (https://asdf-vm.com/#/core-manage-versions?id=show-latest-stable-version). The command you want is |
Hey Trevor, thank you for answering. This can be a little confusing, but there is two versions os miniconda. Miniconda/miniconda2 are based on python 2 (in some point, miniconda was renamed to miniconda2), and miniconda3 is based on python 3. So:
But both return nothing because of that pattern in te regex. Typing just |
@DjouGoulart oh I see. I misunderstood. |
Yes, it shows all versions as expected. |
You can see the regex matches here: https://regexr.com/4th57 |
Sorry, I didn't read your original issue closely. Definitely a bug. Thanks for reporting! I haven't talked to anyone else about this yet, but I'm actually not a big fan of this I think there are going to be so many edge cases that implementing this in asdf itself is going to be a pain. You've already found one issue with our implementation, and there are probably other bugs and other limitations because we have to have a generic feature that works with all plugins. I actually think it might be better to delegate this logic out to the plugins themselves, that way each plugin can just handle its own versions. |
So I think the changes made in #575 merit a significant refactoring at the very least. |
No problem, I should have been clearer. I agree with you, delegate this will not be the easiest, but will be a better solution. |
@Stratus3D I refactored this command to delegate the logic to the plugins, but the tests are failing (even when I run them without making any changes), so I made some tests manually and it seems to be working well. Should I create a pull request? |
@goulartdev sorry for the late response here. It looks like @threkk implemented this for us! Changes have been merged so if you use the latest master the option for the plugin to implement the latest-version selection logic is now available. The new callback is named At some point soon we should be tagging a new release, so you don't want to use the latest master (which could have unknown bugs or breaking changes) you will want to wait until the next tag. |
Steps to reproduce
asdf latest python miniconda3
Expected behavior
Should return the latest version of miniconda 3
Actual behavior
It returns nothing
Environment
OS: WSL/Ubuntu
asdf version: 0.7.6
The problem is with this regex, in asdf/lib/commands/command-latest:
grep -vE "(^Available versions:|-src|-dev|-latest|-stm|[-\\.]rc|-alpha|-beta|[-\\.]pre|-next|(a|b|c)[0-9]+|snapshot|master)"
The pattern
(a|b|c)[0-9]+
will remove all anaconda2, anaconda3, miniconda2 and miniconda3 from the result. This could be a solution:(a|b|c)(?<!conda)[0-9]+
Or, since this could happen with other plugins, maybe a more general solution would be better:
-(a|b|c)[0-9]+
But I don't know which plugins uses this
(a|b|c)[0-9]+
pattern, so changing this could break another plugin. Perhaps it should be possible for a plugin to overwrite this regex or the entire command, so this can be handled individually.The text was updated successfully, but these errors were encountered: