| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
univers was born out of the need for a mostly universal way to store version ranges and to compare two software package versions in VulnerableCode.
Package version ranges and version constraints are useful and essential:
Version syntaxes and range notations are quite different across ecosystems, making it is difficult to process versions and version ranges across ecosystems in a consistent way.
Existing tools and libraries typically support a single algorithms to parse and compare versions with a single version range notation for a single package ecosystem.
univers is different:
univers wraps, embeds and implements multiple version comparison libraries, each focused on a specific ecosystem versioning scheme.
For each scheme, univers provides an implementation for:
univers implements VERS, an experimental unified and mostly universal version range syntax. It can parse and convert an existing native version range string to this unified syntax. For example, this means:
The supported package ecosystem versioning schemes and underlying libraries include:
The level of support for each ecosystem may not be even for now and new schemes and support for more package types are implemented on a continuous basis.
Rather than using ecosystem-specific version schemes and code, another approach is to use a single procedure for all the versions as implemented in libversion. libversion works in the most common cases but may not work correctly when a task that demand precise version comparisons such as for dependency resolution and vulnerability lookup where a "good enough" comparison accuracy is not acceptable. libversion does not handle version range notations.
$ pip install univers
Compare two native Python versions:
from univers.versions import PypiVersion
assert PypiVersion("1.2.3") < PypiVersion("1.2.4")Normalize a version range from an npm:
from univers.version_range import NpmVersionRange
range = NpmVersionRange.from_native("^1.0.2")
assert str(range) == "vers:npm/>=1.0.2|<2.0.0"Test if a version is within or outside a version range:
from univers.versions import PypiVersion
from univers.version_range import VersionRange
range = VersionRange.from_string("vers:pypi/>=1.2.4")
assert PypiVersion("1.2.4") in range
assert PypiVersion("1.2.3") not in rangeRun these commands, starting from a git clone of https://github.com/aboutcode-org/univers
$ ./configure --dev $ source venv/bin/active $ pytest -vvs
We use the same development process as other AboutCode projects.
Visit https://github.com/aboutcode-org/univers and https://gitter.im/aboutcode-org/vulnerablecode and https://gitter.im/aboutcode-org/aboutcode for support and chat.
Primary license: Apache-2.0 SPDX-License-Identifier: Apache-2.0 AND BSD-3-Clause AND MIT
This project is funded, supported and sponsored by:
This project was funded through the NGI0 PET Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 825310.
https://nlnet.nl/project/VulnerableCode/
This project was funded through the NGI0 Discovery Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 825322.
https://nlnet.nl/project/vulnerabilitydatabase/
This project was funded through the NGI0 Core Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101092990.
https://nlnet.nl/project/VulnerableCode-enhancements/
This project is funded through the NGI0 Entrust Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101069594.
https://nlnet.nl/project/FederatedSoftwareMetadata/
This project was funded through the NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101135429. Additional funding is made available by the Swiss State Secretariat for Education, Research and Innovation (SERI).
https://nlnet.nl/project/FederatedCodeNext/
This project was funded through the NGI0 Entrust Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101069594.
| Back | FazBrowse Home | New Git URL |