Metadata-Version: 2.4
Name: verlib2
Version: 0.3.2
Summary: A standalone bundle of "distutils.version" and "packaging.version", without anything else.
Author-email: Donald Stufft <donald@stufft.io>
Maintainer-email: Andreas Motl <andreas.motl@panodata.org>
Project-URL: repository, https://github.com/pyveci/verlib2
Keywords: distutils,packaging,pep386,pep440,version,versioning
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: Free Threading
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Quality Assurance
Classifier: Topic :: Software Development :: Testing
Classifier: Typing :: Typed
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: importlib-metadata; python_version < "3.8"
Provides-Extra: develop
Requires-Dist: poethepoet<1; extra == "develop"
Requires-Dist: pyproject-fmt<3; extra == "develop"
Requires-Dist: ruff<0.16; extra == "develop"
Requires-Dist: ty==0.0.26; python_version >= "3.8" and extra == "develop"
Requires-Dist: validate-pyproject<1; extra == "develop"
Provides-Extra: release
Requires-Dist: build<2; extra == "release"
Requires-Dist: twine<7; extra == "release"
Provides-Extra: test
Requires-Dist: pretend<2; extra == "test"
Requires-Dist: pytest<9; extra == "test"
Requires-Dist: pytest-cov<8; extra == "test"
Dynamic: license-file

# verlib2

[![Tests](https://github.com/pyveci/verlib2/actions/workflows/main.yml/badge.svg)](https://github.com/pyveci/verlib2/actions/workflows/main.yml)
[![Test coverage](https://img.shields.io/codecov/c/gh/pyveci/verlib2.svg)](https://codecov.io/gh/pyveci/verlib2/)
[![Python versions](https://img.shields.io/pypi/pyversions/verlib2.svg)](https://pypi.org/project/verlib2/)

[![License](https://img.shields.io/github/license/pyveci/verlib2.svg)](https://github.com/pyveci/verlib2/blob/main/LICENSE)
[![Status](https://img.shields.io/pypi/status/verlib2.svg)](https://pypi.org/project/verlib2/)
[![PyPI](https://img.shields.io/pypi/v/verlib2.svg)](https://pypi.org/project/verlib2/)
[![Downloads](https://pepy.tech/badge/verlib2/month)](https://www.pepy.tech/projects/verlib2)


<!-- » [Documentation] -->

» [Changelog]
| [PyPI]
| [Issues]
| [Source code]
| [License]

[Changelog]: https://github.com/pyveci/verlib2/blob/main/CHANGES.md
[Documentation]: https://verlib2.readthedocs.io/
[Issues]: https://github.com/pyveci/verlib2/issues
[License]: https://github.com/pyveci/verlib2/blob/main/LICENSE
[PyPI]: https://pypi.org/project/verlib2/
[Source code]: https://github.com/pyveci/verlib2

## 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

```shell
pip install verlib2
```

## Usage

```python
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:

```python
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.
```shell
python3 -m venv .venv
source .venv/bin/activate
pip install --editable='.[develop,test]'
```

Run software tests.
```shell
poe check
```

## Supported by

[![JetBrains logo.](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg)](https://jb.gg/OpenSourceSupport)

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


[bundling]: https://github.com/numpy/numpy/blob/v1.26.0/numpy/_utils/_pep440.py
[Distutils]: https://pypi.org/project/Distutils/
[distutils2]: https://hg.python.org/distutils2
[distutilsversion]: http://bitbucket.org/tarek/distutilsversion/
[packaging.version]: https://github.com/pypa/packaging/blob/main/src/packaging/version.py
[pep440]: https://pypi.org/project/pep440/
[pep440deb]: https://pypi.org/project/pep440deb/
[pep440nz]: https://pypi.org/project/pep440nz/
[pep440.py]: https://github.com/crate/crate-python/pull/513
[pep440-rs]: https://pypi.org/project/pep440-rs/
[pep440-utility]: https://pypi.org/project/pep440-utility/
[pep440-version-utils]: https://pypi.org/project/pep440-version-utils/
[PEP 386]: https://peps.python.org/pep-0386/
[PEP 440]: https://peps.python.org/pep-0440/
[PEP 632]: https://peps.python.org/pep-0632/
[started]: https://github.com/numpy/numpy/pull/21000
[verlib]: https://pypi.org/project/verlib/
[verlib2]: https://pypi.org/project/verlib2/
[version-utils]: https://pypi.org/project/version-utils/
