- Fixed:
- The
enable
command would fail when the pyproject.toml tables were out of order.
- The
- Added:
-
The plugin now supports Poetry's upcoming PEP-621 functionality. More info here: python-poetry/poetry#3332
If your pyproject.toml defines
tool.poetry.name
, then the plugin will preserve its existing behavior.However, if your pyproject.toml:
- does not define
tool.poetry.name
- defines
project.name
- defines
project.dynamic
to include"version"
- does not define
project.version
...then the plugin will enable its PEP-621 functionality.
Because PEP-621 support is not yet released and finalized in Poetry itself, it is also subject to change in the plugin.
- does not define
-
- Added:
pattern-prefix
option to add a prefix to the version tag pattern.ignore-untracked
option to control the detection of dirty state.from-file
config section to read a version from a file instead of the VCS.POETRY_DYNAMIC_VERSIONING_DEBUG
environment variable for some logging.
- Changed:
- Updated Dunamai to 1.21.0+ for the latest features.
- Added:
initial-content-jinja
option intool.poetry-dynamic-versioning.files
section.
- Fixed:
- Line ending style was not preserved in some cases because of the default behavior of
pathlib.Path.read_text
. To avoid this,pathlib.Path.read_bytes
is used instead now. (Contributed by nardi)
- Line ending style was not preserved in some cases because of the default behavior of
- Fixed:
- Custom substitutions in pyproject.toml weren't cleaned up correctly.
This was because the plugin would record the "original" content of the file
after the
version
andenable
fields had already been changed. Now, substitutions are reverted first before revertingversion
andenable
.
- Custom substitutions in pyproject.toml weren't cleaned up correctly.
This was because the plugin would record the "original" content of the file
after the
- Added:
tool.poetry-dynamic-versioning.files
config section. This allows you to create a file in a default state before applying substitutions to it. You can also leave the substitutions in place when the plugin deactivates.
- Fixed:
- Compatibility with poetry-core 1.7.0, which removed the
poetry.core.semver
module. - The
enable
command now constrains the plugin version to>=1.0.0,<2.0.0
to protect against any potential API changes.
- Compatibility with poetry-core 1.7.0, which removed the
- Fixed:
- Running
poetry dynamic-versioning
followed bypoetry build
would leave the plugin enabled in the sdist's pyproject.toml.
- Running
- Added:
fix-shallow-repository
option to attempt to automatically fix shallow repositories. Currently, this only supports Git and will rungit fetch --unshallow
.
- Changed:
- Updated Dunamai to 1.18.0+ for the latest features.
- Added:
POETRY_DYNAMIC_VERSIONING_COMMANDS_NO_IO
environment variable to prevent the plugin from modifying files during certain commands. The plugin still sets the dynamic version in memory so that Poetry itself can write it as needed.
- Changed:
- During
poetry version
, the plugin still activates, but no longer modifies pyproject.toml.
- During
- Added:
- CLI
enable
subcommand to enable the plugin in pyproject.toml. - Support for
POETRY_DYNAMIC_VERSIONING_OVERRIDE
environment variable. mode
option for substitution to support__version_tuple__
style.
- CLI
- Changed:
- CLI:
poetry dynamic-versioning
now outputs a summary of the changes, the same way thatpoetry-dynamic-versioning
already did.
- CLI:
- Added:
- The plugin will print a warning for shallow Git repositories
(and any other
Concern
s reported by Dunamai in the future). This becomes an error withstrict = true
.
- The plugin will print a warning for shallow Git repositories
(and any other
- Changed:
- Updated Dunamai to 1.17.0+ for the latest features and bug fixes.
- Fixed:
- Compatibility with poetry-core 1.6.0+.
- Changed:
CHANGELOG.md
andtests
are now included in sdists.
- Fixed:
- In the Poetry CLI mode and standalone script mode,
path
dependencies received the same dynamic version as the active project. This issue did not affect the build backend mode.
- In the Poetry CLI mode and standalone script mode,
- Changed:
- Updated Dunamai to 1.16.0+ for the latest features and bug fixes.
- Fixed:
- Resolved a deprecation warning when used with Poetry Core 1.3.0+. (Contributed by edgarrmondragon)
- Fixed:
- Line endings were not necessarily preserved because of the default behavior of
pathlib.Path.write_text
. To avoid this,pathlib.Path.write_bytes
is used instead now.
- Line endings were not necessarily preserved because of the default behavior of
- Fixed:
- Warning for invalid config was printed to stdout instead of stderr.
- Added:
- The plugin now prints a warning if its configuration is invalid. Right now, this just checks for unknown keys.
- A
strict
option to prevent falling back to0.0.0
when there are no tags.
- Changed:
- Updated Dunamai to 1.14.0+ for the latest features.
This adds support for VCS archival files, namely ones produced by
git archive
andhg archive
. Refer to the Dunamai documentation for more info.
- Updated Dunamai to 1.14.0+ for the latest features.
This adds support for VCS archival files, namely ones produced by
- Changed:
- Updated Dunamai to 1.13.2+ for the latest features and bug fixes.
In particular, this fixes an error when parsing Git output with
showSignature = true
configured.
- Updated Dunamai to 1.13.2+ for the latest features and bug fixes.
In particular, this fixes an error when parsing Git output with
- Fixed:
- When using
poetry build
, the plugin did not properly disable itself in the copy of pyproject.toml included in source distributions, causing failures when trying to install them.
- When using
- Added:
- Support for activating the dynamic versioning only for certain Poetry commands
(environment variable:
POETRY_DYNAMIC_VERSIONING_COMMANDS
).
- Support for activating the dynamic versioning only for certain Poetry commands
(environment variable:
- Changed:
- The minimum supported Python version is now 3.7.
- The minimum supported Poetry version is now 1.2.0.
- Import hacks have been eliminated in favor of a PEP 517 build backend wrapper around Poetry Core.
- The two flavors of poetry-dynamic-versioning are now combined into one package
via the optional
plugin
feature.
- Deprecated the name
poetry-dynamic-versioning-plugin
in favor of a newly unifiedpoetry-dynamic-versioning
.
- Fixed:
poetry
did not work correctly when in a folder without a pyproject.toml.poetry plugin show
did not work correctly.
- Fixed:
- CLI mode failed when pyproject.toml did not specify
enable = true
.
- CLI mode failed when pyproject.toml did not specify
- Added:
- Option
tool.poetry-dynamic-versioning.substitution.folders
.
- Option
- Changed:
- Option
tool.poetry-dynamic-versioning.subversion.tag-dir
is nowtool.poetry-dynamic-versioning.tag-dir
.
- Option
- Added:
- Option
tool.poetry-dynamic-versioning.tag-branch
. - Option
tool.poetry-dynamic-versioning.full-commit
.
- Option
- Changed:
-
The Poetry 1.2+ plugin now has a new name,
poetry-dynamic-versioning-plugin
, and this is its first release as a separate package.The import-hack-based pseudo-plugin will continue to be called
poetry-dynamic-versioning
.
-
- Changed:
- Internal improvements/refactoring to unify code base with
poetry-dynamic-versioning-plugin
, which is released as a separate package. These changes should not affect users ofpoetry-dynamic-versioning
.
- Internal improvements/refactoring to unify code base with
- Fixed:
- The plugin can now update versions for dependencies that also use the plugin.
- Fixed:
- The plugin maintained its own copy of the default
pattern
, which meant that it could fall behind the copy in Dunamai and lead to surprising behavior. The plugin now automatically uses the latest default from Dunamai directly when you do not customize it in the plugin settings.
- The plugin maintained its own copy of the default
- Fixed:
- The plugin maintained its own copy of the default
pattern
, which meant that it could fall behind the copy in Dunamai and lead to surprising behavior. The plugin now automatically uses the latest default from Dunamai directly when you do not customize it in the plugin settings.
- The plugin maintained its own copy of the default
- Changed:
- Implemented the official Poetry plugin interface.
- Changed:
- The build backend is now poetry-core. (Contributed by fabaff)
- The default list of
substitution.patterns
now handles__version__
when it has a type annotation. (Draft by da2ce7)
- Added:
- Option to bypass the version control system and set a hard-coded version
in an environment variable called
POETRY_DYNAMIC_VERSIONING_BYPASS
. (Draft by jonringer) branch
,branch_escaped
, andtimestamp
formatting variables.
- Option to bypass the version control system and set a hard-coded version
in an environment variable called
- Fixed an oversight where the default version tag pattern would only find
tags with exactly three parts in the base (e.g.,
v1.0.0
andv1.2.3
). This is now relaxed so thatv1
,v1.2.3.4
, and so on are also recognized.
- Changed:
- Broadened version range of Jinja2 dependency to support projects that need a newer version.
- Bumped the minimum Poetry version to 1.1.0, since the above Jinja2 change seemed to trip up Poetry 1.0.10 (on Python 3.7 and 3.8, but not 3.5 or 3.6, for some reason).
- Fixed:
- The plugin did not work on Fedora inside of Pip's isolated build environment, because the plugin would be loaded before some of its dependencies. Now, those imports are delayed until needed.
- Fixed:
- Parsing files containing special UTF-8 characters would result in an error. Files are now assumed to be UTF-8. (Contributed by rhorenov)
- Fixed:
- The previous
bump
fix only applied toformat-jinja
. It has now been fixed for other scenarios as well.
- The previous
- Fixed:
- When the
bump
option was enabled, the version would be bumped even when on a commit with a version tag. Now, no bumping occurs when on such a commit.
- When the
- Fixed:
- An incompatibility with
tox-poetry-installer
where the working directory was received as astr
instead of aPath
. (Contributed by cburgess)
- An incompatibility with
- Fixed:
-
Previously, when building a source distribution with
poetry build
, the plugin's config section would retain theenable = true
setting, which would then cause an error when installing the artifact since the VCS info would not be available. (This was not an issue for wheels generated bypoetry build
.)The dynamic version from build time is still present in the source distribution, so there is no need for the plugin at install time. Therefore, the plugin now temporarily sets
enable = false
so that that value will be placed in the source distribution, then restores the original setting for development purposes.
-
- Fixed:
- Another possible exception when applying patches if only
poetry-core
was installed and not the Poetry tool, particularly combined with Tox.
- Another possible exception when applying patches if only
- Fixed:
- Possible exception when applying patches if only
poetry-core
was installed and not the Poetry tool.
- Possible exception when applying patches if only
- Added:
tagged-metadata
option, for the corresponding Dunamai feature. (Contributed by mariusvniekerk)
- Added:
bump
option.
- Fixed:
poetry shell
did not clean up after itself.
- Added:
- Support for patching
poetry-core
when used as a standalone build system.
- Support for patching
- Changed:
- Dropped support for
pip wheel .
and bumped the minimum Poetry version to 1.0.2 in order to enable fixing the following issue.
- Dropped support for
- Fixed:
- The main project's dynamic version would be applied to path/Git dependencies. Now, the plugin tracks state and configuration for each dependency separately in order to correctly report their versions.
poetry run
did not always clean up after itself.poetry.semver.version
could not be imported because it was moved topoetry.core.semver.version
starting in Poetry 1.1.0a1. The plugin can now handle either location.
- Fixed a possible issue with string interning in glob handling. (Contributed by mariusvniekerk)
- Fixed an issue with Python 3.5 compatibility. (Contributed by gsemet)
- Increased minimum Dunamai version to propagate the latest updates.
- Fixed an issue where CLI mode did not persist the change to pyproject.toml. This problem was missed because of an issue in the integration tests, which are fixed now as well.
- Added the option
format-jinja-imports
. - Added support for Pip's PEP 517 isolated builds.
- In CLI mode:
- Improved handling of error conditions.
- Added output of the generated version and any modified files.
- Removed handling for Poetry versions prior to 1.0.0.
- Avoid writing files if the content does not need to be changed.
- Added a CLI mode.
- Expose new Dunamai functions via
format-jinja
:bump_version
serialize_pep440
serialize_pvp
serialize_semver
- Added the
format-jinja
option.
- Added the ability to update the version in other files than pyproject.toml.
- Fixed an issue with Poetry 1.0.0b2 and newer where the original version
would not be restored after
poetry run
. (Contributed by lmoretto)
- Fixed #3 where the plugin would revert not only the dynamic version change in pyproject.toml, but also any other changes, such as the addition of new dependencies. (Contributed by lmoretto)
- Updated for Dunamai v1.0.0:
- Added support for Fossil.
- Better error reporting, such as when no tags match the expected pattern.
- Custom formatting:
- Renamed
{post}
to{distance}
- Renamed
{pre_type}
to{stage}
- Renamed
{pre_number}
to{revision}
- Removed
{epoch}
- Removed
{dev}
- Renamed
- Added support for Poetry 1.0.0b2.
- Initial release.