Registry / serialization / verspec

verspec

JSON →
library0.1.0pypypi✓ verified 24d ago

verspec is a Python library for handling software versions and specifiers, adapted from the `packaging` package. It provides a flexible API for parsing, comparing, and working with version strings, supporting both 'loose' and 'Python' (PEP 440) version schemes. The current version is 0.1.0, released in November 2020. As an initial release, its release cadence is not yet established.

pip install verspec
INSTALL
IMPORT
SIG · VERSPEC
V
verspec
serializationpythonv0.1.0
Install
1.7s avg
Import
15ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.0 · 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.014s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.016s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

loose.Version
from verspec import loose
Classes like `Version` and `SpecifierSet` are exposed under submodules `loose` and `python`.
python.Version
from verspec import python
Classes like `Version` and `SpecifierSet` are exposed under submodules `loose` and `python`.
loose.SpecifierSet
from verspec import loose
Classes like `Version` and `SpecifierSet` are exposed under submodules `loose` and `python`.
python.SpecifierSet
from verspec import python
Classes like `Version` and `SpecifierSet` are exposed under submodules `loose` and `python`.

This example demonstrates how to import and use both the 'loose' and 'python' (PEP 440 compliant) version and specifier classes to check if a version satisfies a given specifier.

from verspec import loose, python # Using the 'loose' version scheme v_loose = loose.Version('1.0') s_loose = loose.SpecifierSet('~=1.0') assert v_loose in s_loose print(f"Loose Version '{v_loose}' is in specifier '{s_loose}': {v_loose in s_loose}") # Using the 'python' (PEP 440) version scheme v_python = python.Version('1.0') s_python = python.SpecifierSet('~=1.0') assert v_python in s_python print(f"Python Version '{v_python}' is in specifier '{s_python}': {v_python in s_python}")
Debug
Known issues
gotchaThe library is explicitly marked as 'Alpha' (Development Status: 3 - Alpha on PyPI) and its documentation is currently 'Forthcoming!'. This indicates that the API surface might be unstable, and future releases (even minor ones) may introduce breaking changes or significant behavioral differences without explicit deprecation warnings.
fix
Thoroughly test version parsing and comparison logic when upgrading to new `verspec` versions. Consult the GitHub repository's `CHANGES.md` or commit history for potential changes if official documentation is still unavailable.
affects: 0.1.0
gotchaThe library provides two distinct version schemes: `verspec.loose` (for a more liberal interpretation of versions) and `verspec.python` (for PEP 440 compliant versioning). Mixing these types or using `loose` where strict PEP 440 compliance is required (e.g., for package dependency resolution) can lead to unexpected or incorrect comparison results.
fix
Always explicitly import from either `verspec.loose` or `verspec.python` and consistently use the appropriate classes for a given context. For PyPI-style versioning and dependency resolution, `verspec.python` should be preferred.
affects: 0.1.0
Upgrade
Version history
0.1.0latest on PyPI · released Nov 30, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
17 hits · last 30 days
node
12
OpenAI (training)
1
Resources
verspec — pip install verspec · libregistry