Pkg.jl: Version bounds with a space not a comma

Created on 26 Nov 2019  Â·  2Comments  Â·  Source: JuliaLang/Pkg.jl

I made the mistake of writing this

julia = "0.7 1.0"

over here, which leads to warnings when loading the package on Julia 1.3.

@fredrikekre points out that this is parsed as follows:

julia> Pkg.Types.semver_spec("0.7 1.0")
VersionSpec("0.71”)

Surely I’m not the only guy who’ll ever make this mistake. Perhaps it should either be an error, or be accepted?

Most helpful comment

Yeah, would be best for that to error.

All 2 comments

I don’t think we should accept spaces as a substitute for commas.

For example, in the current hyphen syntax for specifying ranges, we require a space on either side of the hyphen. That is, 1.2 - 3.4 is a valid range, but 1.2-3.4 is not a valid range. This is necessary to avoid confusion with the server prerelease syntax.

So I think it would be confusing to have spaces mean one thing in one context, and a different thing in different contexts.

I think it would be fine to throw an error on something like Foo = "1.0 2.0". But we shouldn’t accept it.

Yeah, would be best for that to error.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

oxinabox picture oxinabox  Â·  3Comments

GordStephen picture GordStephen  Â·  3Comments

omus picture omus  Â·  4Comments

StefanKarpinski picture StefanKarpinski  Â·  3Comments

timholy picture timholy  Â·  4Comments