<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Configuration on bumpversion</title><link>https://romnn.github.io/bumpversion/docs/configuration/</link><description>Recent content in Configuration on bumpversion</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://romnn.github.io/bumpversion/docs/configuration/index.xml" rel="self" type="application/rss+xml"/><item><title>Config file formats</title><link>https://romnn.github.io/bumpversion/docs/configuration/formats/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/bumpversion/docs/configuration/formats/</guid><description>&lt;h1 id="config-file-formats"&gt;Config file formats&lt;a class="anchor" href="#config-file-formats"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;bumpversion&lt;/code&gt; looks for its configuration in the directory it runs in — the current directory, or the one given by &lt;code&gt;--dir&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="discovery-order"&gt;Discovery order&lt;a class="anchor" href="#discovery-order"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Four filenames are tried, in this order:&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;#&lt;/th&gt;
					&lt;th&gt;File&lt;/th&gt;
					&lt;th&gt;Section&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;1&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;.bumpversion.toml&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;[tool.bumpversion]&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;2&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;.bumpversion.cfg&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;[bumpversion]&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;3&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;pyproject.toml&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;[tool.bumpversion]&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;4&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;setup.cfg&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;[bumpversion]&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The &lt;strong&gt;first file that contains a usable section wins&lt;/strong&gt;, and only that file is used — configuration is never merged across files. A &lt;code&gt;pyproject.toml&lt;/code&gt; with no &lt;code&gt;[tool.bumpversion]&lt;/code&gt; table (or with an empty one) is skipped as though it were not there, so the search continues to &lt;code&gt;setup.cfg&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Files to rewrite</title><link>https://romnn.github.io/bumpversion/docs/configuration/files/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/bumpversion/docs/configuration/files/</guid><description>&lt;h1 id="files-to-rewrite"&gt;Files to rewrite&lt;a class="anchor" href="#files-to-rewrite"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Each &lt;code&gt;[[tool.bumpversion.files]]&lt;/code&gt; entry describes one place the version appears. An entry must name exactly one target — either a &lt;code&gt;filename&lt;/code&gt; or a &lt;code&gt;glob&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="nx"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bumpversion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;filename&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Cargo.toml&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[[&lt;/span&gt;&lt;span class="nx"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bumpversion&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;files&lt;/span&gt;&lt;span class="p"&gt;]]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;glob&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;packages/*/package.json&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Naming both, or neither, is a configuration error.&lt;/p&gt;
&lt;p&gt;The config file itself is always rewritten and always committed — you never list it.&lt;/p&gt;
&lt;h2 id="what-gets-replaced"&gt;What gets replaced&lt;a class="anchor" href="#what-gets-replaced"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Every entry has a &lt;code&gt;search&lt;/code&gt; template and a &lt;code&gt;replace&lt;/code&gt; template. They default to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;search&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{current_version}&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;replace&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;{new_version}&amp;#34;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So by default, every occurrence of the current version string in the file becomes the new one. In &lt;code&gt;README.md&lt;/code&gt; that rewrites both the heading and the install line, which is usually what you want:&lt;/p&gt;</description></item><item><title>Version scheme</title><link>https://romnn.github.io/bumpversion/docs/configuration/versioning/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/bumpversion/docs/configuration/versioning/</guid><description>&lt;h1 id="version-scheme"&gt;Version scheme&lt;a class="anchor" href="#version-scheme"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Two keys define what a version is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;parse&lt;/code&gt;&lt;/strong&gt; — a regex whose &lt;strong&gt;named capture groups become the version components&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;code&gt;serialize&lt;/code&gt;&lt;/strong&gt; — one or more patterns that turn components back into a string.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The defaults describe SemVer:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;parse&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;(?P&amp;lt;major&amp;gt;\d+)\.(?P&amp;lt;minor&amp;gt;\d+)\.(?P&amp;lt;patch&amp;gt;\d+)&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;serialize&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;{major}.{minor}.{patch}&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Because &lt;code&gt;parse&lt;/code&gt; defines the components, changing it changes what you can bump. There is no fixed list of component names — &lt;code&gt;bumpversion release&lt;/code&gt; works as soon as &lt;code&gt;parse&lt;/code&gt; has a group called &lt;code&gt;release&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Commits and tags</title><link>https://romnn.github.io/bumpversion/docs/configuration/vcs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/bumpversion/docs/configuration/vcs/</guid><description>&lt;h1 id="commits-and-tags"&gt;Commits and tags&lt;a class="anchor" href="#commits-and-tags"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;&lt;code&gt;bumpversion&lt;/code&gt; can finish a bump by committing the rewritten files and tagging the commit. Both are &lt;strong&gt;off by default&lt;/strong&gt; — a bare &lt;code&gt;bumpversion patch&lt;/code&gt; only edits files.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;bumpversion&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;commit&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;tag&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;On the command line, &lt;code&gt;--commit&lt;/code&gt; / &lt;code&gt;--no-commit&lt;/code&gt; and &lt;code&gt;--tag&lt;/code&gt; / &lt;code&gt;--no-tag&lt;/code&gt; override the config for one run.&lt;/p&gt;
&lt;h2 id="the-dirty-tree-check"&gt;The dirty-tree check&lt;a class="anchor" href="#the-dirty-tree-check"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;Before doing anything, &lt;code&gt;bumpversion&lt;/code&gt; refuses to run if the working tree has uncommitted changes:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Error:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; 0: Working directory is not clean:&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is deliberate: a release commit should contain the version bump and nothing else. Set &lt;code&gt;allow_dirty = true&lt;/code&gt;, or pass &lt;code&gt;--allow-dirty&lt;/code&gt;, when you genuinely want to bundle other staged work into the release commit.&lt;/p&gt;</description></item><item><title>Hooks</title><link>https://romnn.github.io/bumpversion/docs/configuration/hooks/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/bumpversion/docs/configuration/hooks/</guid><description>&lt;h1 id="hooks"&gt;Hooks&lt;a class="anchor" href="#hooks"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Hooks run shell commands at three points in a bump. Each is a list of command strings:&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Key&lt;/th&gt;
					&lt;th&gt;Runs&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;setup_hooks&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Before anything is read or written&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;pre_commit_hooks&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;After the files are rewritten, before &lt;code&gt;git add&lt;/code&gt; and the commit&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;post_commit_hooks&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;After the commit and the tag&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Every hook runs through &lt;code&gt;sh -c&lt;/code&gt; from the repository root, and &lt;strong&gt;a non-zero exit aborts the bump&lt;/strong&gt;. Hooks do not run under &lt;code&gt;--dry-run&lt;/code&gt; — the report shows what would have run:&lt;/p&gt;</description></item><item><title>Key reference</title><link>https://romnn.github.io/bumpversion/docs/configuration/reference/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://romnn.github.io/bumpversion/docs/configuration/reference/</guid><description>&lt;h1 id="key-reference"&gt;Key reference&lt;a class="anchor" href="#key-reference"&gt;#&lt;/a&gt;&lt;/h1&gt;
