Skip to content

Commit b70bbe9

Browse files
committed
Improve doc for existing schemes
Improve documentation for existing versioning schems Explain why we do not use mathematical intervals Fix minor typos and improve formatting Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
1 parent be1dc2a commit b70bbe9

1 file changed

Lines changed: 27 additions & 14 deletions

File tree

VERSION-RANGE-SPEC.rst

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,35 +61,38 @@ in use:
6161

6262
- Rubygems strongly suggest using ``semver`` for version but does not enforce it.
6363
As a result some use semver and several popular package do not use strict
64-
semver. Runbygems use their own notation for version ranges.
65-
https://guides.rubygems.org/patterns/#semantic-versioning
64+
semver. Rubygems use their own notation for version ranges which ressembles
65+
the ``node-semver`` notation with some subtle differences.
66+
See https://guides.rubygems.org/patterns/#semantic-versioning
6667

67-
- node-semver ranges are used in npm at https://github.com/npm/node-semver#ranges
68+
- ``node-semver`` ranges are used in npm at https://github.com/npm/node-semver#ranges
6869
with range semantics that are specific to ``semver`` and npm.
6970

7071
- Dart pub versioning scheme is similar to ``node-semver`` and the documentation
7172
at https://dart.dev/tools/pub/versioning provides a comprehensive coverage of
72-
the topic of versioning. Version resolution is using its own algorithm.
73+
the topic of versioning. Version resolution uses its own algorithm.
7374

74-
- Python uses its own version and version ranges notation
75+
- Python uses its own version and version ranges notation with notable
76+
specificities on how how pre- and post-release suffixes are used
7577
https://www.python.org/dev/peps/pep-0440/
7678

77-
- Debian and Ubuntu use their own notation
79+
- Debian and Ubuntu use their own notation and are remarkabel for their use of
80+
``epochs`` to disambiguate versions.
7881
https://www.debian.org/doc/debian-policy/ch-relationships.html
7982

80-
- RPM distros use their own range notation
83+
- RPM distros use their own range notation and use epochs like Debian.
8184
https://rpm-software-management.github.io/rpm/manual/dependencies.html
8285

83-
- Perl CPAN define its own version range notation similar to this specification
84-
https://metacpan.org/pod/CPAN::Meta::Spec#Version-Ranges
86+
- Perl CPAN defines its own version range notation similar to this specification
87+
and uses two-segment versions. https://metacpan.org/pod/CPAN::Meta::Spec#Version-Ranges
8588

86-
- Apache Maven and NuGet use similar math intervals notation
89+
- Apache Maven and NuGet use similar math intervals notation using brackets
8790
https://en.wikipedia.org/wiki/Interval_(mathematics)
8891

8992
- Apache Maven http://maven.apache.org/enforcer/enforcer-rules/versionRanges.html
9093
- NuGet https://docs.microsoft.com/en-us/nuget/concepts/package-versioning#version-ranges
9194

92-
- gradle uses Apache Maven notation with extensions
95+
- gradle uses Apache Maven notation with some extensions
9396
https://docs.gradle.org/current/userguide/single_versions.html
9497

9598
- Gentoo and Alpine Linux use comparison operators similar to this specification:
@@ -133,10 +136,10 @@ related topic:
133136
- Each package ecosystem may have evolved its own peculiar version string
134137
conventions, semantics and comparison procedure.
135138

136-
- For instance, semver is a prominent specification in this domain but this is
139+
- For instance, ``semver`` is a prominent specification in this domain but this is
137140
just one of the many ways to structure a version string.
138141

139-
- Debian, RPM, PyPI, Rubygems, and Composer have their own subtly different
142+
- Debian, RPM, PyPI, Rubygems, and Composer have their own subtly different
140143
approach on how to determine which version is greater or lesser.
141144

142145

@@ -172,7 +175,7 @@ For example to define a set of versions that contains either version ``1.2.3``,
172175
or any versions greater than or equal to ``2.0.0`` but less than ``5.0.0`` using
173176
the ``node-semver`` versioning scheme, the version range specifier will be::
174177

175-
vers:node-semver/1.2.3|>=2.0.0,<5.0.0
178+
vers:npm/1.2.3|>=2.0.0,<5.0.0
176179

177180
Each ``<version-constraint>`` in the pipe-separated list is either a simple
178181
constraint such as::
@@ -621,6 +624,16 @@ semver) as used in one ecosystem and therefore are not reusable in another
621624
ecosystem that would not use the version string conventions.
622625

623626

627+
Why not use mathematical interval notation for ranges?
628+
#######################################################
629+
630+
Apache Maven and NuGet make use of a mathematical interval with "[" and ")" as a
631+
syntax for version ranges.
632+
633+
All other notations are using >, <, and = as base symbols for ranges. ``vers``
634+
reuses this approach because it is more common across package ecosystems.
635+
636+
624637
References
625638
~~~~~~~~~~~~~~~~~~~~
626639

0 commit comments

Comments
 (0)