Description
The problem
Items in version-variables
seem not to be updated when using version_toml
in pyproject.toml, it seems to work in this projects repo though, as can be observed at your most recent release commit.
Expected behavior
When specifying both version_toml
and version_variables
in tool.semantic_release
section in pyproject.toml I expect both files to be updated.
Environment
Please state which OS you are using and provide the output of the following commands:
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>python --version
Python 3.10.5
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>pip --version
pip 24.0 from C:\Users\jonathan.martens\Code\duplicate-code-detection-tool\venv\lib\site-packages\pip (python 3.10)
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>semantic-release --version
semantic-release, version 9.8.0
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>pip freeze
annotated-types==0.7.0
astor==0.8.1
attrs==23.1.0
Automat==22.10.0
black==24.4.2
build==1.0.3
CacheControl==0.14.0
cachetools==5.3.3
certifi==2024.2.2
cffi==1.16.0
cfgv==3.4.0
chardet==5.2.0
charset-normalizer==3.3.2
cleo==2.1.0
click==8.1.7
click-option-group==0.5.6
colorama==0.4.6
constantly==15.1.0
coverage==7.5.2
crashtest==0.4.1
darker==2.1.1
darkgraylib==1.2.1
dateparser==1.1.8
distlib==0.3.8
dotty-dict==1.3.1
dulwich==0.21.5
duplicate-code-detection-tool==1.1.0.post18+git.a52fa671
exceptiongroup==1.2.1
fastjsonschema==2.19.0
filelock==3.14.0
gensim==4.3.1
gitdb==4.0.11
GitPython==3.1.43
graylint==1.1.1
hl7==0.4.5
html5lib==1.1
hyperlink==21.0.0
identify==2.5.36
idna==3.7
importlib_metadata==7.1.0
importlib_resources==6.4.0
incremental==22.10.0
iniconfig==2.0.0
installer==0.7.0
jaraco.classes==3.4.0
Jinja2==3.1.4
joblib==1.3.2
jsonschema==4.20.0
jsonschema-specifications==2023.11.1
keyring==24.3.1
lockfile==0.12.2
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mdurl==0.1.2
more-itertools==10.2.0
msgpack==1.0.5
mypy==1.10.0
mypy-extensions==1.0.0
nltk==3.8.1
nodeenv==1.8.0
numpy==1.25.2
packaging==24.0
pandas==2.1.3
pathspec==0.12.1
persist-queue==0.8.1
pexpect==4.8.0
pip-system-certs==4.0
pkginfo==1.10.0
platformdirs==4.2.2
pluggy==1.5.0
poetry==1.8.3
poetry-core==1.9.0
poetry-plugin-export==1.6.0
poetry-plugin-up==0.7.1
pre-commit==3.5.0
ptyprocess==0.7.0
py==1.11.0
pycparser==2.22
pydantic==2.7.1
pydantic_core==2.18.2
pygit2==1.13.3
Pygments==2.18.0
pyodbc==4.0.39
pyproject-api==1.6.1
pyproject_hooks==1.0.0
pytest==7.4.4
pytest-cov==5.0.0
python-dateutil==2.8.2
python-gitlab==4.6.0
python-json-logger==2.0.7
python-semantic-release==9.8.0
pytz==2023.3
pywin32==306
pywin32-ctypes==0.2.2
PyYAML==6.0.1
rapidfuzz==3.5.2
-e git+ssh://git@bitbucket.org/maastro/raystation-script-runner.git@fdca4c490626564da65df18693c56f1ef7000ba3#egg=raystation_script_runner
referencing==0.31.0
regex==2023.6.3
requests==2.32.2
requests-toolbelt==1.0.0
rich==13.7.1
rpds-py==0.13.1
scipy==1.11.2
shellingham==1.5.4
six==1.16.0
smart-open==6.3.0
smmap==5.0.1
splunk-handler==3.0.0
toml==0.10.2
tomli==2.0.1
tomlkit==0.12.5
tox==4.15.0
trove-classifiers==2023.5.24
Twisted==22.10.0
twisted-iocpsupport==1.0.3
txHL7==0.5.0
typing_extensions==4.12.0
tzdata==2023.3
tzlocal==5.0.1
urllib3==2.2.1
virtualenv==20.26.2
webencodings==0.5.1
wrapt==1.16.0
zipp==3.19.0
zope.interface==6.0
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>
I am using poetry to build the package, but even when I am running semantic-release version --no-commit --no-push --no-tag
the version number is only updated in pyproject.toml:
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>git status
On branch main
Your branch is up to date with 'origin/main'.
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: pyproject.toml
Untracked files:
(use "git add <file>..." to include in what will be committed)
CHANGELOG.md
no changes added to commit (use "git add" and/or "git commit -a")
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>git diff pyproject.toml
diff --git a/pyproject.toml b/pyproject.toml
index a7834d9..c253e80 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "poetry-minimal-example"
-version = ""
+version = "0.0.0"
description = "Poetry minimal example"
authors = ["Any Body <no-reply@example.com>"]
:...skipping...
diff --git a/pyproject.toml b/pyproject.toml
index a7834d9..c253e80 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[tool.poetry]
name = "poetry-minimal-example"
-version = ""
+version = "0.0.0"
description = "Poetry minimal example"
authors = ["Any Body <no-reply@example.com>"]
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>
Configuration
I have created a minimal example to reproduce this with at https://github.com/jmartens/poetry-minimal-example
Logs
Please provide debug logs for the command you are using with the -vv
flag, e.g.
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>semantic-release -vv version --no-commit --no-push --no-tag
[16:25:42] DEBUG [semantic_release.cli.commands.main] DEBUG main.main: logging level set to: DEBUG main.py:93
DEBUG [semantic_release.cli.commands.main] DEBUG main.main: global cli options: main.py:105
GlobalCommandLineOptions(noop=False, verbosity=2, config_file='pyproject.toml',
strict=False)
INFO [semantic_release.cli.util] INFO util.load_raw_config_file: Loading configuration util.py:79
from pyproject.toml
DEBUG [semantic_release.cli.util] DEBUG util.load_raw_config_file: Trying to parse util.py:82
configuration pyproject.toml in TOML format
INFO [semantic_release.cli.config] INFO config.select_branch_options: Using group config.py:383
'main' options, as '(main|master)' matches 'main'
DEBUG [semantic_release.cli.config] DEBUG config.from_raw_config: hvcs token is not config.py:520
set
WARNING [semantic_release.cli.config] WARNING config.from_raw_config: Token value is config.py:523
missing!
DEBUG [semantic_release.changelog.template] DEBUG template.environment: template.py:57
{'template_dir': 'templates', 'block_start_string': '{%', 'block_end_string':
'%}', 'variable_start_string': '{{', 'variable_end_string': '}}',
'comment_start_string': '{#', 'comment_end_string': '#}',
'line_statement_prefix': None, 'line_comment_prefix': None, 'trim_blocks':
False, 'lstrip_blocks': False, 'newline_sequence': '\n',
'keep_trailing_newline': False, 'extensions': (), 'autoescape': True,
'autoescape_value': True}
DEBUG [semantic_release.version.translator] DEBUG translator.py:40
translator._invert_tag_format_to_re: inverted tag_format 'v{version}' to
'v(?P<version>.*)'
DEBUG [semantic_release.cli.commands.version] DEBUG version.is_forced_prerelease: version.py:55
is_forced_prerelease: as_prerelease = False, forced_level_bump = None,
prerelease = False
INFO [semantic_release.cli.commands.version] INFO version.version: No vcs release version.py:352
will be created because pushing changes is disabled
INFO [semantic_release.version.algorithm] INFO algorithm.tags_and_versions: found algorithm.py:58
0 previous tags
INFO [semantic_release.version.algorithm] INFO algorithm.next_version: Found 0 algorithm.py:282
full releases (excluding prereleases)
DEBUG [semantic_release.version.version] DEBUG version.parse: attempting to parse version.py:119
string '0.0.0' as Version
DEBUG [semantic_release.version.version] DEBUG version.parse: version string 0.0.0 version.py:143
parsed as a non-prerelease
DEBUG [semantic_release.version.version] DEBUG version.parse: parsed build metadata version.py:146
'' from version string 0.0.0
INFO [semantic_release.version.algorithm] INFO algorithm.next_version: No full algorithm.py:324
releases have been made yet, the default version to use is 0.0.0
DEBUG [git.cmd] DEBUG cmd.execute: Popen(['git', 'merge-base', 'main', 'main'], cmd.py:1253
cwd=C:\Users\jonathan.martens\Code\poetry-minimal-example, stdin=None,
shell=False, universal_newlines=False)
DEBUG [git.cmd] DEBUG cmd.execute: Popen(['git', 'cat-file', '--batch-check'], cmd.py:1253
cwd=C:\Users\jonathan.martens\Code\poetry-minimal-example, stdin=<valid stream>,
shell=False, universal_newlines=False)
DEBUG [semantic_release.version.algorithm] DEBUG algorithm.bfs: checking if algorithm.py:101
commit 338397cc3927b9246ba5335384f8bf74d923e865 matches any tags
DEBUG [semantic_release.version.algorithm] DEBUG algorithm.bfs: commit algorithm.py:113
338397cc3927b9246ba5335384f8bf74d923e865 doesn't match any tags
DEBUG [git.cmd] DEBUG cmd.execute: Popen(['git', 'cat-file', '--batch'], cmd.py:1253
cwd=C:\Users\jonathan.martens\Code\poetry-minimal-example, stdin=<valid stream>,
shell=False, universal_newlines=False)
INFO [semantic_release.version.algorithm] INFO algorithm.py:131
algorithm._bfs_for_latest_version_in_history: no version tags found in this
branch's history
INFO [semantic_release.version.algorithm] INFO algorithm.next_version: The last algorithm.py:358
full version in this branch's history was None
DEBUG [git.cmd] DEBUG cmd.execute: Popen(['git', 'rev-list', cmd.py:1253
'338397cc3927b9246ba5335384f8bf74d923e865', '--'],
cwd=C:\Users\jonathan.martens\Code\poetry-minimal-example, stdin=None,
shell=False, universal_newlines=False)
DEBUG [semantic_release.commit_parser.angular] DEBUG angular._logged_parse_error: angular.py:26
Unable to parse commit message: Initial commit
DEBUG [semantic_release.version.algorithm] DEBUG algorithm.next_version: checking algorithm.py:407
if commit 338397cc3927b9246ba5335384f8bf74d923e865 matches any tags
DEBUG [semantic_release.version.algorithm] DEBUG algorithm.next_version: no tags algorithm.py:413
correspond to commit 338397cc3927b9246ba5335384f8bf74d923e865
DEBUG [semantic_release.version.algorithm] DEBUG algorithm.next_version: parsed algorithm.py:427
the following distinct levels from the commits since the last release:
set()
INFO [semantic_release.version.algorithm] INFO algorithm.next_version: The type algorithm.py:433
of the next release release is: no_release
INFO [semantic_release.version.algorithm] INFO algorithm.next_version: No algorithm.py:436
release will be made
0.0.0
INFO [semantic_release.version.algorithm] INFO algorithm.tags_and_versions: found algorithm.py:58
0 previous tags
The next version is: 0.0.0! 🚀
INFO [semantic_release.version.algorithm] INFO algorithm.tags_and_versions: found algorithm.py:58
0 previous tags
DEBUG [git.cmd] DEBUG cmd.execute: Popen(['git', 'rev-list', cmd.py:1253
'338397cc3927b9246ba5335384f8bf74d923e865', '--'],
cwd=C:\Users\jonathan.martens\Code\poetry-minimal-example, stdin=None,
shell=False, universal_newlines=False)
[16:25:43] DEBUG [semantic_release.commit_parser.angular] DEBUG angular._logged_parse_error: angular.py:26
Unable to parse commit message: Initial commit
DEBUG [semantic_release.changelog.release_history] DEBUG release_history.py:65
release_history.from_git_history: commit has type unknown
DEBUG [semantic_release.changelog.release_history] DEBUG release_history.py:116
release_history.from_git_history: adding commit
338397cc3927b9246ba5335384f8bf74d923e865 to unreleased commits
DEBUG [semantic_release.helpers] DEBUG helpers.parse_git_url: Parsing git url helpers.py:112
'git@github.com:jmartens/poetry-minimal-example.git'
INFO [semantic_release.cli.commands.version] INFO version.version: Path version.py:475
'C:\\Users\\jonathan.martens\\Code\\poetry-minimal-example\\templates' not
found, using default changelog template
DEBUG [semantic_release.cli.commands.version] DEBUG version.py:130
version.apply_version_to_source_files: writing version 0.0.0 to source paths
['pyproject.toml', 'src\\example\\__init__.py']
DEBUG [semantic_release.version.declaration] DEBUG declaration.content: No declaration.py:37
content stored, reading from source file
C:\Users\jonathan.martens\Code\poetry-minimal-example\pyproject.toml
INFO [semantic_release.version.declaration] INFO declaration.replace: found declaration.py:121
'tool.poetry.version' in source file contents, replacing with 0.0.0
DEBUG [semantic_release.version.declaration] DEBUG declaration.content: No declaration.py:37
content stored, reading from source file
C:\Users\jonathan.martens\Code\poetry-minimal-example\src\example\__init__
.py
DEBUG [semantic_release.version.declaration] DEBUG declaration.replace: declaration.py:197
path='src\\example\\__init__.py'
pattern='(?x)__version__\\s*(:=|[:=])\\s*(?P<quote>[\'\\"])(?P<version>\n
(?P<major>0|[1-9]\\d*)\n \\.\n (?P<minor>0|[1-9]\\d*)\n \\.\n
(?P<patch>0|[1-9]\\d*)\n
(?:-(?P<prerelease>(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[
1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?\n
(?:\\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?\n
)(?P=quote)' num_matches=0
No build command specified, skipping
DEBUG [git.cmd] DEBUG cmd.execute: Popen(['git', 'diff', '-R', cmd.py:1253
'338397cc3927b9246ba5335384f8bf74d923e865', '--cached', '--abbrev=40',
'--full-index', '-M', '--raw', '-z', '--no-color'],
cwd=C:\Users\jonathan.martens\Code\poetry-minimal-example
5DC8
, stdin=None,
shell=False, universal_newlines=False)
INFO [semantic_release.cli.commands.version] INFO version.version: No local version.py:594
changes to add to any commit, skipping
INFO [semantic_release.cli.github_actions_output] INFO github_actions_output.py:71
github_actions_output.write_if_possible: not writing GitHub
Actions output, as no file specified
(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>
Additional context
Using this on a private project but have created a minimal example to reproduce this with as stated earlier at https://github.com/jmartens/poetry-minimal-example