{"id":8703,"library":"tbump","title":"tbump: Bump Software Releases","description":"tbump is a command-line tool designed to simplify the process of bumping software versions. It automates updating version strings in specified files, creating Git commits and tags, and pushing changes to a remote repository. The current version is 6.11.0, and it has an active development cycle with frequent updates and bug fixes.","status":"active","version":"6.11.0","language":"en","source_language":"en","source_url":"https://github.com/dmerejkowsky/tbump","tags":["versioning","release management","git","cli","automation","semantic versioning"],"install":[{"cmd":"pip install tbump","lang":"bash","label":"Install via pip"},{"cmd":"pipx install tbump","lang":"bash","label":"Install via pipx (recommended)"}],"dependencies":[{"reason":"Command-line interface toolkit","package":"click"},{"reason":"Provides interactive command-line user interface elements","package":"cli-ui"},{"reason":"TOML configuration file parsing","package":"toml"}],"imports":[],"quickstart":{"code":"import os\n\n# Create a dummy project structure for demonstration\nos.makedirs('my_project', exist_ok=True)\nwith open('my_project/pyproject.toml', 'w') as f:\n    f.write('current = \"1.2.3\"\\n')\n    f.write('[tool.poetry]\\n')\n    f.write('name = \"my_project\"\\n')\n    f.write('version = \"1.2.3\"\\n')\n\nwith open('my_project/src/__init__.py', 'w') as f:\n    f.write('__version__ = \"1.2.3\"\\n')\n\n# --- tbump configuration (tbump.toml in the project root) ---\nconfig_content = '''\n[version]\ncurrent = \"1.2.3\"\nregex = \"\"\"(?P<major>\\d+)\\\\.(?P<minor>\\d+)\\\\.(?P<patch>\\d+)\"\"\"\n\n[git]\nmessage_template = \"Bump to {new_version}\"\ntag_template = \"v{new_version}\"\n\n[[file]]\nsrc = \"pyproject.toml\"\nsearch = 'version = \"{current_version}\"'\n\n[[file]]\nsrc = \"src/__init__.py\"\nsearch = '__version__ = \"{current_version}\"'\n'''\n\nwith open('my_project/tbump.toml', 'w') as f:\n    f.write(config_content)\n\nprint(\"Project setup in 'my_project/' with tbump.toml\")\nprint(\"To bump the version, navigate to 'my_project/' and run:\")\nprint(\"  git init\")\nprint(\"  git add .\")\nprint(\"  git commit -m \\\"Initial commit\\\"\")\nprint(\"  tbump 1.2.4\") # This will perform the bump and Git operations\n","lang":"python","description":"To use tbump, you typically create a `tbump.toml` configuration file in your project's root directory, or embed the configuration in `pyproject.toml` under the `[tool.tbump]` section. This configuration specifies the current version, a regex to match it, Git commit/tag templates, and the files where the version string should be updated. After configuration, run `tbump <new_version>` from your project's root."},"warnings":[{"fix":"Add a `[[tool.tbump.file]]` section to your `pyproject.toml` (or `tbump.toml`) explicitly targeting the Poetry version key: `[[tool.tbump.file]] src = \"pyproject.toml\" search = 'version = \"{current_version}\"'`","message":"As of v6.4.0, if using `tbump` with `pyproject.toml` for a Poetry project, the `version` key in `[tool.poetry]` is no longer implicitly bumped. You must explicitly configure it in `tbump.toml` or `[tool.tbump]` to be included in the version bump process.","severity":"breaking","affected_versions":">=6.4.0"},{"fix":"Set `atomic_push = false` in the `[git]` section of your `tbump.toml` to revert to separate branch and tag pushes.","message":"tbump defaults to using `git push --atomic`, which may not be supported by all Git versions or hosting providers. If you encounter push errors, this is a likely cause.","severity":"gotcha","affected_versions":">=6.5.0"},{"fix":"Upgrade your Python environment to Python 3.7 or newer.","message":"Support for Python 3.6 was dropped in version 6.7.0. Users on older Python versions will need to upgrade their Python environment to use newer tbump releases.","severity":"breaking","affected_versions":">=6.7.0"},{"fix":"Carefully test your `regex` and `search` patterns. Use named groups in your `regex` (e.g., `(?P<major>\\d+)`) and ensure `current_version` is correctly templated in `search` strings. Run `tbump --dry-run <new_version>` to preview changes.","message":"The regular expression defined in `[version].regex` and the `search` patterns in `[[file]]` sections are critical and can be complex. Incorrect regex or search strings can lead to `tbump` failing to find or replace the version.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Use the `--non-interactive` flag when running `tbump` in automated environments, e.g., `tbump --non-interactive <new_version>`.","message":"By default, `tbump` is interactive and prompts for confirmation before performing Git actions. This can halt automation in CI/CD pipelines.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure correct TOML syntax. For Poetry projects, add an explicit `[[tool.tbump.file]]` entry for `pyproject.toml` similar to: `[[tool.tbump.file]] src = \"pyproject.toml\" search = 'version = \"{current_version}\"'`.","cause":"The `pyproject.toml` configuration for `tbump` is malformed, or the specific `[[tool.tbump.file]]` section for Poetry projects (introduced as a breaking change in v6.4.0) is missing.","error":"Invalid config: Key 'file' error using pyproject.toml"},{"fix":"In your `tbump.toml` file, add `atomic_push = false` under the `[git]` section to disable atomic pushes and use separate pushes for the branch and tag.","cause":"This error typically indicates that `git push --atomic` failed, most likely because your Git client or remote repository does not support atomic pushes, which became default in tbump 6.5.","error":"error: src refspec refs/tags/vX.Y.Z does not match any error: failed to push some refs to 'origin'"},{"fix":"Verify that `[version].current` matches the actual version in your files, and that the `regex` correctly extracts it. Also, check that the `[[file]].search` pattern exactly matches the line containing the version in the target file, ensuring correct templating with `{current_version}`.","cause":"The `search` string defined in `tbump.toml` for the specified file does not match the actual content of the file, or the `current` version in `tbump.toml` does not match what's in the file according to the `regex`.","error":"tbump: error: No match for current version '1.2.3' in file 'src/my_module/__init__.py'"}]}