python-semantic-release should have an option to pull version_variable from git tag
See original GitHub issuepython-semantic-release should have an option to pull version_variable from git tag
python-semantic-release requires version_variable to be in a file and bumps and auto-commits it.
For parity with semantic-release per https://semantic-release.gitbook.io/semantic-release/support/faq#why-is-the-package-jsons-version-not-updated-in-my-repository semantic release updates package.json then prepares and publishes the package and doesn’t auto-commit the version change.
This is desirable for CI so that auto-commits don’t require troublesome exceptions to prevent an infinite loop of version bumps.
If we don’t push the commit to the version_variable subsequent runs report the following error
Creating new version..
Current version: 0.0.0
Cmd('git') failed due to: exit code(128)
cmdline: git tag -m v0.0.1 -a v0.0.1
stderr: 'fatal: tag 'v0.0.1' already exists'
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
python-semantic-release should have an option to ... - GitHub
python -semantic-release should have an option to pull version_variable from git tag. python-semantic-release requires version_variable to be ...
Read more >Configuration — python-semantic-release 7.32.2 documentation
If set to tag , will get the current version from the latest tag matching vX.Y.Z . This won't change the source defined...
Read more >Semantic release with Python, Poetry & GitHub Actions
To manage this automatic versioning, the obvious choice is semantic versioning/semantic release which automatically increments a version ...
Read more >Configuration - Semantic Release - GitBook
The Git tag format used by semantic-release to identify releases. The tag name is generated with Lodash template and will be compiled with...
Read more >Avoid having version number in source code - Packaging
I like to release often. The downside: Many changes in the git repo are changes to the version number. How could I avoid...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Renamed
commit_changes
tocommit_version_number
See https://github.com/relekang/python-semantic-release/pull/143#pullrequestreview-283235383
Ok, I’m going to do the following :
version_source
iscommit
, will get version fromversion_variable
file and edit the file with the new version. If variablecommit_changes
is defined andFalse
, won’t commit. If it is undefined orTrue
, will commit and push changes.version_source
istag
, will get version from VCS and will edit the file defined inversion_variable
. If the file doesn’t exist, will fail silently (backwards compatibility). If variablecommit_changes
is defined andTrue
, will commit and push changes. If it is undefined orFalse
, won’t push.I intend to do that by setting the actual value of
commit_changes
as :This way, we will have a full backward compatibility with the current behavior, while giving people the choice to do differently. This can be discussed when I submit the PR.