&lt;p&gt;Every configuration key, with its type and default. Key names are written as they appear in a TOML file; the INI spelling is identical, only the section layout differs — see &lt;a href="https://romnn.github.io/bumpversion/docs/configuration/formats/#ini"&gt;Config file formats&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="global-keys"&gt;Global keys&lt;a class="anchor" href="#global-keys"&gt;#&lt;/a&gt;&lt;/h2&gt;
&lt;p&gt;These live in &lt;code&gt;[tool.bumpversion]&lt;/code&gt; (TOML) or &lt;code&gt;[bumpversion]&lt;/code&gt; (INI).&lt;/p&gt;
&lt;h3 id="version"&gt;Version&lt;a class="anchor" href="#version"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Key&lt;/th&gt;
					&lt;th&gt;Type&lt;/th&gt;
					&lt;th&gt;Default&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;current_version&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;string&lt;/td&gt;
					&lt;td&gt;— (required in practice)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;parse&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;regex&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;(?P&amp;lt;major&amp;gt;\d+)\.(?P&amp;lt;minor&amp;gt;\d+)\.(?P&amp;lt;patch&amp;gt;\d+)&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;serialize&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;string or list&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;[&amp;quot;{major}.{minor}.{patch}&amp;quot;]&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="search-and-replace"&gt;Search and replace&lt;a class="anchor" href="#search-and-replace"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Key&lt;/th&gt;
					&lt;th&gt;Type&lt;/th&gt;
					&lt;th&gt;Default&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;search&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;template&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;{current_version}&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;replace&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;template&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;{new_version}&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;regex&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;bool&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;ignore_missing_files&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;bool&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;ignore_missing_version&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;bool&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;no_configured_files&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;bool&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="paths"&gt;Paths&lt;a class="anchor" href="#paths"&gt;#&lt;/a&gt;&lt;/h3&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Key&lt;/th&gt;
					&lt;th&gt;Type&lt;/th&gt;
					&lt;th&gt;Default&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;included_paths&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;list of paths&lt;/td&gt;
					&lt;td&gt;—&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;excluded_paths&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;list of paths&lt;/td&gt;
					&lt;td&gt;—&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;additional_files&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;list of paths&lt;/td&gt;
					&lt;td&gt;—&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;included_paths&lt;/code&gt; is a union, not a filter: it can add a path that no &lt;code&gt;[[files]]&lt;/code&gt; entry produced.&lt;/p&gt;</description></item></channel></rss>