Skip to main content

A standalone bundle 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 bundle of distutils.version and packaging.version, without anything else.

verlib and Distutils are the implementations of PEP 386. packaging.version is the implementation of PEP 440. verlib2 bundles both of them into a standalone package.

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.

Following PEP 632 to leave distutils behind, we found that people started bundling pep440.py files into their projects, causing some redundancy across the board.

Setup

pip install verlib2

Usage

from verlib2 import Version

assert Version("1.0.dev456") < Version("1!1.2.rev33+123456") 

Note: The verlib2.Version symbol links to verlib2.packaging.version, effectively providing packaging's Version class as the default variant. Both implementations can be accessed like this:

from verlib2.distutils.version import LooseVersion, StrictVersion
from verlib2.packaging.version import Version

Acknowledgements

Alyssa Coghlan, Andrew Kuchling, Donald Stufft, Greg Stein, Greg Ward, Tarek Ziadé, and all contributors to PEP-0386, PEP-0440 and their predecessors, including other members of the Python Distutils-SIG and authors and contributors to the distutilsversion, verlib, distutils, distutils2, packaging.version packages.

Other projects

Notable other projects are pep440-rs and pep440-version-utils if you need better speed or more features. The former implements PEP440 in Rust, and the latter makes it easier to handle version bumps, also following the PEP440 specification. Both packages require Python 3.8 and higher.

Prior Art

We had a look at the pep440, pep440deb, pep440nz, pep440-utility, and version-utils, but apparently, they did not include what we have been looking for.

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

Supported by

JetBrains logo.

Special thanks to the people at JetBrains s.r.o. for supporting us with excellent development tooling.

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.2.tar.gz (17.0 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.2-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file verlib2-0.3.2.tar.gz.

File metadata

  • Download URL: verlib2-0.3.2.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for verlib2-0.3.2.tar.gz
Algorithm Hash digest
SHA256 a0a6af9838d8d26c18225a30c8d57fb70714462e3cd29f2451e7982d5a51e21e
MD5 be3baa39547fdf0656b064c24f2bebfe
BLAKE2b-256 c094b3f689e44c14702ce67fdf24db649e8193958f8de971e69d024ef7e6b295

See more details on using hashes here.

File details

Details for the file verlib2-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: verlib2-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for verlib2-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ddcc6f3a4f42019703ac5f6406faecefcd5f122e84a3d1a58190ddff23ec0426
MD5 65bf9aba23653ff86a49332e93006165
BLAKE2b-256 b8b25d2d39c1afb8b3904ed053dc4ec4a992f17c6a993e51e62a4af0d7878d00

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