-
Notifications
You must be signed in to change notification settings - Fork 9
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
[WIP] Add type for requirement #10
base: master
Are you sure you want to change the base?
Conversation
I'm actually not sure why this package doesn't use the types from Pkg.Reqs directly. It is actually supported to have version ranges in REQUIRE that are unions of ranges with multiple components, though no currently tagged version in metadata has done so yet. |
Ah, cool. I changed it to now use the types from |
src/MetadataTools.jl
Outdated
julia_max_ver = convert(VersionNumber,s[3]) | ||
req.name!="julia" && continue | ||
isnull(req.upper_bound) && continue | ||
julia_max_ver = get(req.upper_bound) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkelman This is incorrect, but I'm not entirely sure what the right thing to do here is...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the Requirement type has a versions
field that's a VersionSet
type. VersionSet
has an intervals
field which is a vector of VersionInterval
s. If the vector isn't length 1, the code in this package probably won't handle it correctly. The first element of the array will have a lower
and upper
field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've pushed something that handles the case with one interval and throws an error otherwise. Probably more robust than the old code, that might or might not have thrown an error.
Once this is merged and tagged I'll merge queryverse/Query.jl#110, that shows how one can use Query with the stuff returned from MetadataTools. |
I think I got things right, but a review of the changes especially to |
I had this kind of code lying around in a branch over at Query.jl, but makes much more sense to integrate the delta here.
I'll probably add an example to Query.jl that shows how one can query the package database in combination with MetadataTools.