Make compatibility options of write_basic_package_version_file() more intuitive and complete
This is a discussion split out from !2111 (comment 417639) where @drdanz makes the following observations:
... the
ExactVersion
name is a bit confusing, compared to the other names, especially because the tweak number is never checked, therefore I think thatAnyNewerVersion|SameMajorVersion|SameMinorVersion|SamePatchVersion
would be easier to understand...Therefore I'm proposing to add
SamePatchVersion
instead of modifyingExactVersion
, just in case there is someone relying onExactVersion
behaviour (I doubt that, but https://xkcd.com/1172/), and perhaps deprecate and removeExactVersion
later...
Adding SamePatchVersion
makes sense given that we already have SameMajorVersion
and SameMinorVersion
. The fact that ExactVersion
is a misleading name for what it does (even though its behavior is accurately documented) suggests that we probably do want to deprecate it and replace it with something that does what ExactVersion
should have done and require the entire version string to match (i.e. not even require it to match any particular version numbering format). The option could have a name like IdenticalVersion
, although I would welcome a better suggestion than that.
I would also propose that we should have a SemanticVersion
compatibility option too (see http://semver.org). I'd argue that this is probably what projects actually want most of the time, but it can't be provided by any of the existing options. SameMajorVersion
is close, but it ignores the other version components rather than requiring them to not indicate an older version than the one required. Incrementing the minor version can add new functionality in a backward compatible way, so looking at just the major version alone is not enough. Note that semantic versioning does not include any tweak component.