Minor:
- 112: Functions returning a new
Version
instance reuse the current class, helping with subclassing.
Bugfix:
- 141: Ensure we return a new instance for
Version.truncate("build")
.
New:
- 132: Ensure sorting a collection of versions is always stable, even with build metadata.
New:
- Add support for Django 3.1, 3.2, 4.0
- Add support for Python 3.7 / 3.8 / 3.9 / 3.10
Bugfix:
- 98: Properly handle wildcards in
SimpleSpec
(e.g.==1.2.*
).
Bugfix:
- #89: Properly coerce versions with leading zeroes in components (e.g.
1.01.007
)
- New:
- Add Clause.prettyprint() for debugging
Bugfix:
- #86: Fix handling of prerelease ranges within NpmSpec
Bugfix:
- #82: Restore computation of
Spec.specs
for single-term expressions (>=0.1.2
)
Bugfix:
- Restored attribute
Spec.specs
, removed by mistake during the refactor.
New:
- Restore support for Python 2.
Bugfix:
- Fix parsing of npm-based caret expressions.
This release brings a couple of significant changes:
- Allow to define several range description syntaxes (
SimpleSpec
,NpmSpec
, ...) - Fix bugs and unexpected behaviours in the
SimpleSpec
implementation.
Backwards compatibility has been kept, but users should adjust their code for the new features:
- Use
SimpleSpec
instead ofSpec
- Replace calls to
Version('1.2', partial=True)
withSimpleSpec('~1.2')
iter(some_spec)
is deprecated.
New:
- Allow creation of a
Version
directly from parsed components, as keyword arguments (Version(major=1, minor=2, patch=3)
)- Add
Version.truncate()
to build a truncated copy of aVersion
- Add
NpmSpec(...)
, following strict NPM matching rules (https://github.com/npm/node-semver#ranges)- Add
Spec.parse('xxx', syntax='<syntax>')
for simpler multi-syntax support- Add
Version().precedence_key
, for use insort(versions, key=lambda v: v.precedence_key)
calls. The contents of this attribute is an implementation detail.
Bugfix:
- Fix inconsistent behaviour regarding versions with a prerelease specification.
Deprecated:
- Deprecate the
Spec
class (Removed in 3.1); use theSimpleSpec
class instead- Deprecate the internal
SpecItem
class (Removed in 3.0).- Deprecate the
partial=True
form ofVersion
; useSimpleSpec
instead.
Removed:
- Remove support for Python2 (End of life 4 months after this release)
Refactor:
- Switch spec computation to a two-step process: convert the spec to a combination of simple comparisons with clear semantics, then use those.
New:
- #43: Add support for Django up to 1.10.
Removed:
- Remove support for Django<1.7
Bugfix:
- #35: Properly handle ^0.X.Y in a NPM-compatible way
Bugfix:
#18: According to SemVer 2.0.0, build numbers aren't ordered.
Remove specs of the
Spec('<1.1.3+')
formComparing
Version('0.1.0')
toVersion('0.1.0+bcd')
has new rules:>>> Version('0.1.0+1') == Version('0.1.0+bcd') False >>> Version('0.1.0+1') != Version('0.1.0+bcd') True >>> Version('0.1.0+1') < Version('0.1.0+bcd') False >>> Version('0.1.0+1') > Version('0.1.0+bcd') False >>> Version('0.1.0+1') <= Version('0.1.0+bcd') False >>> Version('0.1.0+1') >= Version('0.1.0+bcd') False >>> compare(Version('0.1.0+1'), Version('0.1.0+bcd')) NotImplemented:func:`semantic_version.compare` returns
NotImplemented
when its parameters differ only by build metadata
Spec('<=1.3.0')
now matchesVersion('1.3.0+abde24fe883')
#24: Fix handling of bumping pre-release versions, thanks to @minchinweb.
#30: Add support for NPM-style
^1.2.3
and~2.3.4
specs, thanks to @skwashd
Bugfix:
- Fix tests for Django 1.7+, thanks to @mhrivnak.
Bugfix:
- Fix packaging metadata (advertise Python 3.4 support)
New:
- #16: Add an API for bumping versions, by @RickEyre.
Bugfix:
- #13: Fix handling of files encoding in
setup.py
.
New:
- Handle the full
semver-2.0.0
specifications (instead of the2.0.0-rc2
of previous releases)- #8: Allow
'*'
as a valid version spec
Bugfix:
- #5: Fix packaging (broken symlinks, old-style distutils, etc.)
Bugfix:
- #2: Properly expose :func:`~semantic_version.validate` as a top-level module function.
Bugfix:
- #1: Allow partial versions without minor or patch level
New:
- Add the :meth:`Version.coerce <semantic_version.Version.coerce>` class method to :class:`~semantic_version.Version` class for mapping arbitrary version strings to semver.
- Add the :func:`~semantic_version.validate` method to validate a version string against the SemVer rules.
- Full Python3 support
Bugfix:
New:
- Add introspection rules for south
New:
- Add :func:`semantic_version.Spec.filter` (filter a list of :class:`~semantic_version.Version`)
- Add :func:`semantic_version.Spec.select` (select the highest :class:`~semantic_version.Version` from a list)
- Update :func:`semantic_version.Version.__repr__`
Backwards incompatible changes:
- Removed "loose" specification support
- Cleanup :class:`~semantic_version.Spec` to be more intuitive.
- Merge Spec and SpecList into :class:`~semantic_version.Spec`.
- Remove :class:`~semantic_version.django_fields.SpecListField`
New:
Allow split specifications when instantiating a :class:`~semantic_version.SpecList`:
>>> SpecList('>=0.1.1', '!=0.1.3') == SpecList('>=0.1.1,!=0.1.3') True
New:
- Improved "loose" specification support (
>~
,<~
,!~
)- Introduced "not equal" specifications (
!=
,!~
)- :class:`~semantic_version.SpecList` class combining many :class:`~semantic_version.Spec`
- Add :class:`~semantic_version.django_fields.SpecListField` to store a :class:`~semantic_version.SpecList`.
First public release.
New:
- :class:`~semantic_version.Version` and :class:`~semantic_version.Spec` classes
- Related django fields: :class:`~semantic_version.django_fields.VersionField` and :class:`~semantic_version.django_fields.SpecField`