You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**univers** wraps, embeds and implements multiple version comparison libraries,
55
+
each focused on a specific ecosystem versionning scheme.
56
+
57
+
For each scheme, **univers** provides an implementation for:
58
+
59
+
- the version comparison procedure e.g, how to compare two versions,
60
+
- parsing and converting from a native version range notation to the
61
+
**univers** normalized and unified internal model,
62
+
- converting a range back to its scheme-native range syntax and to the
63
+
``vers`` syntax.
64
+
65
+
**univers** implements ``vers``, an experimental unified and mostly universal
66
+
version range syntax. It can parse and convert an existing native version range
67
+
strings to this unified syntax. For example, this means:
68
+
69
+
- converting ">1.2.3" as used in a Python package into ``vers:pypi/>1.2.3``,
70
+
71
+
- or converting "^1.0.2" as used in an npm package dependency declartion into
72
+
``vers:npm/>=1.0.2,<2.0.0``
73
+
74
+
The supported package ecosystems versioning schemes and underlying libraries
75
+
include:
76
+
77
+
- npm that use the "node-semver" ranges notation and the semver versions syntax
78
+
This is supported in part by the `semantic_version <https://github.com/rbarrois/python-semanticversion>`_ library.
79
+
57
80
- pypi: handled by Python's packaging library and the standard ``packaging.version`` module.
58
-
- maven: handled by the embedded `rpm_vercmp <https://github.com/sbs2001/univers/blob/main/src/univers/rpm.py.ABOUT>`_ library.
59
-
- ebuild/gentoo: handled by the embedded `gentoo_vercmp <https://github.com/sbs2001/univers/blob/main/src/univers/gentoo.py.ABOUT>`_ module.
60
81
61
-
As we grow, new schemes will be implemented accordingly.
82
+
- Rubygems which use a semver-like but not-quite-semver scheme and there can be
83
+
commonly more than three version segments.
84
+
Gems also use a slightly different range notation from node-semver with
85
+
different operators and slightly different semantics: for instance it uses "~>"
86
+
as a pessimistic operator and supports exclusion with != and does not support
87
+
"OR" between constraints (that it call requirements).
88
+
89
+
- debian: handled by the `debian-inspector <https://github.com/nexB/univers/blob/main/src/univers/debian.py.ABOUT>`_
90
+
library.
91
+
92
+
- maven: handled by the embedded `pymaven <https://github.com/nexB/univers/blob/main/src/univers/pymaven.py.ABOUT>`_ library.
93
+
94
+
- rpm: handled by the embedded `rpm_vercmp <https://github.com/nexB/univers/blob/main/src/univers/rpm.py.ABOUT>`_ library.
95
+
96
+
- golang (using semver)
97
+
98
+
- PHP composer
99
+
100
+
- ebuild/gentoo: handled by the embedded `gentoo_vercmp <https://github.com/nexB/univers/blob/main/src/univers/gentoo.py.ABOUT>`_ module.
101
+
102
+
- arch linux : handled by the embedded `arch utility borrowed from msys2 <https://github.com/nexB/univers/blob/main/src/univers/arch.py.ABOUT>`_ module.
103
+
104
+
The level of support for each ecosystem may not be even for now and new schemes
105
+
and support for more package types are implemented on a continuous basis.
62
106
63
107
64
108
Alternative
65
109
============
66
110
67
111
Rather than using ecosystem-specific version schemes and code, another approach
68
112
is to use a single procedure for all the versions as implemented in `libversion
69
-
<https://github.com/repology/libversion>`_. This works in the most common case
70
-
but may not work correctly for specific tasks that demand accurate version
71
-
comparison such as for dependency resolution and vulnerabilities checks.
113
+
<https://github.com/repology/libversion>`_. ``libversion`` works in the most
114
+
common case but may not work correctly when a task that demand precise version
115
+
comparisons such as for dependency resolution and vulnerability lookup where
116
+
a "good enough" comparison accuracy is not acceptable. ``libversion`` does not
117
+
handle version range notations.
72
118
73
119
74
120
Installation
@@ -80,35 +126,40 @@ Installation
80
126
Examples
81
127
========
82
128
83
-
Compare two versions using the Python comparison operators:
0 commit comments