Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Empty version in file mentioned in version_variables is not replaced #941

Open
Labels
confirmedPrevent from becoming stalefeatureA new feature or a feature requestneeds-updateNeeds status update from maintainers
@jmartens

Description

@jmartens

The problem

Items inversion-variables seem not to be updated when usingversion_toml in pyproject.toml, it seems to work in this projects repo though, as can be observed at yourmost recent release commit.

Expected behavior

When specifying bothversion_toml andversion_variables intool.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 --versionPython 3.10.5(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>pip --versionpip 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 --versionsemantic-release, version 9.8.0(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>pip freezeannotated-types==0.7.0astor==0.8.1attrs==23.1.0Automat==22.10.0black==24.4.2build==1.0.3CacheControl==0.14.0cachetools==5.3.3certifi==2024.2.2cffi==1.16.0cfgv==3.4.0chardet==5.2.0charset-normalizer==3.3.2cleo==2.1.0click==8.1.7click-option-group==0.5.6colorama==0.4.6constantly==15.1.0coverage==7.5.2crashtest==0.4.1darker==2.1.1darkgraylib==1.2.1dateparser==1.1.8distlib==0.3.8dotty-dict==1.3.1dulwich==0.21.5duplicate-code-detection-tool==1.1.0.post18+git.a52fa671exceptiongroup==1.2.1fastjsonschema==2.19.0filelock==3.14.0gensim==4.3.1gitdb==4.0.11GitPython==3.1.43graylint==1.1.1hl7==0.4.5html5lib==1.1hyperlink==21.0.0identify==2.5.36idna==3.7importlib_metadata==7.1.0importlib_resources==6.4.0incremental==22.10.0iniconfig==2.0.0installer==0.7.0jaraco.classes==3.4.0Jinja2==3.1.4joblib==1.3.2jsonschema==4.20.0jsonschema-specifications==2023.11.1keyring==24.3.1lockfile==0.12.2markdown-it-py==3.0.0MarkupSafe==2.1.5mdurl==0.1.2more-itertools==10.2.0msgpack==1.0.5mypy==1.10.0mypy-extensions==1.0.0nltk==3.8.1nodeenv==1.8.0numpy==1.25.2packaging==24.0pandas==2.1.3pathspec==0.12.1persist-queue==0.8.1pexpect==4.8.0pip-system-certs==4.0pkginfo==1.10.0platformdirs==4.2.2pluggy==1.5.0poetry==1.8.3poetry-core==1.9.0poetry-plugin-export==1.6.0poetry-plugin-up==0.7.1pre-commit==3.5.0ptyprocess==0.7.0py==1.11.0pycparser==2.22pydantic==2.7.1pydantic_core==2.18.2pygit2==1.13.3Pygments==2.18.0pyodbc==4.0.39pyproject-api==1.6.1pyproject_hooks==1.0.0pytest==7.4.4pytest-cov==5.0.0python-dateutil==2.8.2python-gitlab==4.6.0python-json-logger==2.0.7python-semantic-release==9.8.0pytz==2023.3pywin32==306pywin32-ctypes==0.2.2PyYAML==6.0.1rapidfuzz==3.5.2-e git+ssh://git@bitbucket.org/maastro/raystation-script-runner.git@fdca4c490626564da65df18693c56f1ef7000ba3#egg=raystation_script_runnerreferencing==0.31.0regex==2023.6.3requests==2.32.2requests-toolbelt==1.0.0rich==13.7.1rpds-py==0.13.1scipy==1.11.2shellingham==1.5.4six==1.16.0smart-open==6.3.0smmap==5.0.1splunk-handler==3.0.0toml==0.10.2tomli==2.0.1tomlkit==0.12.5tox==4.15.0trove-classifiers==2023.5.24Twisted==22.10.0twisted-iocpsupport==1.0.3txHL7==0.5.0typing_extensions==4.12.0tzdata==2023.3tzlocal==5.0.1urllib3==2.2.1virtualenv==20.26.2webencodings==0.5.1wrapt==1.16.0zipp==3.19.0zope.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 runningsemantic-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 mainYour 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.tomlUntracked files:  (use "git add <file>..." to include in what will be committed)        CHANGELOG.mdno changes added to commit (use "git add" and/or "git commit -a")(venv) C:\Users\jonathan.martens\Code\poetry-minimal-example>git diff pyproject.tomldiff --git a/pyproject.toml b/pyproject.tomlindex 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.tomlindex 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 athttps://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 levelset 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.tomlin 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:520set                                                                                                    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: checkingif       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'shistory                                                                                       INFO     [semantic_release.version.algorithm] INFO algorithm.next_version: The last  algorithm.py:358                    full versionin 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 made0.0.0           INFO     [semantic_release.version.algorithm] INFO algorithm.tags_and_versions: found algorithm.py:58                    0 previous tagsThe 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=0No 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, 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 athttps://github.com/jmartens/poetry-minimal-example

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedPrevent from becoming stalefeatureA new feature or a feature requestneeds-updateNeeds status update from maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp