- Support for Python 3.12
- Support for Python 3.7
- Type hints.
- Support for Python 2.7, 3.5, and 3.6.
__version__
,__author__
, and__email__
attributes from parver module. Use :mod:`importlib.metadata` instead.
- Grammar is parsed when first used to improve import time.
- attrs deprecation warning. The minimum attrs version is now 19.2
- Errors raised for keyword-only argument errors on Python 3 did not have the right error message.
Version.truncate
method to remove trailing zeros from the release segment.Version
now validates each item in the release sequence.Version.bump_epoch
method.- Add
by
keyword argument tobump_pre
,bump_post
, andbump_dev
methods, which e.g..bump_dev(by=-1)
.
BREAKING CHANGE. The
Version
constructor now uses an empty string to represent an implicit zero instead ofNone
.>>> Version(release=1, post='') <Version '1.post'>
- BREAKING CHANGE.
Version.clear
is no longer necessary. UseVersion.replace(pre=None, post=None, dev=None)
instead.
Version
incorrectly allowed an empty release sequence.Version
rejectsbool
for numeric components.Version
rejects negative integers for numeric components.- The strict parser no longer accepts local versions with
-
or_
separators, or uppercase letters. - The strict parser no longer accepts numbers with leading zeros.
- The local version was only being converted to lowercase when parsing
with
strict=False
. It is now always converted. - The local version separators were not being normalized to use
.
.
- On Python 2,
Version
was incorrectly rejectinglong
integer values.
Version.bump_release_to
method for control over the value to bump to, e.g. for CalVer.Version.set_release
method for finer control over release values without resetting subsequent indices to zero.
- BREAKING CHANGE. The argument to
Version.bump_release
is now a keyword only argument, e.g.Version.bump_release(index=0)
. - The
release
parameter toVersion
now accepts any iterable.
- Deprecation warnings about invalid escape sequences in
_parse.py
.
Version
acceptedpre=None
andpost_tag=None
, which produces an ambiguous version number. This is because an implicit pre-release number combined with an implicit post-release looks like a pre-release with a custom separator:>>> Version(release=1, pre_tag='a', pre=None, post_tag=None, post=2) <Version '1a-2'> >>> Version(release=1, pre_tag='a', pre_sep2='-', pre=2) <Version '1a-2'>
The first form now raises a
ValueError
.Don’t allow
post=None
whenpost_tag=None
. Implicit post releases cannot have implicit post release numbers.
First release.