New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

verlib2

Package Overview
Dependencies
Maintainers
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

verlib2

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

  • 0.3.1
  • PyPI
  • Socket score

Maintainers
3

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

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc