A standalone variant of `distutils.version` and `packaging.version`, without anything else.
Project description
verlib2
» Changelog | PyPI | Issues | Source code | License
About
A standalone variant of distutils.version and packaging.version,
without anything else.
verlib is the implementation of PEP 386.
verlib2 is the implementation of PEP 440.
It also includes the original distutils.version implementation,
for those who need it going forward.
Rationale
Everyone needs to compare versions, but no one wants to add packaging as a dependency.
distutils is deprecated, and Python 3.12 removed it from the standard library.
Setup
pip install verlib2
Usage
from verlib2 import Version
assert Version("1.0.dev456") < Version("1!1.2.rev33+123456")
Note: verlib2.Version provides packaging's Version, while
both implementations can be accessed like this:
from verlib2.distutils.version import LooseVersion, StrictVersion
from verlib2.packaging.version import Version
Acknowledgements
Greg Stein, Greg Ward, Donald Stufft, Tarek Ziadé, and all contributors to
distutilsversion, verlib, distutils, distutils2, packaging.version,
PEP-0386, PEP-0440, and most probably many more.
Prior Art
- https://peps.python.org/pep-0386/
- https://peps.python.org/pep-0440/
- http://bitbucket.org/tarek/distutilsversion/
- https://pypi.org/project/verlib/
- https://hg.python.org/distutils2
- https://github.com/pypa/packaging/blob/23.2/src/packaging/version.py
- https://github.com/numpy/numpy/pull/21000
- https://github.com/numpy/numpy/blob/v1.26.0/numpy/_utils/_pep440.py
- https://github.com/crate/crate-python/pull/513
- https://pypi.org/search/?q=pep440
- https://pypi.org/project/pep440/
- https://pypi.org/project/pep440deb/
- https://pypi.org/project/pep440nz/
- https://pypi.org/project/pep440-rs/
- https://pypi.org/project/pep440-utility/
- https://pypi.org/project/pep440-version-utils/
- https://pypi.org/project/version-utils/
Development
Set up package in development mode.
python3 -m venv .venv
source .venv/bin/activate
pip install --editable='.[develop,test]'
Run software tests.
poe check
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file verlib2-0.3.1.tar.gz.
File metadata
- Download URL: verlib2-0.3.1.tar.gz
- Upload date:
- Size: 15.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2862f19528db400d130253a2b71c7c3616ee14e1d54bf6833bc0929d2cddd141
|
|
| MD5 |
5fefb8c9c20e9ba673bec70274d60f8c
|
|
| BLAKE2b-256 |
aad43009a8d0d8b6d5b9eb94a86d8adb9335ab67c61e9658c7fc1c9dcce61363
|
File details
Details for the file verlib2-0.3.1-py3-none-any.whl.
File metadata
- Download URL: verlib2-0.3.1-py3-none-any.whl
- Upload date:
- Size: 14.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf8e2be044b834a2670f2d4c20a93cfc674933c0070543a6f61d531439cca200
|
|
| MD5 |
db80b4058728dd60aa7533b1f6f89fb8
|
|
| BLAKE2b-256 |
4e7a1b537ad58e042cb6d1223ae6d8dfa330396cfd9d4095491615ee21b2edae
|