Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: setting sign_tags=False in config file doesn't work #269

Open
janfrederik opened this issue Jul 1, 2023 · 0 comments · May be fixed by #270
Open

Bug: setting sign_tags=False in config file doesn't work #269

janfrederik opened this issue Jul 1, 2023 · 0 comments · May be fixed by #270

Comments

@janfrederik
Copy link

How to reproduce

.bumpversion.cfg:

[bumpversion]
current_version = 0.0.1
commit = True
tag = True
sign_tags = False

Running bump2version patch gives the following error:

Tagging 'v0.0.2' with message 'Bump version: 0.0.1 → 0.0.2' in Git and signing
error: gpg failed to sign the data
error: unable to sign the tag
Traceback (most recent call last):
  File "/home/janfr/.pyenv/versions/jkx-3.11.4/bin/bump2version", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/janfr/.pyenv/versions/3.11.4/envs/jkx-3.11.4/lib/python3.11/site-packages/bumpversion/cli.py", line 137, in main
    _tag_in_vcs(vcs, context, args)
  File "/home/janfr/.pyenv/versions/3.11.4/envs/jkx-3.11.4/lib/python3.11/site-packages/bumpversion/cli.py", line 731, in _tag_in_vcs
    vcs.tag(sign_tags, tag_name, tag_message)
  File "/home/janfr/.pyenv/versions/3.11.4/envs/jkx-3.11.4/lib/python3.11/site-packages/bumpversion/vcs.py", line 138, in tag
    subprocess.check_output(command)
  File "/home/janfr/.pyenv/versions/3.11.4/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/janfr/.pyenv/versions/3.11.4/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'tag', 'v1.0.0-1', '--sign', '--message', 'Bump version: 0.0.0-0 → 1.0.0-1']' returned non-zero exit status 128.

Root cause

The value for tag_name is not converted to a boolean when parsing the config file.
See line 297 in function def _load_configuration() in cli.py:

    for boolvaluename in ("commit", "tag", "dry_run"):
        try:
            defaults[boolvaluename] = config.getboolean(
                "bumpversion", boolvaluename
            )

The tuple should contain "tag_name" as well.

janfrederik added a commit to janfrederik/bump2version that referenced this issue Jul 1, 2023
janfrederik added a commit to janfrederik/bump2version that referenced this issue Jul 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant