- Support Python 3.14
- Added
{normalized_version}to the fields available to thewriteandonbuildsteps
- Support reading configuration from a
versioningit.tomlfile instead ofpyproject.toml(contributed by @b-sturgeon) - Added
NoConfigFileErrorandNoConfigSectionErrorsubclasses ofNotVersioningitError
- Support Python 3.13
- Bugfix: Don't crash when
log.showSignatureis set in.gitconfig
- Drop support for Python 3.7
- Bugfix: When using
versioningitwith Hatch, don't run theonbuildstep for editable builds
- Correctly mark a certain test as requiring Mercurial
- When
git describefails to retrieve a tag, the resulting log/error message now includes all options passed to the command (based on contribution by @jenshnielsen) - When
hg logfails to retrieve a tag, the resulting log/error message now includes the tag pattern passed tolatesttag(), if any
- Migrated from setuptools to hatch
- Support using the
onbuildstep with Hatch - Breaking: The
build_dirargument passed toVersioningit.do_onbuild()andonbuildmethod callables has been changed to anOnbuildFileProviderABC
- Always read
.hg_archival.txtfiles using UTF-8 encoding - Added support for using versioningit with Hatch
- Raise a
ConfigErrorif the selectedtool.versioningit.formatfield is not a string - Update tests for pydantic 2.0
- Update tests for Python 3.12
- Support Python 3.12
- The custom setuptools command classes can now be imported directly from the
versioningit.cmdclassmodule as an alternative to callingget_cmdclasses()
- Drop support for Python 3.6
- Support Python 3.11
- Use
tomllibon Python 3.11
- Don't run the
onbuildstep under setuptools' upcoming PEP 660 editable mode (contributed by @abravalheri)
- The
{version}placeholder in the "basic"formatstep has been renamed to{base_version}. The old name remains usable, but is deprecated.- Breaking: The
versionargument passed toVersioningit.do_format()andformatmethod callables has been renamed tobase_version.
- Breaking: The
- A
{version_tuple}field, along with the fields available in theformatstep, is now available for use in templates in thewriteandonbuildsteps.- New step and subtable: "template-fields"
- Breaking: The
versionarguments passed toVersioningit.do_write(),Versioningit.do_onbuild(),run_onbuild(), andwrite&onbuildmethod callables have been replaced withtemplate_fieldsarguments - Added a
get_template_fields_from_distribution()function for use by callers ofrun_onbuild()
Versioningit.get_version()now takes optionalwriteandfallbackarguments- The
onbuildstep is no longer run when building from an sdist; the configuration therefore no longer needs to be idempotent - Drop setuptools runtime dependency
- setuptools is only needed for
get_cmdclasses(), which should only be called in an environment where setuptools is already installed.
- setuptools is only needed for
- Prevent log messages from being printed twice under recent versions of setuptools
- Values supplied for the
require-matchparameters of thetag2versionandonbuildsteps must now actually be booleans; previously, values of any type were accepted and were converted to booleans. - Added a
Versioningit.run()method that returns a structure containing all intermediate & final values - "git" method:
{author_date}and{committer_date}are no longer "clamped" to less than or equal to{build_date}. This undocumented behavior was based on a misinterpretation of theSOURCE_DATE_EPOCHspec, and was even applied whenSOURCE_DATE_EPOCHwas not set. - When resolving entry points, if multiple entry points with the given group & name are found, error instead of using the first one returned
- Backport "Don't run the
onbuildstep under setuptools' upcoming PEP 660 editable mode" from v2.0.1 (contributed by @abravalheri)
- Do not import setuptools unless needed (contributed by @jenshnielsen)
- Added custom setuptools commands for inserting the project version into a
source file at build time
- New step and subtable: "onbuild"
- New public
get_cmdclasses()andrun_onbuild()functions
- Moved documentation from the README to a Read the Docs site
- Established external documentation for the public library API
- When falling back to using
tool.versioningit.default-version, emit a warning if the version is not PEP 440-compliant. - The
versioningitcommand now honors theVERSIONINGIT_LOG_LEVELenvironment variable
- Changes to custom methods:
- The signatures of the method functions have changed; user-supplied
parameters are now passed as a single
params: Dict[str, Any]argument instead of as keyword arguments. - User-supplied parameters with the same names as step-specific method arguments are no longer discarded.
- The signatures of the method functions have changed; user-supplied
parameters are now passed as a single
- Changes to the "git-archive" method:
- Lightweight tags are now ignored (by default, but see below) when
installing from a repository in order to match the behavior of the
%(describe)format placeholder. - The "match" and "exclude" settings are now parsed from the
describe-substparameter, which is now required, and the oldmatchandexcludeparameters are now ignored. - Git 2.35's "tags" option for honoring lightweight tags is now recognized.
- Added a dedicated error message when an invalid
%(describe)placeholder is "expanded" into itself in an archive
- Lightweight tags are now ignored (by default, but see below) when
installing from a repository in order to match the behavior of the
- The
fileparameter to the "basic" write method is now required when the[tool.versioningit.write]table is present. If you don't want to write the version to a file, omit the table entirely. - Library API:
Configis no longer exported; it should now be considered private.- Merged
Versioningit.from_config()functionality intoVersioningit.from_project_dir() - Renamed
Versioningit.from_config_obj()toVersioningit.from_config(); it should now be considered private
- Git 1.8.0 is now the minimum required version for the git methods, and this is documented. (Previously, the undocumented minimum version was Git 1.8.5.)
- Document the minimum supported Mercurial version as 5.2.
- Call
importlib.metadata.entry_points()only once and reuse the result for a speedup (contributed by @jenshnielsen)
- Support Python 3.10
- Support tomli 2.0
- Gave the CLI interface an
-n/--next-versionoption for showing a project's next release version - Added a
get_next_version()function - Added a mention to the README of the existence of exported functionality
other than
get_version() - Renamed the individual step-calling methods of
Versioningitto have names of the formdo_$STEP()
- Update for tomli 1.2.0
- The log messages displayed for unknown parameters are now at WARNING level instead of INFO and include suggestions for what you might have meant
- "git"
vcsmethod:default-tagwill now be honored if thegit describecommand fails (which generally only happens in a repository without any commits) - Added an experimental "git-archive" method for determining a version when installing from a Git archive
- Project directories under
.git/are no longer considered to be under version control - Project directories inside Git working directories that are not themselves tracked by Git are no longer considered to be under version control
- Support added for installing from Mercurial repositories & archives
- Add more logging messages
- Changed default version formats to something that doesn't use
{next_version} - "basic"
tag2versionmethod:- If
regexis given and it does not contain a group named "version," the entire text matched by the regex will be used as the version - Added a
require-matchparameter for erroring if the regex does not match
- If
- "basic"
writemethod:encodingnow defaults to UTF-8 - New
next-versionmethods:"minor-release","smallest-release", and"null" - Replaced
entrypointsdependency withimportlib-metadata - Added
tool.versioningit.default-versionfor setting the version to use if an error occurs - When building a project from a shallow clone or in a non-sdist directory without VCS information, display an informative error message.
Alpha release