Registry / serialization / packvers

packvers

JSON →
library21.5pypypi✓ verified 83d ago

Core utilities for Python package versioning. A fork of `packaging` version 21.3 that reintroduces `LegacyVersion` and supports PEP 440 / legacy comparison. Latest version 21.5, requires Python >=3.6.

pip install packvers
INSTALL
IMPORT
SIG · PACKVERS
P
packvers
serializationpythonv21.5
Install
1.7s avg
Import
19ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v21.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.018s · 19MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.020s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LegacyVersion
from packvers.version import LegacyVersion
from packaging.version import LegacyVersion
`LegacyVersion` is removed from `packaging` after 21.3; this fork restores it.
Version
from packvers.version import Version
Same API as upstream `packaging.version.Version`.
SpecifierSet
from packvers.specifiers import SpecifierSet
Same API as upstream.

Basic usage: parse and compare versions, including legacy format.

from packvers.version import Version, LegacyVersion from packvers.specifiers import SpecifierSet v = Version('1.2.3') print(v) # 1.2.3 print(SpecifierSet('>=1.0').contains(v)) # True # Legacy version support lv = LegacyVersion('1.2.3a') print(lv) # 1.2.3a
Debug
Known issues
gotcha`packvers.version.LegacyVersion` is available in this fork but not in `packaging>=21.3`. If you accidentally import from `packaging` expecting `LegacyVersion`, you'll get an `ImportError`.
fix
Use `from packvers.version import LegacyVersion` for legacy version support.
affects: >=21.5
deprecated`packvers` is a fork of an older version of `packaging`. It may not receive updates aligning with newer PEP standards. Consider using `packaging` directly unless you specifically need `LegacyVersion`.
fix
If you don't need legacy version support, switch to `packaging`.
affects: *
gotchaInstalling both `packaging` and `packvers` can cause dependency conflicts or namespace shadows if used together. Ensure only one is installed.
fix
Use a virtual environment and install only the required library.
affects: *
Errors
Common errors & fixes
from packvers.version import LegacyVersion ImportError: cannot import name 'LegacyVersion' from 'packvers.version'
You may have an older version of `packvers` that doesn't include `LegacyVersion`, or you accidentally installed `packaging` instead.
fix
Upgrade to `packvers>=21.5` with `pip install --upgrade packvers` and ensure `packaging` is not installed.
from packaging.version import LegacyVersion ImportError: cannot import name 'LegacyVersion' from 'packaging.version'
`LegacyVersion` was removed from `packaging` in version 21.0.
fix
Use `packvers.version.LegacyVersion` instead, or downgrade `packaging` to 20.9.
AttributeError: module 'packaging' has no attribute 'version'
You may have accidentally installed `packver` (wrong name) or the import path is incorrect.
fix
Uninstall conflicting packages and install `packvers` via `pip install packvers`.
Upgrade
Version history
21.5latest on PyPI · released Dec 22, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
packvers — pip install packvers · libregistry