Closed steven-douilliet closed 3 months ago
the
tool.poetry.version
field is not updated and remains at0.0.0
Are you referring to the pyproject.toml inside of the sdist/wheel or the pyproject.toml in your working folder? The plugin temporarily changes the version field in your working folder's pyproject.toml so that it's included in the sdist/wheel, but then reverts it so that you don't accidentally commit it. Could you confirm the content of the sdist/wheel's pyproject.toml?
I'm referring to the pyproject.toml
inside my working folder.
dist/
content:
dist/
├── private-0.1.0-py3-none-any.whl
└── private-0.1.0.tar.gz
0 directories, 2 files
I don't understand why update the __version__
and __version_tuple__
variables but not the tool.poetry.version
field? So we need to manually update the tool.poetry.version
field against the __version__
content?
Just to be clear, if you extract the whl
and tar.gz
files, you'll see that they contain a copy of pyproject.toml where the version field is set to the dynamic version as expected.
This plugin primarily ensures that your build artifacts will contain the dynamic version. The local state in your working folder is (by default) only adjusted temporarily in order to help generate those build artifacts correctly. The changes to __init__.py
are only remaining in place because you've set the persistent-substitution
flag - otherwise, those would be cleaned up as well.
It is possible to leave all changes in the working folder by running poetry dynamic-versioning
, but this is mainly for testing/debugging, not something you'd normally need to use. Could you elaborate on your use case for wanting the changes left in the working folder?
Thank you for your explanation. I understand the purpose of the plugin better.
When I want to release a new version, I want to use the plugin to automatically update the version (in tool.poetry.version
, __version__
and __version_tuple__
) and commit changes on git (before merging on main branch)
Could you elaborate on why you want to commit the changes? I'm wondering if this is an XY problem. What problem do you want to solve by committing the changes, instead of letting the plugin temporarily set the version as needed?
Hello,
When I run the
poetry build
command, thetool.poetry.version
field is not updated and remains at0.0.0
(placeholder). While the source and wheel archives are correctly versioned, as well as__version __
and__version_tuple __
.See below my config: