repomatic.versions moduleΒΆ
PEP 440 version primitives, shared by the whole package.
Every version this package reads comes from somewhere it does not control (a
lock file, a package index, a git tag), so parsing has to tolerate junk, and
nearly every module compares or normalizes versions somewhere. These helpers
stay out of repomatic.deps.pins, whose import graph reaches the GitHub,
PyPI and npm clients: a module below it in that graph could not import them
without closing a cycle. A leaf module with no dependency beyond packaging is
what lets everyone import the one copy.
- repomatic.versions.BUMP_PARTS = ('minor', 'major')ΒΆ
The version parts a bump-version job may propose.
The
changelog.yamlbump matrix runs one job per entry, andis_version_bump_allowed()gates each against the last release. A patch bump is absent by design: the post-release commit already writes the next.dev0floor, so nothing has to propose one.
- repomatic.versions.DEV_SUFFIX_RE = re.compile('\\.dev\\d*$')ΒΆ
Match the trailing PEP 440 developmental-release segment of a version.
- repomatic.versions.safe_version(value)[source]ΒΆ
Parse a PEP 440 version, returning
Nonefor anything unparsable.Collapsing the
try/except InvalidVersioninto one helper keeps the callers reading as the filters they are.
- repomatic.versions.parse_tag_version(tag)[source]ΒΆ
Parse a git tag as a version, dropping its
vprefix.The
vbelongs to the tag namespace and the version string itself is bare, so tagv1.2.3names version1.2.3. A tag outside the version scheme (nightly,v1.2.3_hotfix) is not an error: every caller reads tags it does not control, and one odd tag must not stop the others from parsing.