Changes for the upcoming release can be found in the “changelog.d” directory in our repository.
This section covers the changes between major version 2 and version 3.
#291: Disallow negative numbers in VersionInfo arguments for
#310: Rework API documentation. Follow a more “semi-manual” attempt and add auto directives into
#344: Allow empty string, a string with a prefix, or
Noneas token in
#374: Correct Towncrier’s config entries in the
pyproject.tomlfile. The old entries
[[tool.towncrier.type]]are deprecated and need to be replaced by
PR #384: General cleanup, reformat files:
Reformat source code with black again as some config options did accidentely exclude the semver source code. Mostly remove some includes/excludes in the black config.
Integrate concurrency in GH Action
Ignore Python files on project dirs in .gitignore
Remove unused patterns in MANIFEST.in
extend-excludefor flake in
setup.cfg`and adapt list.
PR #393: Fix command python -m semver to avoid the error “invalid choice”
PR #396: Calling
parse()on a derived class will show correct type of derived class.
#169: Deprecate CLI functions not imported from
setup.pysimplified file and remove
#284: Deprecate the use of
is_valid()for consistency reasons with
PR #290: For semver 3.0.0-alpha0 deprecated:
Remove anything related to Python2
.travis.ymlRemove targets py27, py34, py35, and pypy. Add py38, py39, and nightly (allow to fail)
setup.pysimplified file and remove
Remove old Python versions (2.7, 3.4, 3.5, and pypy) from Travis
#372: Deprecate support for Python 3.6.
Python 3.6 reached its end of life and isn’t supported anymore. At the time of writing (Dec 2022), the lowest version is 3.7.
Although the poll didn’t cast many votes, the majority agreed to remove support for Python 3.6.
#169: Create semver package and split code among different modules in the packages:
src/semver/cli.pyfor all CLI methods
deprecateddecorator and other deprecated functions
src/semver/__main__.pyto allow calling the CLI using python -m semver
src/semver/_types.pyto hold type aliases
src/semver/version.pyto hold the
Versionclass (old name
VersionInfo) and its utility functions
src/semver/__about__.pyfor all the metadata variables
#213: Add typing information
is_compatible()to make “is self compatible with X”.
Versionbut keep an alias for compatibility
PR #359: Add optional parameter
parse()to allow optional minor and patch parts.
PR #362: Make
match()accept a bare version string as match expression, defaulting to equality testing.
pyproject.tomlto make it possible to use the pyproject-build command from the build module. For more information, see Building semver.
Use setuptools, add metadata. Taken approach from A Practical Guide to Setuptools and Pyproject.toml.
Doc: Describe building of semver
MANIFEST.in(not needed anymore)
Distinguish between Python 3.6 and others in
Add skip_missing_interpreters option for
GH Action: Upgrade setuptools and setuptools-scm and test against 3.11.0-rc.2
#276: Document how to create a sublass from
#284: Document deprecation of
PR #290: Several improvements in the documentation:
New layout to distinguish from the semver2 development line.
Create new logo.
Remove any occurances of Python2.
Describe changelog process with Towncrier.
Update the release process.
#304: Several improvements in documentation:
Reorganize API documentation.
Add migration chapter from semver2 to semver3.
Distinguish between changlog for version 2 and 3
#312: Rework “Usage” section.
Mention the rename of
Remove semver. prefix in doctests to make examples shorter
Correct some references to dunder methods like
Remove inconsistencies and mention module level function as deprecated and discouraged from using
#315: Improve release procedure text
#335: Add new section “Converting versions between PyPI and semver” the limitations and possible use cases to convert from one into the other versioning scheme.
#340: Describe how to get version from a file
#343: Describe combining Pydantic with semver in the “Advanced topic” section.
#350: Restructure usage section. Create subdirectory “usage/” and splitted all section into different files.
#351: Introduce new topics for:
“Migration to semver3”
PR #392: Fix the example in the documentation for combining semver and pydantic.
#169: Adapted infrastructure code to the new project layout.
setup.cfgis easier to use
Adapt documentation code snippets where needed
deprecatedto hardcode the
semverpackage name in the warning.
Increase coverage to 100% for all non-deprecated APIs
PR #290: Add supported Python versions to black.
#304: Support PEP-561
According to the mentioned PEP:
“Package maintainers who wish to support type checking of their code MUST add a marker file named
py.typedto their package supporting typing.”
Add package_data to
setup.cfgto include this marker in dist and whl file.
#309: Some (private) functions from the
semver.versionmodule has been changed.
The following functions got renamed:
semver.version.comparator()got renamed to
semver.version._comparator()as it is only useful inside the
semver.version.cmp()got renamed to
semver.version._cmp()as it is only useful inside the
The following functions got integrated into the
semver.version._nat_cmd()as a classmethod
changelogentry to skip installation for semver. This should speed up the execution of towncrier.
#316: Comparisons of
Versionclass and other types return now a
NotImplementedconstant instead of a
The NotImplemented section of the Python documentation recommends returning this constant when comparing with
__lt__, and other comparison operators to “to indicate that the operation is not implemented with respect to the other type”.
#319: Introduce stages in
.travis.ymlThe config file contains now two stages: check and test. If check fails, the test stage won’t be executed. This could speed up things when some checks fails.
#322: Switch from Travis CI to GitHub Actions.
#347: Support Python 3.10 in GitHub Action and other config files.
#378: Fix some typos in Towncrier configuration
#388: For pytest, switch to the more modern
importlibapproach as it doesn’t require to modify
PR #389: Add public class variable
This class variable contains a tuple of strings that contains the names of all attributes of a Version (like
In cases we need to have dynamical values, this makes it easier to iterate.