-
Notifications
You must be signed in to change notification settings - Fork 28
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
Allow specifying package versions #3
Comments
What kind of use case are you thinking of? You should be able to already do something like: @require DataFrames if v"0.5.1" < Pkg.installed("DataFrames") <= v"0.6.1"
# blah blah blah
end which might be enough. |
Yes, that would work just as well with a lot less work. Since we can't specify versions in REQUIRE for lazy (and non-required) modules loaded by |
Ok, makes sense – I'll add that snippet to the readme when I get a chance. |
I think adding that as sugar to the macro might be nice. It also might be nice to have with it a flag to give a warning by having the result be:
But with that said It is no pressing feature, I don't have any usecase blocked by it personally |
Latest hack for this:
|
@KristofferC pointed out that the above doesn't work, Because Here is my latest alternativive to
Note it working on CategoricalArrays which I only have via DataFrames.jl
|
How do we feel about the API:
Components:
|
If people start using this it will get extremely annoying. No longer will the resolver give you a set of versions that are specified to work with each other, you will at runtime get an error message that a version that you use is not supported. So you pin that or something and then another package starts complaining. There is no longer a central place where package compatibility is recorded. Dependency hell v2, here we come. Shudder. |
I agree, but... Some times it should be possibly to gracefully fail the version check, But I agree, determining compability at run time, rather than install time, is not the long term solution. |
Yeah, I agree 100% with Kristoffer's analysis, but at the same time you have to compare to the right counterfactual -- the situation we have right now is not actually better, just more implicit, and packages that need this are going to find some way to do it whether it's in Requires or not. And we'll be in that situation as long as the response from Pkg/Base folks is just "you shouldn't do this" without a better forward path. That being said, there's potentially a big difference between making something possible and making it easy. Maybe this should just remain something that's unsupported, undocumented and spoken of in hushed tones. That avoids people thinking it's a good idea because there's a convenient syntax for it. |
Does Project.toml allow specifying compat for packages that are not in deps? That could be an alternative (and no version checks in Requires.jl). Or an explicit optcompat section. |
No, it does not. |
This is still hurting me, |
It'd be really cool to allow the following
I think this should be possible, but it'll take some work to augment the data structures and method signatures to allow the optional version number. The macro parsing could also get complicated quickly, since if you give a mouse a cookie, the mouse will soon want
v"0.5.1" < DataFrames <= v"0.6.1"
.The text was updated successfully, but these errors were encountered: