JuliaLang / Pkg.jl

Pkg - Package manager for the Julia programming language
https://pkgdocs.julialang.org
Other
609 stars 251 forks source link

Allow non-semver (and epocs) #3844

Open PallHaraldsson opened 3 months ago

PallHaraldsson commented 3 months ago

Version numbers use semver, and do not allow epocs.

I'm thinking, if a package user does not want to follow semver, does Pkg presume it? I'm not actually sure what happens if you disregard semver, in packages (not proposing for Julia itself...).

It's possible that some users will want it, and it seemingly should be its private decision. But then we have a conflict if changing later to semver (seemingly ok to change from semver to calender based though, only a problem in other direction), why epocs:

https://peps.python.org/pep-0440/#version-epochs

We don't have to adopt Python's version spec in full, but maybe some parts, at least epocs might be useful, and implied 0, i.e. 0! prefix if none...

PallHaraldsson commented 3 months ago

[I maybe should have posted here at Pkg, though version parsing is in Base... the question on it - and Pkg.]

Extra question, in short, this is intended (and documented?) or a bug (I was editing, adding this, and lost my longer edit while issue moved to Pkg...)?

julia> v"∞"
v"∞"

julia> @edit tryparse(VersionNumber, "∞")
mkitti commented 3 months ago

I'm not completely following. Could we just map epoch to the major version number?

E!X.Y just becomes E.X.Y

This seems to be the domain of VersionParsing.jl:

https://github.com/JuliaInterop/VersionParsing.jl