Skip to main content

A standalone variant of `distutils.version` and `packaging.version`, without anything else.

Project description

verlib2

Tests Test coverage Python versions

License Status PyPI Downloads

» 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

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

verlib2-0.3.1.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

verlib2-0.3.1-py3-none-any.whl (14.2 kB view details)

Uploaded Python 3

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

Hashes for verlib2-0.3.1.tar.gz
Algorithm Hash digest
SHA256 2862f19528db400d130253a2b71c7c3616ee14e1d54bf6833bc0929d2cddd141
MD5 5fefb8c9c20e9ba673bec70274d60f8c
BLAKE2b-256 aad43009a8d0d8b6d5b9eb94a86d8adb9335ab67c61e9658c7fc1c9dcce61363

See more details on using hashes here.

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

Hashes for verlib2-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cf8e2be044b834a2670f2d4c20a93cfc674933c0070543a6f61d531439cca200
MD5 db80b4058728dd60aa7533b1f6f89fb8
BLAKE2b-256 4e7a1b537ad58e042cb6d1223ae6d8dfa330396cfd9d4095491615ee21b2edae

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page