diff --git a/.gitignore b/.gitignore index ba5d9455..738e8c0a 100644 --- a/.gitignore +++ b/.gitignore @@ -78,11 +78,6 @@ instance/ # Scrapy stuff: .scrapy -# Sphinx documentation -docs -docsrc/_build/ -docsrc/_autosummary - # PyBuilder .pybuilder/ target/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8c42c8ff..13224da6 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -23,7 +23,11 @@ repos: - id: check-symlinks - id: check-toml - id: check-yaml - exclude: test.* + exclude: | + (?x)^( + test.*| + mkdocs.yml + )$ args: [--allow-multiple-documents] - id: debug-statements - id: end-of-file-fixer diff --git a/CHANGELOG.md b/CHANGELOG.md index 196e2db5..8ed9991b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Fix encoding when reading text. [c03476a](https://github.com/callowayproject/bump-my-version/commit/c03476ac51b94cd136c39bb9c48fee4f1a815b42) Fixes #68 + ### Other - [pre-commit.ci] pre-commit autoupdate. [491b4aa](https://github.com/callowayproject/bump-my-version/commit/491b4aa4edc0241edbf5d77cfcf609c6de56f301) @@ -25,6 +26,7 @@ - Refactored VersionComponentConfig to VersionComponentSpec. [b538308](https://github.com/callowayproject/bump-my-version/commit/b53830826c81446576b3979080b05930d71c34e2) More consistent with VersionSpec + ### New - Added mental model documentation. [5cbd250](https://github.com/callowayproject/bump-my-version/commit/5cbd250ab412f0f56af14a0fcc450cb31643e3e4) @@ -97,6 +99,7 @@ - Refactored the create subcommand. [f529d28](https://github.com/callowayproject/bump-my-version/commit/f529d283fb3a32eddee9daf368f9ce17ba5efcf1) - Also organized the CLI tests + ### New - Added `show-bump` subcommand. [0bbd814](https://github.com/callowayproject/bump-my-version/commit/0bbd81489ea0484962e9b3c207e6c6860cab6c55) @@ -105,6 +108,7 @@ - Added sample-config feature. [3d0f67d](https://github.com/callowayproject/bump-my-version/commit/3d0f67dbf9f42ffad1583e1fe08bd0971262257c) - Initial implementation + ### Updates - Updated documentation. [4f90348](https://github.com/callowayproject/bump-my-version/commit/4f903486338af31557c3647fc0ae00d7cc8e4213) @@ -122,6 +126,7 @@ - Removed dotted-notation from requirements. There is an issue on how dotted-notation sets values in the TOMLkit data structure. - Added `get_nested_value` and `set_nested_value` as replacements for dotted-notation. + ### Other - [pre-commit.ci] pre-commit autoupdate. [ee4d2f3](https://github.com/callowayproject/bump-my-version/commit/ee4d2f32af28c650651b9242c09e3b125e0101e2) @@ -184,6 +189,7 @@ - Fixed regression in config update. [2bbbd74](https://github.com/callowayproject/bump-my-version/commit/2bbbd74fe4b80895b3719692d1fe0023cc388bbb) Fixes #108 + ### New - Added a test case for line-start regexes. [ef4823c](https://github.com/callowayproject/bump-my-version/commit/ef4823c0cdb92660439095aacdbac6801953e4ae) @@ -297,6 +303,7 @@ - Added key_path to FileConfig. [e160b40](https://github.com/callowayproject/bump-my-version/commit/e160b401b0d14cef77255bbd87748721db4e2e3d) - Also made all attributes required except `filename`, `glob`, and `key_path` + ### Other - [pre-commit.ci] auto fixes from pre-commit.com hooks. [8188a42](https://github.com/callowayproject/bump-my-version/commit/8188a42d1e25efab1f45499b448f2c007738cbbe) @@ -343,6 +350,7 @@ - Add -h for help option. [fda71b0](https://github.com/callowayproject/bump-my-version/commit/fda71b0fce4115514fa85cf1d627e5f3673dba66) Fixes #67 + ### Other - Drop Python3.7 as compatible version. [890edc8](https://github.com/callowayproject/bump-my-version/commit/890edc8a0c0911ad3696a9bc0ddca7a9a72c5afd) @@ -373,6 +381,7 @@ - Changed the flags to --regex/--no-regex - updated tests and docs + ## 0.11.0 (2023-09-26) [Compare the full difference.](https://github.com/callowayproject/bump-my-version/compare/0.10.0...0.11.0) @@ -516,6 +525,7 @@ - The `--search` and `--replace` options now completely override any other search and replace logic. Fixes #34 + ### Other - [pre-commit.ci] pre-commit autoupdate. [531738d](https://github.com/callowayproject/bump-my-version/commit/531738d62d3a2583c7831d17151cb8ae7b14677c) @@ -540,6 +550,7 @@ - Declared SourceCodeManager attributes as `ClassVar[List[str]]` - `_TEST_USABLE_COMMAND`, `_COMMIT_COMMAND`, and `_ALL_TAGS_COMMAND` affected + ### New - Added tests for CLI replace command. [a53cddc](https://github.com/callowayproject/bump-my-version/commit/a53cddc3c13bb21f5432d1cd331a51027a25981f) @@ -559,6 +570,7 @@ - `short_branch_name` is the branch name, lower case, containing only a-z and 0-9, and truncated to 20 characters. Fixes #28 + ### Other - Check config before tagging. [3a6e3ee](https://github.com/callowayproject/bump-my-version/commit/3a6e3eebdbc16ae509754fd977625a4c9b19d82a) @@ -586,6 +598,7 @@ - `tomlkit.parse()` returns a `TOMLDocument`. - `unwrap()` converts it into a `dict` + ### New - Adds `branch_name` to SCM information. [173be1a](https://github.com/callowayproject/bump-my-version/commit/173be1a7a107639be912d0fb76149accb54b0332) @@ -602,6 +615,7 @@ - Can output in YAML, JSON, and default - Can specify one or more items to display - Can use dotted-notation to pull items from nested data structures. + ### Updates - Changes bump-my-version into subcommands. [31ffbcf](https://github.com/callowayproject/bump-my-version/commit/31ffbcf839e2491c31d90b51041d1e840371108f) @@ -619,6 +633,7 @@ - Fixes issue #20 - Renders the correct `current_version` for each file being modified. + ### Other - [pre-commit.ci] auto fixes from pre-commit.com hooks. [5476cdf](https://github.com/callowayproject/bump-my-version/commit/5476cdf8b66666e06e9bfd4d71eaf2610103079a) @@ -646,12 +661,14 @@ - Added documentation for replacing strings in different files. [893ec03](https://github.com/callowayproject/bump-my-version/commit/893ec03f6ceaf2a050c31f10006aa63c0411af4e) Fixes #6 + ### Other - Made `VERSION_PART` optional. [f236b7d](https://github.com/callowayproject/bump-my-version/commit/f236b7de94d9f58e493c617848e3eb02e85a24c7) - Fixes #16 - `VERSION_PART` is detected from the arguments based on the configuration + ### Updates - Updated docs indicated VERSION_PART is optional. [22edeac](https://github.com/callowayproject/bump-my-version/commit/22edeac9018e75f79d7167fbfc6ca56cda4d3b07) @@ -673,6 +690,7 @@ - Fixes release.yaml. [01870d5](https://github.com/callowayproject/bump-my-version/commit/01870d5878b5f0a6e601863c4b9c25572db6cbb0) Outputs the notes to a file instead of an environment variable. + ### Other - [pre-commit.ci] auto fixes from pre-commit.com hooks. [266002f](https://github.com/callowayproject/bump-my-version/commit/266002f4d60ed6fe3623ba5f713318dc6220ec00) @@ -708,6 +726,7 @@ - Fixes test package. [7c12072](https://github.com/callowayproject/bump-my-version/commit/7c12072b11938385ec81c5e9cd285d91ac1c00d7) - The build-and-inspect action didn't save the dist packages + ### New - Added tests for logging branches. [f8f0278](https://github.com/callowayproject/bump-my-version/commit/f8f027846349df4c66377c2cf4cc6903cd1f9bf7) @@ -757,6 +776,7 @@ - changed name to bump-my-version in setup.cfg - added PAT in release pipeline to (hopefully) allow committing and tagging to master without issue. + ### New - Added codecov to workflow. [a5009e0](https://github.com/callowayproject/bump-my-version/commit/a5009e04068787bb98363c3e6803f84a338ee798) @@ -804,10 +824,12 @@ - Added bumpversion.yaml to increase the version when a PR is closed - - Added release.yaml to create a github relase and upload things to PyPI + - Added release.yaml to create a github release and upload things to PyPI + - Added PYTHONUTF8 mode. [91a73e2](https://github.com/callowayproject/bump-my-version/commit/91a73e26af94185194aea1ddb803ac621c0ae84a) - see https://docs.python.org/3/using/windows.html#utf-8-mode + - Added explicit environment variable declarations. [80fe7ef](https://github.com/callowayproject/bump-my-version/commit/80fe7ef0cf1005333143cce38835dbc9ad811884) - Added a github CI workflow. [2b3b358](https://github.com/callowayproject/bump-my-version/commit/2b3b3585afe3fdcf13ff47a229b4e3d3b5dacdc9) @@ -816,6 +838,7 @@ - __main__.py - aliases.py + - Added LICENSE. [34a9be5](https://github.com/callowayproject/bump-my-version/commit/34a9be5617a24b9d7eb042dc12e657ef1eb4258c) - Added tests for version parsing errors. [71a204b](https://github.com/callowayproject/bump-my-version/commit/71a204b0eb1ea2e7ae291055f26f5c499d429f1b) diff --git a/README.md b/README.md index 0cf481ae..650f953e 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ > - Add better configuration validation using [Pydantic](https://docs.pydantic.dev) > - Make the code and tests easier to read and maintain + ## Overview @@ -31,12 +32,6 @@ Bump My Version's purpose is to: - Tagging releases - Reading version numbers from tags - -## Future Direction - -- Switch having both the version part and files to change as arguments on the command line. -- Allow for multiple tags, including one that moves for having a `v2` that always points to the latest version of version 2. [For example](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md#recommendations) - ## Installation You can download and install the latest version of this software from the Python package index (PyPI) as follows: @@ -51,10 +46,6 @@ Please find the changelog here: [CHANGELOG.md](CHANGELOG.md) ## Usage for version incrementing -> **NOTE:** -> -> Throughout this document, you can use `bumpversion` or `bump-my-version` interchangeably. - There are two modes of operation: On the command line for single-file operation and using a configuration file (`pyproject.toml` or `.bumpversion.toml`) for more complex multi-file operations. > **WARNING:** @@ -130,9 +121,9 @@ Example output: `-h, --help` Print help and exit -## Using bump-my-version in a script +## Using Bump My Version in a script -If you need to use the version generated by bump-my-version in a script, you can make use of the `show` subcommand. +If you need to use the version generated by Bump My Version in a script, you can make use of the `show` subcommand. Say, for example, that you are using git-flow to manage your project and want to automatically create a release. When you issue `git flow release start` you need to know the new version before applying the change. @@ -160,4 +151,6 @@ workflow, as it is intended to be very versatile. ## License -bump-my-version is licensed under the MIT License - see the [LICENSE](LICENSE) file for details +Bump My Version is licensed under the MIT License - see the [LICENSE](LICENSE) file for details + + diff --git a/bumpversion/cli.py b/bumpversion/cli.py index eaf23e91..43a096aa 100644 --- a/bumpversion/cli.py +++ b/bumpversion/cli.py @@ -54,6 +54,7 @@ def cli(ctx: Context) -> None: "--search", "--replace", "--no-configured-files", + "--ignore-missing-files", "--ignore-missing-version", ], }, @@ -160,6 +161,12 @@ def cli(ctx: Context) -> None: "ignoring the files from the configuration file." ), ) +@click.option( + "--ignore-missing-files", + is_flag=True, + envvar="BUMPVERSION_IGNORE_MISSING_FILES", + help="Ignore any missing files when searching and replacing in files.", +) @click.option( "--ignore-missing-version", is_flag=True, @@ -240,6 +247,7 @@ def bump( replace: Optional[str], regex: Optional[bool], no_configured_files: bool, + ignore_missing_files: bool, ignore_missing_version: bool, dry_run: bool, commit: Optional[bool], @@ -256,7 +264,7 @@ def bump( ARGS may contain any of the following: - VERSION_PART is the part of the version to increase, e.g. `minor` . + VERSION_PART is the part of the version to increase, e.g. `minor`. Valid values include those given in the `--serialize` / `--parse` option. FILES are additional file(s) to modify. @@ -281,6 +289,7 @@ def bump( tag_message=tag_message, message=message, commit_args=commit_args, + ignore_missing_files=ignore_missing_files, ignore_missing_version=ignore_missing_version, regex=regex, ) @@ -444,6 +453,12 @@ def show(args: List[str], config_file: Optional[str], format_: str, increment: O envvar="BUMPVERSION_IGNORE_MISSING_VERSION", help="Ignore any Version Not Found errors when searching and replacing in files.", ) +@click.option( + "--ignore-missing-files", + is_flag=True, + envvar="BUMPVERSION_IGNORE_MISSING_FILES", + help="Ignore any missing files when searching and replacing in files.", +) @click.option( "--dry-run", "-n", @@ -465,6 +480,7 @@ def replace( regex: bool, no_configured_files: bool, ignore_missing_version: bool, + ignore_missing_files: bool, dry_run: bool, ) -> None: """ @@ -492,6 +508,7 @@ def replace( message=None, commit_args=None, ignore_missing_version=ignore_missing_version, + ignore_missing_files=ignore_missing_files, regex=regex, ) diff --git a/bumpversion/config/__init__.py b/bumpversion/config/__init__.py index 6bb68846..5fdf3a18 100644 --- a/bumpversion/config/__init__.py +++ b/bumpversion/config/__init__.py @@ -22,6 +22,7 @@ "replace": "{new_version}", "regex": False, "ignore_missing_version": False, + "ignore_missing_files": False, "tag": False, "sign_tags": False, "tag_name": "v{new_version}", diff --git a/bumpversion/config/files.py b/bumpversion/config/files.py index 2fcad842..54675d3b 100644 --- a/bumpversion/config/files.py +++ b/bumpversion/config/files.py @@ -141,6 +141,7 @@ def update_config_file( replace=config.replace, regex=config.regex, ignore_missing_version=True, + ignore_missing_file=True, serialize=config.serialize, parse=config.parse, ) diff --git a/bumpversion/config/models.py b/bumpversion/config/models.py index 261efa59..5b7acf18 100644 --- a/bumpversion/config/models.py +++ b/bumpversion/config/models.py @@ -30,6 +30,7 @@ class FileChange(BaseModel): replace: str regex: bool ignore_missing_version: bool + ignore_missing_file: bool filename: Optional[str] = None glob: Optional[str] = None # Conflicts with filename. If both are specified, glob wins key_path: Optional[str] = None # If specified, and has an appropriate extension, will be treated as a data file @@ -84,6 +85,7 @@ class Config(BaseSettings): replace: str regex: bool ignore_missing_version: bool + ignore_missing_files: bool tag: bool sign_tags: bool tag_name: str @@ -116,6 +118,7 @@ def add_files(self, filename: Union[str, List[str]]) -> None: replace=self.replace, regex=self.regex, ignore_missing_version=self.ignore_missing_version, + ignore_missing_file=self.ignore_missing_files, ) ) self.files = list(files) diff --git a/bumpversion/config/utils.py b/bumpversion/config/utils.py index ffb5f939..860b0cf6 100644 --- a/bumpversion/config/utils.py +++ b/bumpversion/config/utils.py @@ -18,6 +18,7 @@ def get_all_file_configs(config_dict: dict) -> List[FileChange]: "search": config_dict["search"], "replace": config_dict["replace"], "ignore_missing_version": config_dict["ignore_missing_version"], + "ignore_missing_file": config_dict["ignore_missing_files"], "regex": config_dict["regex"], } files = [{k: v for k, v in filecfg.items() if v is not None} for filecfg in config_dict["files"]] diff --git a/bumpversion/files.py b/bumpversion/files.py index f3c3fcc0..5ba9edfc 100644 --- a/bumpversion/files.py +++ b/bumpversion/files.py @@ -86,6 +86,7 @@ def __init__( replace=replacement, regex=file_change.regex or False, ignore_missing_version=file_change.ignore_missing_version or False, + ignore_missing_file=file_change.ignore_missing_file or False, filename=file_change.filename, glob=file_change.glob, key_path=file_change.key_path, @@ -110,7 +111,7 @@ def get_file_contents(self) -> str: The contents of the file """ if not os.path.exists(self.file_change.filename): - raise FileNotFoundError(f"File not found: '{self.file_change.filename}'") + raise FileNotFoundError(f"File not found: '{self.file_change.filename}'") # pragma: no-coverage with open(self.file_change.filename, "rt", encoding="utf-8") as f: contents = f.read() @@ -176,6 +177,12 @@ def make_file_change( self.file_change.replace, ) logger.indent() + if not os.path.exists(self.file_change.filename): + if self.file_change.ignore_missing_file: + logger.info("File not found, but ignoring") + logger.dedent() + return + raise FileNotFoundError(f"File not found: '{self.file_change.filename}'") # pragma: no-coverage logger.debug("Serializing the current version") logger.indent() context["current_version"] = self.version_config.serialize(current_version, context) @@ -273,6 +280,7 @@ def __init__( search=search or file_change.search or version_config.search, replace=replace or file_change.replace or version_config.replace, regex=file_change.regex or False, + ignore_missing_file=file_change.ignore_missing_file or False, ignore_missing_version=file_change.ignore_missing_version or False, filename=file_change.filename, glob=file_change.glob, diff --git a/docsrc/LICENSE b/docsrc/LICENSE index 39479bb5..e1c8f4da 100644 --- a/docsrc/LICENSE +++ b/docsrc/LICENSE @@ -1,2 +1 @@ -```{include} ../LICENSE -``` +{% include-markdown "../LICENSE" %} diff --git a/docsrc/Makefile b/docsrc/Makefile deleted file mode 100644 index 56fa66d8..00000000 --- a/docsrc/Makefile +++ /dev/null @@ -1,20 +0,0 @@ -# Minimal makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = python -msphinx -SPHINXPROJ = bump_version -SOURCEDIR = . -BUILDDIR = _build - -# Put it first so that "make" without argument is like "make help". -help: - @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help Makefile - -# Catch-all target: route all unknown targets to Sphinx using the new -# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). -%: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docsrc/_static/bump-my-version-logo.svg b/docsrc/_static/bump-my-version-logo.svg new file mode 100644 index 00000000..6dcfad1d --- /dev/null +++ b/docsrc/_static/bump-my-version-logo.svg @@ -0,0 +1 @@ + diff --git a/docsrc/bump-my-version-model.drawio b/docsrc/_static/bump-my-version-model.drawio similarity index 85% rename from docsrc/bump-my-version-model.drawio rename to docsrc/_static/bump-my-version-model.drawio index c0b86618..d84303ab 100644 --- a/docsrc/bump-my-version-model.drawio +++ b/docsrc/_static/bump-my-version-model.drawio @@ -1,4 +1,4 @@ - + @@ -204,10 +204,10 @@ - + - + @@ -215,7 +215,7 @@ - + @@ -223,7 +223,7 @@ - + @@ -231,7 +231,7 @@ - + @@ -240,7 +240,7 @@ - + @@ -249,7 +249,7 @@ - + @@ -258,386 +258,410 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - - + + - + - + - + - + + + + + + + + + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - + - + - + - - + + - + + + + + + + + + - + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - + - + - - + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - + + diff --git a/docsrc/_static/creating-a-version-spec.png b/docsrc/_static/creating-a-version-spec.png deleted file mode 100644 index 01df0d97..00000000 Binary files a/docsrc/_static/creating-a-version-spec.png and /dev/null differ diff --git a/docsrc/_static/creating-a-version-spec.svg b/docsrc/_static/creating-a-version-spec.svg index 84e9623e..41a5fcf8 100644 --- a/docsrc/_static/creating-a-version-spec.svg +++ b/docsrc/_static/creating-a-version-spec.svg @@ -1,561 +1,3 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Version Spec - - - Configuration - - - create_version - - Named - Capture - - - Group - - - Named - Capture - - - Group - - - Named - Capture - - - Group - - - Version Component - - - Spec - - - Version Component - - - Spec - - - Version Component - - - Spec - - - - Version Parser - - Version Component - - - Spec - - - Version Component - - - Spec - - - Group - - - Order - - - component - - - dependency - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
Version Spec
Version Spec
Configuration
Configuration
create_version
Named Capture Group
Named...
Named Capture Group
Named...
Named Capture Group
Named...
Version ComponentSpecVersion ComponentSpecVersion ComponentSpecVersion ParserVersion ComponentSpecVersion ComponentSpec
Group Order
Gr...
component dependency
component dependen...

Text is not SVG - cannot display
diff --git a/docsrc/_static/creating-a-version.png b/docsrc/_static/creating-a-version.png deleted file mode 100644 index b2a2c122..00000000 Binary files a/docsrc/_static/creating-a-version.png and /dev/null differ diff --git a/docsrc/_static/creating-a-version.svg b/docsrc/_static/creating-a-version.svg index 852b4fa9..d1c5cd66 100644 --- a/docsrc/_static/creating-a-version.svg +++ b/docsrc/_static/creating-a-version.svg @@ -1,738 +1,3 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Version Spec - - - - - value - - - - - " - - - - - 1 - - - - - " - - - - - value - - - - - " - - - - - 2 - - - - - " - - - - - value - - - - - " - - - - - 3 - - - - - " - - - - - create_version - - - - - m - - - - - a - - - - - j - - - - - o - - - - - r= - - - 1 - minor=2 - - - patch=3 - - - - - Version Component Spec - - - - - create_component - - - Version - - - Component - - - - - Version Component Spec - - - - - create_component - - - Version - - - Component - - - - - Version Component Spec - - - - - create_component - - - Version - - - Component - - - - - VersionSpec - - - - - Version - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Version Component - Version Component - - - Version Component - - - - - Version Spec - - - - - bump - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +
Version Spec
Version Spec
value
value
"1"
"1"
value
value
"2"
"2"
value
value
"3"
"3"
create_version
major=1
minor=2
patch=3
major=1...
Version Component Spec
Version Component Spec
create_componentVersionComponent
Version Component Spec
Version Component Spec
create_componentVersionComponent
Version Component Spec
Version Component Spec
create_componentVersionComponentVersionSpec
Version
Version
Version ComponentVersion ComponentVersion ComponentVersion Specbump
Text is not SVG - cannot display
diff --git a/docsrc/_static/css/cards.css b/docsrc/_static/css/cards.css new file mode 100644 index 00000000..95d2e5c1 --- /dev/null +++ b/docsrc/_static/css/cards.css @@ -0,0 +1,200 @@ +/************* + Grid Modification +*/ + +.md-typeset .grid.wide-gap { + gap: 1rem; +} + +/************* + Cards +*/ +.card-container { + background-color: white; + color: rgba(0, 0, 0, 0.87); + border-radius: 4px; + box-shadow: rgba(0, 0, 0, 0.2) 0 2px 1px -1px, rgba(0, 0, 0, 0.14) 0 1px 1px 0, rgba(0, 0, 0, 0.12) 0 1px 3px 0; + overflow: hidden; +} + +.card-container.depth-0 { + box-shadow: none; +} + +/************* + Cards - Header +*/ + +.card-header { + padding: 16px 16px 24px; + background: var(--md-primary-fg-color); + color: var(--md-primary-bg-color); +} + +.card-header.backstage-green { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e"), linear-gradient(90deg, rgb(0, 91, 75), rgb(0, 91, 75)); + color: rgb(255, 255, 255); +} + +.card-header.backstage-blue { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='1368' height='400' fill='none'%3e%3cmask id='a' width='1368' height='401' x='0' y='0' maskUnits='userSpaceOnUse'%3e%3cpath fill='url(%23paint0_linear)' d='M437 116C223 116 112 0 112 0h1256v400c-82 0-225-21-282-109-112-175-436-175-649-175z'/%3e%3cpath fill='url(%23paint1_linear)' d='M1368 400V282C891-29 788 40 711 161 608 324 121 372 0 361v39h1368z'/%3e%3cpath fill='url(%23paint2_linear)' d='M1368 244v156H0V94c92-24 198-46 375 0l135 41c176 51 195 109 858 109z'/%3e%3cpath fill='url(%23paint3_linear)' d='M1252 400h116c-14-7-35-14-116-16-663-14-837-128-1013-258l-85-61C98 28 46 8 0 0v400h1252z'/%3e%3c/mask%3e%3cg mask='url(%23a)'%3e%3cpath fill='white' d='M-172-98h1671v601H-172z'/%3e%3c/g%3e%3cdefs%3e%3clinearGradient id='paint0_linear' x1='602' x2='1093.5' y1='-960.5' y2='272' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint1_linear' x1='482' x2='480' y1='1058.5' y2='70.5' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint2_linear' x1='424' x2='446.1' y1='-587.5' y2='274.6' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3clinearGradient id='paint3_linear' x1='587' x2='349' y1='-1120.5' y2='341' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='white'/%3e%3cstop offset='1' stop-color='white' stop-opacity='0'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e"), linear-gradient(90deg, rgb(0, 109, 143), rgb(0, 73, 161)); + color: rgb(255, 255, 255); +} + +.card-header p.subtitle { + margin: 0; + font-size: 0.8em; + font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + font-weight: 500; + line-height: 1.57; +} + +.card-header p.title { + margin: 0; + font-size: 1.14em; + font-family: "Helvetica Neue", Helvetica, Roboto, Arial, sans-serif; + font-weight: 700; + line-height: 1.6; + margin-bottom: 2px; +} + +/************* + Cards - Media +*/ + +.card-media { + display: block; + background-size: cover; + background-repeat: no-repeat; + background-position: center; + width: 100%; + object-fit: cover; +} + +.card-media p { + margin: 0; +} + +/************* + Cards - Content +*/ + +.card-content { + padding: 16px; +} + +.card-content p { + margin: 0; +} + +.card-content p + p { + margin-top: 1em; +} + +.card-content-title { + margin-top: 0; + font-weight: 400; + font-size: 1.5rem; + line-height: 1.334; + letter-spacing: 0; + margin-bottom: 0.35em; +} + +.card-content-title p { + margin: 0; +} + +/************* + Cards - Actions +*/ + +.card-actions { + padding: 16px; +} + +.card-actions ul:not([hidden]) { + display: flex; + margin: 0; +} + +.card-actions ul { + list-style: none; + padding: 0; + margin: 0; + display: flex; + flex-wrap: wrap; + gap: 16px; +} +.card-actions.right ul { + justify-content: flex-end; +} + +.card-actions p { + margin: 0; +} + +[dir=ltr] .card-actions ul li { + margin: 0; +} + +.card-actions a { + background-color: transparent; + margin-top: 0; + vertical-align: middle; + font-weight: 500; + font-size: 0.8125rem; + line-height: 1.75; + letter-spacing: 0.02857em; + text-transform: uppercase; +} + +/************* + Cards - Tags +*/ + +.card-tags { + display: flex; + flex-wrap: wrap; + box-sizing: border-box; + padding: 16px; +} + +.card-tags ul:not([hidden]) { + display: flex; + margin: 0; +} + +.card-tags ul { + list-style: none; + padding: 0; + margin: 0; + display: flex; + flex-wrap: wrap; + gap: 16px; +} + +[dir=ltr] .card-tags ul li { + padding: 2px 8px; + margin: 0; + box-sizing: border-box; + font-size: 12px; + font-weight: 500; + color: #000; + background-color: rgba(0, 0, 0, 0.12); + border-radius: 16px; + height: 24px; + line-height: 20px; +} + +/************* + Cards - Divider +*/ + +.card-divider { + margin: 0; + padding: 0 16px; +} + +.card-divider hr { + margin: 0; +} diff --git a/docsrc/_static/css/custom.css b/docsrc/_static/css/custom.css index 0f5f134a..dc455b76 100644 --- a/docsrc/_static/css/custom.css +++ b/docsrc/_static/css/custom.css @@ -16,26 +16,54 @@ margin: 0; } -dl.field-list { +.field-list > dl { + --gap: 1rem; + --line-offset: calc(var(--gap) / 2); + --line-thickness: 1px; + --line-color: #e0e0e0; + display: grid; grid-template-columns: fit-content(30%) auto; + grid-gap: var(--gap); margin-bottom: 1rem; + overflow: hidden; } -dl.field-list > dt { +.field-list > dl > dt { + text-align: right; font-weight: bold; word-break: break-word; - padding-left: 0.5em; - padding-right: 5px; + position: relative; } -dl.field-list > dd { - padding-left: 0.5em; +[dir=ltr] .field-list > dl > dd { margin-top: 0; margin-left: 0; margin-bottom: 0; + position: relative; +} + +/* Pseudo Element Shared Styling */ +.field-list > dl > dt::before, +.field-list > dl > dt::after, +.field-list > dl > dd::before, +.field-list > dl > dd::after { + content: ''; + position: absolute; + background-color: var(--line-color); + z-index: 1; } +/* Row Borders */ +.field-list > dl > dt::after, +.field-list > dl > dd::after { + inline-size: 100vw; + block-size: var(--line-thickness); + inset-inline-start: 0; + inset-block-start: calc(var(--line-offset) * -1); +} + + figure { padding-bottom: .75rem; padding-top: .5rem; diff --git a/docsrc/_static/css/mkdocstrings.css b/docsrc/_static/css/mkdocstrings.css new file mode 100644 index 00000000..4a69994f --- /dev/null +++ b/docsrc/_static/css/mkdocstrings.css @@ -0,0 +1,27 @@ +/* Indentation. */ +div.doc-contents:not(.first) { + padding-left: 25px; + border-left: .05rem solid var(--md-typeset-table-color); +} + +/* Mark external links as such. */ +a.external::after, +a.autorefs-external::after { + /* https://primer.style/octicons/arrow-up-right-24 */ + mask-image: url('data:image/svg+xml,'); + -webkit-mask-image: url('data:image/svg+xml,'); + content: ' '; + + display: inline-block; + vertical-align: middle; + position: relative; + + height: 1em; + width: 1em; + background-color: var(--md-typeset-a-color); +} + +a.external:hover::after, +a.autorefs-external:hover::after { + background-color: var(--md-accent-fg-color); +} diff --git a/docsrc/_static/serializing-a-version-1-0-0.png b/docsrc/_static/serializing-a-version-1-0-0.png deleted file mode 100644 index 975cdfb4..00000000 Binary files a/docsrc/_static/serializing-a-version-1-0-0.png and /dev/null differ diff --git a/docsrc/_static/serializing-a-version-1-0-0.svg b/docsrc/_static/serializing-a-version-1-0-0.svg index 921a9e15..d50c9955 100644 --- a/docsrc/_static/serializing-a-version-1-0-0.svg +++ b/docsrc/_static/serializing-a-version-1-0-0.svg @@ -1,306 +1,3 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Version Serialization Formats - - - Version - - major = 1 - minor = 0 - - - patch = 0 - - - - Version Spec - - - bump - - - { - - - m - - - a - - - j - - - o - - - r - - - } - - - . - - - { - - - m - - - i - - - n - - - o - - - r - - - } - - - . - - - { - - - p - - - a - - - t - - - c - - - h - - - } - - {major}.{minor} - - - {major} - - - - 1 - - - . - - - 0 - - - . - - 0 - - - 1.0 - - - - 1 - - - Selected Format - - - - - - - - - - - - - - - - - - - - - serialize - - - +
Version Serialization Formats
Version Serialization Formats
Version
Version
major = 1minor = 0patch = 0Version Specbump
{major}.{minor}.{patch}
{major}.{minor}.{patch}
{major}.{minor}
{major}.{minor}
{major}
{major}
1.0.0
1.0.0
1.0
1.0
1
1
Selected Format
Sele...
serialize
Text is not SVG - cannot display
diff --git a/docsrc/_static/serializing-a-version-1-2-0.png b/docsrc/_static/serializing-a-version-1-2-0.png deleted file mode 100644 index fcf3fa22..00000000 Binary files a/docsrc/_static/serializing-a-version-1-2-0.png and /dev/null differ diff --git a/docsrc/_static/serializing-a-version-1-2-0.svg b/docsrc/_static/serializing-a-version-1-2-0.svg index a293fc2e..09fa45a3 100644 --- a/docsrc/_static/serializing-a-version-1-2-0.svg +++ b/docsrc/_static/serializing-a-version-1-2-0.svg @@ -1,306 +1,3 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Version Serialization Formats - - - Version - - major = 1 - minor = 2 - - - patch = 0 - - - - Version Spec - - - bump - - - { - - - m - - - a - - - j - - - o - - - r - - - } - - - . - - - { - - - m - - - i - - - n - - - o - - - r - - - } - - - . - - - { - - - p - - - a - - - t - - - c - - - h - - - } - - {major}.{minor} - - - {major} - - - - 1 - - - . - - - 2 - - - . - - 0 - - - 1.2 - - - - 1 - - - Selected Format - - - - - - - - - - - - - - - - - - - - - serialize - - - +
Version Serialization Formats
Version Serialization Formats
Version
Version
major = 1minor = 2patch = 0Version Specbump
{major}.{minor}.{patch}
{major}.{minor}.{patch}
{major}.{minor}
{major}.{minor}
{major}
{major}
1.2.0
1.2.0
1.2
1.2
1
1
Selected Format
Sele...
serialize
Text is not SVG - cannot display
diff --git a/docsrc/_static/serializing-a-version-1-2-3.png b/docsrc/_static/serializing-a-version-1-2-3.png deleted file mode 100644 index 18918524..00000000 Binary files a/docsrc/_static/serializing-a-version-1-2-3.png and /dev/null differ diff --git a/docsrc/_static/serializing-a-version-1-2-3.svg b/docsrc/_static/serializing-a-version-1-2-3.svg index 8d26f778..f66754b8 100644 --- a/docsrc/_static/serializing-a-version-1-2-3.svg +++ b/docsrc/_static/serializing-a-version-1-2-3.svg @@ -1,306 +1,3 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Version Serialization Formats - - - Version - - major = 1 - minor = 2 - - - patch = 3 - - - - Version Spec - - - bump - - - { - - - m - - - a - - - j - - - o - - - r - - - } - - - . - - - { - - - m - - - i - - - n - - - o - - - r - - - } - - - . - - - { - - - p - - - a - - - t - - - c - - - h - - - } - - {major}.{minor} - - - {major} - - - - 1 - - - . - - - 2 - - - . - - 3 - - - 1.2 - - - - 1 - - - Selected Format - - - - - - - - - - - - - - - - - - - - - serialize - - - +
Version Serialization Formats
Version Serialization Formats
Version
Version
major = 1minor = 2patch = 3Version Specbump
{major}.{minor}.{patch}
{major}.{minor}.{patch}
{major}.{minor}
{major}.{minor}
{major}
{major}
1.2.3
1.2.3
1.2
1.2
1
1
Selected Format
Sele...
serialize
Text is not SVG - cannot display
diff --git a/docsrc/_static/serializing-a-version-1.svg b/docsrc/_static/serializing-a-version-1.svg index 45469bb8..66c307f6 100644 --- a/docsrc/_static/serializing-a-version-1.svg +++ b/docsrc/_static/serializing-a-version-1.svg @@ -1,265 +1,3 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Version Serialization Formats - - - Version - - major = 1 - minor = 2 - - - patch = 3 - - - - Version Spec - - - bump - - - { - - - m - - - a - - - j - - - o - - - r - - } - - - {major} - - - - . - - - { - - - m - - - i - - - n - - - o - - - r - - - } - - - serialize - - 1 - - - 1 - - - - . - - - 2 - - - Selected Format - - - - - - - - - - - +
Version Serialization Formats
Version Serialization Formats
Version
Version
major = 1minor = 2patch = 3Version Specbump
{major}
{major}
{major}.{minor}
{major}.{minor}
serialize
1
1
1.2
1.2
Selected Format
Sele...
Text is not SVG - cannot display
diff --git a/docsrc/changelog.md b/docsrc/changelog.md index 66efc0fe..e137197f 100644 --- a/docsrc/changelog.md +++ b/docsrc/changelog.md @@ -1,2 +1 @@ -```{include} ../CHANGELOG.md -``` +{% include-markdown "../CHANGELOG.md" %} diff --git a/docsrc/conf.py b/docsrc/conf.py deleted file mode 100644 index 873020ef..00000000 --- a/docsrc/conf.py +++ /dev/null @@ -1,100 +0,0 @@ -""" -Sphinx configuration. -""" - -# flake8: noqa -import os -import sys -from datetime import date - -sys.path.insert(0, os.path.abspath("..")) - -import bumpversion - -project = "bump-my-version" -copyright = f"{date.today():%Y} Calloway Project" -author = "Contributors" - -version = bumpversion.__version__ -release = bumpversion.__version__ - -# -- General configuration --------------------------------------------- - -extensions = [ - "myst_parser", - "autodoc2", - "sphinx.ext.viewcode", - "sphinx.ext.intersphinx", - "sphinx.ext.autosectionlabel", - "sphinx.ext.napoleon", - "sphinx_autodoc_typehints", - "sphinx.ext.coverage", - "sphinx.ext.githubpages", - "sphinx_click", - "sphinx_copybutton", -] -autosectionlabel_prefix_document = True -autosectionlabel_maxdepth = 2 - -autodoc2_packages = ["../bumpversion"] -autodoc2_render_plugin = "myst" -autodoc2_output_dir = "reference" -autodoc2_index_template = None -autodoc2_docstring_parser_regexes = [ - # this will render all docstrings as Markdown - (r".*", "myst"), -] - -napoleon_attr_annotations = True -napoleon_include_special_with_doc = True -napoleon_include_private_with_doc = True -napoleon_include_init_with_doc = True -napoleon_use_admonition_for_examples = True - -myst_enable_extensions = [ - "amsmath", - "colon_fence", - "deflist", - "dollarmath", - "linkify", - "replacements", - "smartquotes", - "substitution", - "tasklist", - "fieldlist", -] -myst_heading_anchors = 2 -intersphinx_mapping = { - "python": ("https://docs.python.org/3", None), -} - -templates_path = ["_templates"] -source_suffix = [".rst", ".md"] -master_doc = "index" -language = "en" -exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"] -todo_include_todos = False - - -# -- Options for HTML output ------------------------------------------- - -html_theme = "furo" -html_static_path = ["_static"] -html_css_files = [ - "css/custom.css", -] -html_theme_options = { - "footer_icons": [ - { - "name": "GitHub", - "url": "https://github.com/callowayproject/bump-my-version", - "html": """ - - - - """, - "class": "", - }, - ], -} -html_title = f"Bump My Version {release}" diff --git a/docsrc/contributing.md b/docsrc/contributing.md index 78caf34e..89e0be46 100644 --- a/docsrc/contributing.md +++ b/docsrc/contributing.md @@ -1,2 +1 @@ -```{include} ../CONTRIBUTING.md -``` +{% include-markdown "../CONTRIBUTING.md" rewrite-relative-urls=false %} diff --git a/docsrc/explanation/index.md b/docsrc/explanation/index.md index 93fbc8ac..b1303b40 100644 --- a/docsrc/explanation/index.md +++ b/docsrc/explanation/index.md @@ -1,8 +1 @@ # Explanation - -```{toctree} ---- -titlesonly: true ---- -mental-model -``` diff --git a/docsrc/explanation/mental-model.md b/docsrc/explanation/mental-model.md index 90be55cf..0a14f5ff 100644 --- a/docsrc/explanation/mental-model.md +++ b/docsrc/explanation/mental-model.md @@ -1,8 +1,8 @@ -# The mental model used by bump-my-version +# The mental model used by Bump My Version ## Overview -There are four main concepts in bump-my-version: +There are four main concepts in Bump My Version: 1. Configuration 2. Version handling @@ -11,19 +11,19 @@ There are four main concepts in bump-my-version: ## Configuration -The predecessor to bump-my-version, [bumpversion](https://github.com/peritus/bumpversion), was designed to have the configuration file optional. All configuration values could be specified on the command line. This only worked in the simplest of version schemes. +The predecessor to Bump My Version, [bumpversion](https://github.com/peritus/bumpversion), was designed to have the configuration file optional. All configuration values could be specified on the command line. This only worked in the simplest of version schemes. -bump-my-version is designed to have a configuration file. The configuration file is required to specify the version scheme. The configuration file is also used to specify the files to change and how to change them. +While Bump My Version can do many things without a configuration file, it is designed to have a configuration file. The configuration file is required to specify the version scheme. The configuration file also specifies the files to change and how to change them. ## Version handling -bump-my-version abstracts the version handling into a few concepts: +Bump My Version abstracts the version handling into a few concepts: -A **version spec** defines all the possible _version component specs_ of a version and how they work together. +A **version spec** defines the rules for incrementing a version. A **version component spec** defines how a single part of a _version spec,_ such as `major`, `minor`, or `patch`, works. It defines the types of values, how to increment the component, and how to reset it. -A **version parser** is a regular expression used in several ways. It's named capture groups define the possible components in a version spec and the order in which they appear. It is also used to parse a version string into a mapping of version component name to value. +A **version parser** is a regular expression used in several ways. Its named capture groups define the possible components in a version spec and the order in which they appear. It also parses a version string into version component names and their values. A **version** is the concrete representation of a _version spec._ It is a mapping of version component names to _version components._ @@ -33,11 +33,14 @@ A **version serialization format** is a list of format strings used to serialize ### How a version spec is generated -:::{figure-md} fig-version-spec -![How a version spec is generated](../_static/creating-a-version-spec.svg) +
+ [![How a version spec is generated](../_static/creating-a-version-spec.svg)](../_static/creating-a-version-spec.svg) +
How a configuration file is used to generate a version spec.
+
+ + + -How a configuration file is used to generate a version spec. -::: The most important part of the configuration file is the _version parser._ It defines the structure of the _version spec._ @@ -46,21 +49,20 @@ If the configuration file contains a _version component spec_ that matches a nam If the configuration file does not contain a _version component spec_ that matches a named capture group in the _version parser,_ then a default _version component spec_ is used. The blue named capture group in the diagram demonstrates this. -The _component dependency_ graph is used to determine the order in which the _version components_ are incremented and reset. For example in the diagram, the `patch` component depends on the `minor` component which depends on the `major` component. Therefore, when the `major` component is incremented, the `minor` component is reset, which cascades to the `patch` component. +The _component dependency_ graph determines the order in which the _version components_ are incremented and reset. For example, in the diagram, the patch component depends on the minor component, which depends on the `major` component. Therefore, when the `major` component is incremented, the `minor` component is reset, which cascades to the `patch` component. ### How a version is generated -:::{figure-md} fig-version -![How a version is generated](../_static/creating-a-version.svg) - -How a version spec is used to generate a version. -::: +
+ [![How a version is generated](../_static/creating-a-version.svg)](../_static/creating-a-version.svg) +
How a version spec is used to generate a version.
+
The _version spec_ has a `create_version` method that takes a mapping of version component names to values. Each _version component spec_ has a `create_component` method that takes a value. The `create_version` method calls the `create_component` method for each _version component spec_ in the _version spec_ with the value from the mapping. -The `create_component` assembles its own _version spec_ with the _version components_ to create a _version._ +The `create_component` assembles its version spec_ with the _version components_ to create a _version._ ### How a version is serialized @@ -68,34 +70,55 @@ The `create_component` assembles its own _version spec_ with the _version compon **Required value rule.** _Version component specs_ is required if its value or the value of any of its dependent components is not optional. -A valid serialization is one that contains all the components in the _version spec_ that are required based on the _required value rule._ +A valid serialization contains all the required components in the version spec based on the _required value rule._ -An invalid serialization is one that does not contain all the components in the _version spec_ that are required based on the _required value rule._ +An invalid serialization does not contain all the required components in the version spec based on the _required value rule._ -An optimal serialization is the valid serialization that uses the fewest components. +The optimal serialization is the valid serialization that uses the fewest components. The `serialize` method of the _version spec_ returns either the optimal serialization or the first invalid serialization. -:::{figure-md} fig-serialize-1-2-3 -![How a version is serialized with values major=1, minor=2, and patch=3](../_static/serializing-a-version-1-2-3.svg) +### Version serialization examples + +::: grid wide-gap + + ::: card-container depth-0 + ::: card-media + [![How a version is serialized with values major=1, minor=2, and patch=3](../_static/serializing-a-version-1-2-3.svg)](../_static/serializing-a-version-1-2-3.svg) + + ::: card-content + No optional values + {.card-content-title} + + In this example, the `major` component is `1`, the `minor` component is `2`, and `patch` component is `3`. Since none of the values are optional (`0`), only one serialization format is valid. This one valid format is the optimal format. -A version with values major=1, minor=2, and patch=3 only has one valid serialization. It is also the optimal serialization. -::: + ::: card-container depth-0 + ::: card-media + [![How a version is serialized with values major=1, minor=2, and patch=0](../_static/serializing-a-version-1-2-0.svg)](../_static/serializing-a-version-1-2-0.svg) + + ::: card-content + + One optional value + {.card-content-title} + + A version with values major=1, minor=2, and patch=0 has two valid serializations. The optimal serialization is the one that uses the fewest components. `1.2` in this example. -:::{figure-md} fig-serialize-1-2-0 -![How a version is serialized with values major=1, minor=2, and patch=0](../_static/serializing-a-version-1-2-0.svg) + ::: card-container depth-0 + ::: card-media + [![How a version is serialized with values major=1, minor=0, and patch=0](../_static/serializing-a-version-1-0-0.svg)](../_static/serializing-a-version-1-0-0.svg) -A version with values major=1, minor=2, and patch=0 has two valid serializations. The optimal serialization is the one that uses the fewest components. `1.2` in this example -::: + ::: card-content + Two optional values + {.card-content-title} -:::{figure-md} fig-serialize-1-0-0 -![How a version is serialized with values major=1, minor=0, and patch=0](../_static/serializing-a-version-1-0-0.svg) + A version with values major=1, minor=0, and patch=0 has three valid serializations. The optimal serialization is the one that uses the fewest components. `1` in this example. -A version with values major=1, minor=0, and patch=0 has three valid serializations. The optimal serialization is the one that uses the fewest components. `1` in this example. -::: + ::: card-container depth-0 + ::: card-media + [![How a version is serialized with invalid serialization formats](../_static/serializing-a-version-1.svg)](../_static/serializing-a-version-1.svg) -:::{figure-md} fig-serialize-1 -![How a version is serialized with invalid serialization formats](../_static/serializing-a-version-1.svg) + ::: card-content + No valid serialization options + {.card-content-title} -A version with values major=1, minor=2, and patch=3 has no valid serializations in this example. The `serialize` method returns the first invalid serialization. -::: + A version with values major=1, minor=2, and patch=3 has no valid serializations in this example. The `serialize` method returns the first invalid serialization. diff --git a/docsrc/gen_doc_stubs.py b/docsrc/gen_doc_stubs.py new file mode 100755 index 00000000..c2a3bf2f --- /dev/null +++ b/docsrc/gen_doc_stubs.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python +""" +Generate documentation stubs for the configured package. + +Configuring this script: + + Change the `package_name` variable to the name of the package you want to generate + +Output: + + This script will generate a `reference/api` directory containing documentation stubs for the package. + It will also generate a `reference/api/SUMMARY.md` file that contains the navigation structure for the + documentation. +""" + +from pathlib import Path + +import mkdocs_gen_files + +package_name = "bumpversion" + +nav = mkdocs_gen_files.Nav() +mod_symbol = '' + +src_root = Path(__file__).parent.parent +package_root = src_root / package_name + +for path in sorted(package_root.rglob("*.py")): + module_path = path.relative_to(src_root).with_suffix("") + doc_path = path.relative_to(src_root).with_suffix(".md") + full_doc_path = Path("reference/api", doc_path) + + parts = tuple(module_path.parts) + if parts[-1] == "__init__": + parts = parts[:-1] + doc_path = doc_path.with_name("index.md") + full_doc_path = full_doc_path.with_name("index.md") + elif parts[-1].startswith("_"): + continue + + nav_parts = [f"{mod_symbol} {part}" for part in parts] + nav[tuple(nav_parts)] = doc_path.as_posix() + + with mkdocs_gen_files.open(full_doc_path, "w") as fd: + ident = ".".join(parts) + fd.write(f"::: {ident}") + + mkdocs_gen_files.set_edit_path(full_doc_path, path) + +with mkdocs_gen_files.open("reference/api/SUMMARY.md", "w") as nav_file: + nav_file.writelines(nav.build_literate_nav()) diff --git a/docsrc/howtos/avoid-incorrect-replacements.md b/docsrc/howtos/avoid-incorrect-replacements.md index 9f5d7f77..c7997fbb 100644 --- a/docsrc/howtos/avoid-incorrect-replacements.md +++ b/docsrc/howtos/avoid-incorrect-replacements.md @@ -1,6 +1,6 @@ # Avoiding incorrect replacements -In files that have multiple version strings, bump-my-version may find the wrong string and replace it. Given this `requirements.txt` for `MyProject`: +In files that have multiple version strings, Bump My Version may find the wrong string and replace it. Given this `requirements.txt` for `MyProject`: ```text Django>=1.5.6,<1.6 diff --git a/docsrc/howtos/custom-version-formats-by-file.md b/docsrc/howtos/custom-version-formats-by-file.md index 07f93d5e..fdbb2c22 100644 --- a/docsrc/howtos/custom-version-formats-by-file.md +++ b/docsrc/howtos/custom-version-formats-by-file.md @@ -22,7 +22,7 @@ require ( stable: "v2.21.4" ``` -You can use bump-my-version to maintain the major version number within the `go.mod` file by using the `parse` and `serialize` options, as in this example: +You can use Bump My Version to maintain the major version number within the `go.mod` file by using the `parse` and `serialize` options, as in this example: `.bumpversion.toml` file: diff --git a/docsrc/howtos/index.md b/docsrc/howtos/index.md index d9c5e687..869c35ee 100644 --- a/docsrc/howtos/index.md +++ b/docsrc/howtos/index.md @@ -1,9 +1,6 @@ # How-To Guides - -```{toctree} -avoid-incorrect-replacements -custom-version-formats-by-file -multiple-replacements -``` +- [Avoid incorrect replacements](avoid-incorrect-replacements.md) +- [Custom version formats by file](custom-version-formats-by-file.md) +- [Multiple replacements](multiple-replacements.md) diff --git a/docsrc/index.md b/docsrc/index.md index 981fe308..2e69f552 100644 --- a/docsrc/index.md +++ b/docsrc/index.md @@ -1,22 +1,9 @@ # Bump My Version -```{toctree} ---- -maxdepth: 2 -caption: Contents ---- -Introduction -usage -tutorials/index -howtos/index -reference/index -explanation/index -CONTRIBUTING -CHANGELOG -``` - -## Indices and tables - -* {ref}`genindex` -* {ref}`modindex` -* {ref}`search` +{% + include-markdown + "../README.md" + start="" + end="" + rewrite-relative-urls=false +%} diff --git a/docsrc/make.bat b/docsrc/make.bat deleted file mode 100644 index 18eda6c4..00000000 --- a/docsrc/make.bat +++ /dev/null @@ -1,36 +0,0 @@ -@ECHO OFF - -pushd %~dp0 - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=python -msphinx -) -set SOURCEDIR=. -set BUILDDIR=_build -set SPHINXPROJ=bin_bump_version - -if "%1" == "" goto help - -%SPHINXBUILD% >NUL 2>NUL -if errorlevel 9009 ( - echo. - echo.The Sphinx module was not found. Make sure you have Sphinx installed, - echo.then set the SPHINXBUILD environment variable to point to the full - echo.path of the 'sphinx-build' executable. Alternatively you may add the - echo.Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% -goto end - -:help -%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% - -:end -popd diff --git a/docsrc/readme.md b/docsrc/readme.md deleted file mode 100644 index 451bedae..00000000 --- a/docsrc/readme.md +++ /dev/null @@ -1,2 +0,0 @@ -```{include} ../README.md -``` diff --git a/docsrc/reference/bumpversion/bumpversion.__main__.md b/docsrc/reference/bumpversion/bumpversion.__main__.md deleted file mode 100644 index 7807c995..00000000 --- a/docsrc/reference/bumpversion/bumpversion.__main__.md +++ /dev/null @@ -1,9 +0,0 @@ -# {py:mod}`bumpversion.__main__` - -```{py:module} bumpversion.__main__ -``` - -```{autodoc2-docstring} bumpversion.__main__ -:parser: myst -:allowtitles: -``` diff --git a/docsrc/reference/bumpversion/bumpversion.aliases.md b/docsrc/reference/bumpversion/bumpversion.aliases.md deleted file mode 100644 index 0de83671..00000000 --- a/docsrc/reference/bumpversion/bumpversion.aliases.md +++ /dev/null @@ -1,62 +0,0 @@ -# {py:mod}`bumpversion.aliases` - -```{py:module} bumpversion.aliases -``` - -```{autodoc2-docstring} bumpversion.aliases -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`AliasedGroup ` - - ```{autodoc2-docstring} bumpversion.aliases.AliasedGroup - :parser: myst - :summary: - ``` -```` - -### API - -`````{py:class} AliasedGroup(*args: typing.Any, **kwargs: typing.Any) -:canonical: bumpversion.aliases.AliasedGroup - -Bases: {py:obj}`rich_click.rich_group.RichGroup` - -```{autodoc2-docstring} bumpversion.aliases.AliasedGroup -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.aliases.AliasedGroup.__init__ -:parser: myst -``` - -````{py:method} get_command(ctx: click.Context, cmd_name: str) -> typing.Optional[rich_click.Command] -:canonical: bumpversion.aliases.AliasedGroup.get_command - -```{autodoc2-docstring} bumpversion.aliases.AliasedGroup.get_command -:parser: myst -``` - -```` - -````{py:method} resolve_command(ctx: click.Context, args: typing.List[str]) -> tuple -:canonical: bumpversion.aliases.AliasedGroup.resolve_command - -```{autodoc2-docstring} bumpversion.aliases.AliasedGroup.resolve_command -:parser: myst -``` - -```` - -````` diff --git a/docsrc/reference/bumpversion/bumpversion.autocast.md b/docsrc/reference/bumpversion/bumpversion.autocast.md deleted file mode 100644 index 065330d3..00000000 --- a/docsrc/reference/bumpversion/bumpversion.autocast.md +++ /dev/null @@ -1,73 +0,0 @@ -# {py:mod}`bumpversion.autocast` - -```{py:module} bumpversion.autocast -``` - -```{autodoc2-docstring} bumpversion.autocast -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`boolify ` - - ```{autodoc2-docstring} bumpversion.autocast.boolify - :parser: myst - :summary: - ``` -* - {py:obj}`noneify ` - - ```{autodoc2-docstring} bumpversion.autocast.noneify - :parser: myst - :summary: - ``` -* - {py:obj}`listify ` - - ```{autodoc2-docstring} bumpversion.autocast.listify - :parser: myst - :summary: - ``` -* - {py:obj}`autocast_value ` - - ```{autodoc2-docstring} bumpversion.autocast.autocast_value - :parser: myst - :summary: - ``` -```` - -### API - -````{py:function} boolify(s: str) -> bool -:canonical: bumpversion.autocast.boolify - -```{autodoc2-docstring} bumpversion.autocast.boolify -:parser: myst -``` -```` - -````{py:function} noneify(s: str) -> None -:canonical: bumpversion.autocast.noneify - -```{autodoc2-docstring} bumpversion.autocast.noneify -:parser: myst -``` -```` - -````{py:function} listify(s: str) -> list -:canonical: bumpversion.autocast.listify - -```{autodoc2-docstring} bumpversion.autocast.listify -:parser: myst -``` -```` - -````{py:function} autocast_value(var: typing.Any) -> typing.Any -:canonical: bumpversion.autocast.autocast_value - -```{autodoc2-docstring} bumpversion.autocast.autocast_value -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.bump.md b/docsrc/reference/bumpversion/bumpversion.bump.md deleted file mode 100644 index 3cf4358c..00000000 --- a/docsrc/reference/bumpversion/bumpversion.bump.md +++ /dev/null @@ -1,84 +0,0 @@ -# {py:mod}`bumpversion.bump` - -```{py:module} bumpversion.bump -``` - -```{autodoc2-docstring} bumpversion.bump -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`get_next_version ` - - ```{autodoc2-docstring} bumpversion.bump.get_next_version - :parser: myst - :summary: - ``` -* - {py:obj}`do_bump ` - - ```{autodoc2-docstring} bumpversion.bump.do_bump - :parser: myst - :summary: - ``` -* - {py:obj}`commit_and_tag ` - - ```{autodoc2-docstring} bumpversion.bump.commit_and_tag - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.bump.logger - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.bump.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.bump.logger -:parser: myst -``` - -```` - -````{py:function} get_next_version(current_version: bumpversion.versioning.models.Version, config: bumpversion.config.Config, version_part: typing.Optional[str], new_version: typing.Optional[str]) -> bumpversion.versioning.models.Version -:canonical: bumpversion.bump.get_next_version - -```{autodoc2-docstring} bumpversion.bump.get_next_version -:parser: myst -``` -```` - -````{py:function} do_bump(version_part: typing.Optional[str], new_version: typing.Optional[str], config: bumpversion.config.Config, config_file: typing.Optional[pathlib.Path] = None, dry_run: bool = False) -> None -:canonical: bumpversion.bump.do_bump - -```{autodoc2-docstring} bumpversion.bump.do_bump -:parser: myst -``` -```` - -````{py:function} commit_and_tag(config: bumpversion.config.Config, config_file: typing.Optional[pathlib.Path], configured_files: typing.List[bumpversion.files.ConfiguredFile], ctx: typing.ChainMap, dry_run: bool = False) -> None -:canonical: bumpversion.bump.commit_and_tag - -```{autodoc2-docstring} bumpversion.bump.commit_and_tag -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.cli.md b/docsrc/reference/bumpversion/bumpversion.cli.md deleted file mode 100644 index 87d44c40..00000000 --- a/docsrc/reference/bumpversion/bumpversion.cli.md +++ /dev/null @@ -1,123 +0,0 @@ -# {py:mod}`bumpversion.cli` - -```{py:module} bumpversion.cli -``` - -```{autodoc2-docstring} bumpversion.cli -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`cli ` - - ```{autodoc2-docstring} bumpversion.cli.cli - :parser: myst - :summary: - ``` -* - {py:obj}`bump ` - - ```{autodoc2-docstring} bumpversion.cli.bump - :parser: myst - :summary: - ``` -* - {py:obj}`show ` - - ```{autodoc2-docstring} bumpversion.cli.show - :parser: myst - :summary: - ``` -* - {py:obj}`replace ` - - ```{autodoc2-docstring} bumpversion.cli.replace - :parser: myst - :summary: - ``` -* - {py:obj}`sample_config ` - - ```{autodoc2-docstring} bumpversion.cli.sample_config - :parser: myst - :summary: - ``` -* - {py:obj}`show_bump ` - - ```{autodoc2-docstring} bumpversion.cli.show_bump - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.cli.logger - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.cli.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.cli.logger -:parser: myst -``` - -```` - -````{py:function} cli(ctx: click.core.Context) -> None -:canonical: bumpversion.cli.cli - -```{autodoc2-docstring} bumpversion.cli.cli -:parser: myst -``` -```` - -````{py:function} bump(args: list, config_file: typing.Optional[str], verbose: int, allow_dirty: typing.Optional[bool], current_version: typing.Optional[str], new_version: typing.Optional[str], parse: typing.Optional[str], serialize: typing.Optional[typing.List[str]], search: typing.Optional[str], replace: typing.Optional[str], regex: typing.Optional[bool], no_configured_files: bool, ignore_missing_version: bool, dry_run: bool, commit: typing.Optional[bool], tag: typing.Optional[bool], sign_tags: typing.Optional[bool], tag_name: typing.Optional[str], tag_message: typing.Optional[str], message: typing.Optional[str], commit_args: typing.Optional[str], show_list: bool) -> None -:canonical: bumpversion.cli.bump - -```{autodoc2-docstring} bumpversion.cli.bump -:parser: myst -``` -```` - -````{py:function} show(args: typing.List[str], config_file: typing.Optional[str], format_: str, increment: typing.Optional[str]) -> None -:canonical: bumpversion.cli.show - -```{autodoc2-docstring} bumpversion.cli.show -:parser: myst -``` -```` - -````{py:function} replace(files: list, config_file: typing.Optional[str], verbose: int, allow_dirty: typing.Optional[bool], current_version: typing.Optional[str], new_version: typing.Optional[str], parse: typing.Optional[str], serialize: typing.Optional[typing.List[str]], search: typing.Optional[str], replace: typing.Optional[str], regex: bool, no_configured_files: bool, ignore_missing_version: bool, dry_run: bool) -> None -:canonical: bumpversion.cli.replace - -```{autodoc2-docstring} bumpversion.cli.replace -:parser: myst -``` -```` - -````{py:function} sample_config(prompt: bool, destination: str) -> None -:canonical: bumpversion.cli.sample_config - -```{autodoc2-docstring} bumpversion.cli.sample_config -:parser: myst -``` -```` - -````{py:function} show_bump(version: str, config_file: typing.Optional[str], ascii: bool) -> None -:canonical: bumpversion.cli.show_bump - -```{autodoc2-docstring} bumpversion.cli.show_bump -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.config.create.md b/docsrc/reference/bumpversion/bumpversion.config.create.md deleted file mode 100644 index 18cee559..00000000 --- a/docsrc/reference/bumpversion/bumpversion.config.create.md +++ /dev/null @@ -1,47 +0,0 @@ -# {py:mod}`bumpversion.config.create` - -```{py:module} bumpversion.config.create -``` - -```{autodoc2-docstring} bumpversion.config.create -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`create_configuration ` - - ```{autodoc2-docstring} bumpversion.config.create.create_configuration - :parser: myst - :summary: - ``` -* - {py:obj}`get_defaults_from_dest ` - - ```{autodoc2-docstring} bumpversion.config.create.get_defaults_from_dest - :parser: myst - :summary: - ``` -```` - -### API - -````{py:function} create_configuration(destination: str, prompt: bool) -> tomlkit.TOMLDocument -:canonical: bumpversion.config.create.create_configuration - -```{autodoc2-docstring} bumpversion.config.create.create_configuration -:parser: myst -``` -```` - -````{py:function} get_defaults_from_dest(destination: str) -> typing.Tuple[dict, tomlkit.TOMLDocument] -:canonical: bumpversion.config.create.get_defaults_from_dest - -```{autodoc2-docstring} bumpversion.config.create.get_defaults_from_dest -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.config.files.md b/docsrc/reference/bumpversion/bumpversion.config.files.md deleted file mode 100644 index c32aff82..00000000 --- a/docsrc/reference/bumpversion/bumpversion.config.files.md +++ /dev/null @@ -1,113 +0,0 @@ -# {py:mod}`bumpversion.config.files` - -```{py:module} bumpversion.config.files -``` - -```{autodoc2-docstring} bumpversion.config.files -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`find_config_file ` - - ```{autodoc2-docstring} bumpversion.config.files.find_config_file - :parser: myst - :summary: - ``` -* - {py:obj}`read_config_file ` - - ```{autodoc2-docstring} bumpversion.config.files.read_config_file - :parser: myst - :summary: - ``` -* - {py:obj}`read_toml_file ` - - ```{autodoc2-docstring} bumpversion.config.files.read_toml_file - :parser: myst - :summary: - ``` -* - {py:obj}`update_config_file ` - - ```{autodoc2-docstring} bumpversion.config.files.update_config_file - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.config.files.logger - :parser: myst - :summary: - ``` -* - {py:obj}`CONFIG_FILE_SEARCH_ORDER ` - - ```{autodoc2-docstring} bumpversion.config.files.CONFIG_FILE_SEARCH_ORDER - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.config.files.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.config.files.logger -:parser: myst -``` - -```` - -````{py:data} CONFIG_FILE_SEARCH_ORDER -:canonical: bumpversion.config.files.CONFIG_FILE_SEARCH_ORDER -:value: > - ('.bumpversion.cfg', '.bumpversion.toml', 'setup.cfg', 'pyproject.toml') - -```{autodoc2-docstring} bumpversion.config.files.CONFIG_FILE_SEARCH_ORDER -:parser: myst -``` - -```` - -````{py:function} find_config_file(explicit_file: typing.Union[str, pathlib.Path, None] = None) -> typing.Union[pathlib.Path, None] -:canonical: bumpversion.config.files.find_config_file - -```{autodoc2-docstring} bumpversion.config.files.find_config_file -:parser: myst -``` -```` - -````{py:function} read_config_file(config_file: typing.Union[str, pathlib.Path, None] = None) -> typing.Dict[str, typing.Any] -:canonical: bumpversion.config.files.read_config_file - -```{autodoc2-docstring} bumpversion.config.files.read_config_file -:parser: myst -``` -```` - -````{py:function} read_toml_file(file_path: pathlib.Path) -> typing.Dict[str, typing.Any] -:canonical: bumpversion.config.files.read_toml_file - -```{autodoc2-docstring} bumpversion.config.files.read_toml_file -:parser: myst -``` -```` - -````{py:function} update_config_file(config_file: typing.Union[str, pathlib.Path], config: bumpversion.config.models.Config, current_version: bumpversion.versioning.models.Version, new_version: bumpversion.versioning.models.Version, context: typing.MutableMapping, dry_run: bool = False) -> None -:canonical: bumpversion.config.files.update_config_file - -```{autodoc2-docstring} bumpversion.config.files.update_config_file -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.config.files_legacy.md b/docsrc/reference/bumpversion/bumpversion.config.files_legacy.md deleted file mode 100644 index 69a0c19f..00000000 --- a/docsrc/reference/bumpversion/bumpversion.config.files_legacy.md +++ /dev/null @@ -1,71 +0,0 @@ -# {py:mod}`bumpversion.config.files_legacy` - -```{py:module} bumpversion.config.files_legacy -``` - -```{autodoc2-docstring} bumpversion.config.files_legacy -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`read_ini_file ` - - ```{autodoc2-docstring} bumpversion.config.files_legacy.read_ini_file - :parser: myst - :summary: - ``` -* - {py:obj}`update_ini_config_file ` - - ```{autodoc2-docstring} bumpversion.config.files_legacy.update_ini_config_file - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.config.files_legacy.logger - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.config.files_legacy.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.config.files_legacy.logger -:parser: myst -``` - -```` - -````{py:function} read_ini_file(file_path: pathlib.Path) -> typing.Dict[str, typing.Any] -:canonical: bumpversion.config.files_legacy.read_ini_file - -```{autodoc2-docstring} bumpversion.config.files_legacy.read_ini_file -:parser: myst -``` -```` - -````{py:function} update_ini_config_file(config_file: typing.Union[str, pathlib.Path], current_version: str, new_version: str, dry_run: bool = False) -> None -:canonical: bumpversion.config.files_legacy.update_ini_config_file - -```{autodoc2-docstring} bumpversion.config.files_legacy.update_ini_config_file -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.config.md b/docsrc/reference/bumpversion/bumpversion.config.md deleted file mode 100644 index 60a744d0..00000000 --- a/docsrc/reference/bumpversion/bumpversion.config.md +++ /dev/null @@ -1,100 +0,0 @@ -# {py:mod}`bumpversion.config` - -```{py:module} bumpversion.config -``` - -```{autodoc2-docstring} bumpversion.config -:parser: myst -:allowtitles: -``` - -## Submodules - -```{toctree} -:titlesonly: -:maxdepth: 1 - -bumpversion.config.files -bumpversion.config.models -bumpversion.config.create -bumpversion.config.files_legacy -bumpversion.config.utils -``` - -## Package Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`get_configuration ` - - ```{autodoc2-docstring} bumpversion.config.get_configuration - :parser: myst - :summary: - ``` -* - {py:obj}`check_current_version ` - - ```{autodoc2-docstring} bumpversion.config.check_current_version - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.config.logger - :parser: myst - :summary: - ``` -* - {py:obj}`DEFAULTS ` - - ```{autodoc2-docstring} bumpversion.config.DEFAULTS - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.config.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.config.logger -:parser: myst -``` - -```` - -````{py:data} DEFAULTS -:canonical: bumpversion.config.DEFAULTS -:value: > - None - -```{autodoc2-docstring} bumpversion.config.DEFAULTS -:parser: myst -``` - -```` - -````{py:function} get_configuration(config_file: typing.Union[str, pathlib.Path, None] = None, **overrides) -> bumpversion.config.models.Config -:canonical: bumpversion.config.get_configuration - -```{autodoc2-docstring} bumpversion.config.get_configuration -:parser: myst -``` -```` - -````{py:function} check_current_version(config: bumpversion.config.models.Config) -> str -:canonical: bumpversion.config.check_current_version - -```{autodoc2-docstring} bumpversion.config.check_current_version -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.config.models.md b/docsrc/reference/bumpversion/bumpversion.config.models.md deleted file mode 100644 index 18034e92..00000000 --- a/docsrc/reference/bumpversion/bumpversion.config.models.md +++ /dev/null @@ -1,537 +0,0 @@ -# {py:mod}`bumpversion.config.models` - -```{py:module} bumpversion.config.models -``` - -```{autodoc2-docstring} bumpversion.config.models -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`FileChange ` - - ```{autodoc2-docstring} bumpversion.config.models.FileChange - :parser: myst - :summary: - ``` -* - {py:obj}`Config ` - - ```{autodoc2-docstring} bumpversion.config.models.Config - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.config.models.logger - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.config.models.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.config.models.logger -:parser: myst -``` - -```` - -`````{py:class} FileChange(**data: typing.Any) -:canonical: bumpversion.config.models.FileChange - -Bases: {py:obj}`pydantic.BaseModel` - -```{autodoc2-docstring} bumpversion.config.models.FileChange -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.config.models.FileChange.__init__ -:parser: myst -``` - -````{py:attribute} parse -:canonical: bumpversion.config.models.FileChange.parse -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.FileChange.parse -:parser: myst -``` - -```` - -````{py:attribute} serialize -:canonical: bumpversion.config.models.FileChange.serialize -:type: tuple -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.FileChange.serialize -:parser: myst -``` - -```` - -````{py:attribute} search -:canonical: bumpversion.config.models.FileChange.search -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.FileChange.search -:parser: myst -``` - -```` - -````{py:attribute} replace -:canonical: bumpversion.config.models.FileChange.replace -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.FileChange.replace -:parser: myst -``` - -```` - -````{py:attribute} regex -:canonical: bumpversion.config.models.FileChange.regex -:type: bool -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.FileChange.regex -:parser: myst -``` - -```` - -````{py:attribute} ignore_missing_version -:canonical: bumpversion.config.models.FileChange.ignore_missing_version -:type: bool -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.FileChange.ignore_missing_version -:parser: myst -``` - -```` - -````{py:attribute} filename -:canonical: bumpversion.config.models.FileChange.filename -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.FileChange.filename -:parser: myst -``` - -```` - -````{py:attribute} glob -:canonical: bumpversion.config.models.FileChange.glob -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.FileChange.glob -:parser: myst -``` - -```` - -````{py:attribute} key_path -:canonical: bumpversion.config.models.FileChange.key_path -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.FileChange.key_path -:parser: myst -``` - -```` - -````{py:method} __hash__() -:canonical: bumpversion.config.models.FileChange.__hash__ - -```{autodoc2-docstring} bumpversion.config.models.FileChange.__hash__ -:parser: myst -``` - -```` - -````{py:method} get_search_pattern(context: typing.MutableMapping) -> typing.Tuple[re.Pattern, str] -:canonical: bumpversion.config.models.FileChange.get_search_pattern - -```{autodoc2-docstring} bumpversion.config.models.FileChange.get_search_pattern -:parser: myst -``` - -```` - -````` - -`````{py:class} Config(_case_sensitive: bool | None = None, _env_prefix: str | None = None, _env_file: pydantic_settings.sources.DotenvType | None = ENV_FILE_SENTINEL, _env_file_encoding: str | None = None, _env_nested_delimiter: str | None = None, _secrets_dir: str | pathlib.Path | None = None, **values: typing.Any) -:canonical: bumpversion.config.models.Config - -Bases: {py:obj}`pydantic_settings.BaseSettings` - -```{autodoc2-docstring} bumpversion.config.models.Config -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.config.models.Config.__init__ -:parser: myst -``` - -````{py:attribute} current_version -:canonical: bumpversion.config.models.Config.current_version -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.current_version -:parser: myst -``` - -```` - -````{py:attribute} parse -:canonical: bumpversion.config.models.Config.parse -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.parse -:parser: myst -``` - -```` - -````{py:attribute} serialize -:canonical: bumpversion.config.models.Config.serialize -:type: tuple -:value: > - 'Field(...)' - -```{autodoc2-docstring} bumpversion.config.models.Config.serialize -:parser: myst -``` - -```` - -````{py:attribute} search -:canonical: bumpversion.config.models.Config.search -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.search -:parser: myst -``` - -```` - -````{py:attribute} replace -:canonical: bumpversion.config.models.Config.replace -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.replace -:parser: myst -``` - -```` - -````{py:attribute} regex -:canonical: bumpversion.config.models.Config.regex -:type: bool -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.regex -:parser: myst -``` - -```` - -````{py:attribute} ignore_missing_version -:canonical: bumpversion.config.models.Config.ignore_missing_version -:type: bool -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.ignore_missing_version -:parser: myst -``` - -```` - -````{py:attribute} tag -:canonical: bumpversion.config.models.Config.tag -:type: bool -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.tag -:parser: myst -``` - -```` - -````{py:attribute} sign_tags -:canonical: bumpversion.config.models.Config.sign_tags -:type: bool -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.sign_tags -:parser: myst -``` - -```` - -````{py:attribute} tag_name -:canonical: bumpversion.config.models.Config.tag_name -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.tag_name -:parser: myst -``` - -```` - -````{py:attribute} tag_message -:canonical: bumpversion.config.models.Config.tag_message -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.tag_message -:parser: myst -``` - -```` - -````{py:attribute} allow_dirty -:canonical: bumpversion.config.models.Config.allow_dirty -:type: bool -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.allow_dirty -:parser: myst -``` - -```` - -````{py:attribute} commit -:canonical: bumpversion.config.models.Config.commit -:type: bool -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.commit -:parser: myst -``` - -```` - -````{py:attribute} message -:canonical: bumpversion.config.models.Config.message -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.message -:parser: myst -``` - -```` - -````{py:attribute} commit_args -:canonical: bumpversion.config.models.Config.commit_args -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.commit_args -:parser: myst -``` - -```` - -````{py:attribute} scm_info -:canonical: bumpversion.config.models.Config.scm_info -:type: typing.Optional[bumpversion.scm.SCMInfo] -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.scm_info -:parser: myst -``` - -```` - -````{py:attribute} parts -:canonical: bumpversion.config.models.Config.parts -:type: typing.Dict[str, bumpversion.versioning.models.VersionComponentSpec] -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config.parts -:parser: myst -``` - -```` - -````{py:attribute} files -:canonical: bumpversion.config.models.Config.files -:type: typing.List[bumpversion.config.models.FileChange] -:value: > - 'Field(...)' - -```{autodoc2-docstring} bumpversion.config.models.Config.files -:parser: myst -``` - -```` - -````{py:attribute} included_paths -:canonical: bumpversion.config.models.Config.included_paths -:type: typing.List[str] -:value: > - 'Field(...)' - -```{autodoc2-docstring} bumpversion.config.models.Config.included_paths -:parser: myst -``` - -```` - -````{py:attribute} excluded_paths -:canonical: bumpversion.config.models.Config.excluded_paths -:type: typing.List[str] -:value: > - 'Field(...)' - -```{autodoc2-docstring} bumpversion.config.models.Config.excluded_paths -:parser: myst -``` - -```` - -````{py:attribute} model_config -:canonical: bumpversion.config.models.Config.model_config -:value: > - 'SettingsConfigDict(...)' - -```{autodoc2-docstring} bumpversion.config.models.Config.model_config -:parser: myst -``` - -```` - -````{py:attribute} _resolved_filemap -:canonical: bumpversion.config.models.Config._resolved_filemap -:type: typing.Optional[typing.Dict[str, typing.List[bumpversion.config.models.FileChange]]] -:value: > - None - -```{autodoc2-docstring} bumpversion.config.models.Config._resolved_filemap -:parser: myst -``` - -```` - -````{py:method} add_files(filename: typing.Union[str, typing.List[str]]) -> None -:canonical: bumpversion.config.models.Config.add_files - -```{autodoc2-docstring} bumpversion.config.models.Config.add_files -:parser: myst -``` - -```` - -````{py:property} resolved_filemap -:canonical: bumpversion.config.models.Config.resolved_filemap -:type: typing.Dict[str, typing.List[bumpversion.config.models.FileChange]] - -```{autodoc2-docstring} bumpversion.config.models.Config.resolved_filemap -:parser: myst -``` - -```` - -````{py:method} _resolve_filemap() -> typing.Dict[str, typing.List[bumpversion.config.models.FileChange]] -:canonical: bumpversion.config.models.Config._resolve_filemap - -```{autodoc2-docstring} bumpversion.config.models.Config._resolve_filemap -:parser: myst -``` - -```` - -````{py:property} files_to_modify -:canonical: bumpversion.config.models.Config.files_to_modify -:type: typing.List[bumpversion.config.models.FileChange] - -```{autodoc2-docstring} bumpversion.config.models.Config.files_to_modify -:parser: myst -``` - -```` - -````{py:property} version_config -:canonical: bumpversion.config.models.Config.version_config -:type: bumpversion.version_part.VersionConfig - -```{autodoc2-docstring} bumpversion.config.models.Config.version_config -:parser: myst -``` - -```` - -````{py:method} version_spec(version: typing.Optional[str] = None) -> bumpversion.versioning.models.VersionSpec -:canonical: bumpversion.config.models.Config.version_spec - -```{autodoc2-docstring} bumpversion.config.models.Config.version_spec -:parser: myst -``` - -```` - -````` diff --git a/docsrc/reference/bumpversion/bumpversion.config.utils.md b/docsrc/reference/bumpversion/bumpversion.config.utils.md deleted file mode 100644 index e0c481fd..00000000 --- a/docsrc/reference/bumpversion/bumpversion.config.utils.md +++ /dev/null @@ -1,60 +0,0 @@ -# {py:mod}`bumpversion.config.utils` - -```{py:module} bumpversion.config.utils -``` - -```{autodoc2-docstring} bumpversion.config.utils -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`get_all_file_configs ` - - ```{autodoc2-docstring} bumpversion.config.utils.get_all_file_configs - :parser: myst - :summary: - ``` -* - {py:obj}`get_all_part_configs ` - - ```{autodoc2-docstring} bumpversion.config.utils.get_all_part_configs - :parser: myst - :summary: - ``` -* - {py:obj}`resolve_glob_files ` - - ```{autodoc2-docstring} bumpversion.config.utils.resolve_glob_files - :parser: myst - :summary: - ``` -```` - -### API - -````{py:function} get_all_file_configs(config_dict: dict) -> typing.List[bumpversion.config.models.FileChange] -:canonical: bumpversion.config.utils.get_all_file_configs - -```{autodoc2-docstring} bumpversion.config.utils.get_all_file_configs -:parser: myst -``` -```` - -````{py:function} get_all_part_configs(config_dict: dict) -> typing.Dict[str, bumpversion.versioning.models.VersionComponentSpec] -:canonical: bumpversion.config.utils.get_all_part_configs - -```{autodoc2-docstring} bumpversion.config.utils.get_all_part_configs -:parser: myst -``` -```` - -````{py:function} resolve_glob_files(file_cfg: bumpversion.config.models.FileChange) -> typing.List[bumpversion.config.models.FileChange] -:canonical: bumpversion.config.utils.resolve_glob_files - -```{autodoc2-docstring} bumpversion.config.utils.resolve_glob_files -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.exceptions.md b/docsrc/reference/bumpversion/bumpversion.exceptions.md deleted file mode 100644 index 9aabf6b0..00000000 --- a/docsrc/reference/bumpversion/bumpversion.exceptions.md +++ /dev/null @@ -1,175 +0,0 @@ -# {py:mod}`bumpversion.exceptions` - -```{py:module} bumpversion.exceptions -``` - -```{autodoc2-docstring} bumpversion.exceptions -:parser: myst -:allowtitles: -``` - -## Module Contents - -### API - -````{py:exception} BumpVersionError(message: str, ctx: typing.Optional[click.Context] = None) -:canonical: bumpversion.exceptions.BumpVersionError - -Bases: {py:obj}`click.UsageError` - -```{autodoc2-docstring} bumpversion.exceptions.BumpVersionError -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.exceptions.BumpVersionError.__init__ -:parser: myst -``` - -```` - -````{py:exception} FormattingError(message: str, ctx: typing.Optional[click.Context] = None) -:canonical: bumpversion.exceptions.FormattingError - -Bases: {py:obj}`bumpversion.exceptions.BumpVersionError` - -```{autodoc2-docstring} bumpversion.exceptions.FormattingError -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.exceptions.FormattingError.__init__ -:parser: myst -``` - -```` - -````{py:exception} MissingValueError(message: str, ctx: typing.Optional[click.Context] = None) -:canonical: bumpversion.exceptions.MissingValueError - -Bases: {py:obj}`bumpversion.exceptions.BumpVersionError` - -```{autodoc2-docstring} bumpversion.exceptions.MissingValueError -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.exceptions.MissingValueError.__init__ -:parser: myst -``` - -```` - -````{py:exception} DirtyWorkingDirectoryError(message: str, ctx: typing.Optional[click.Context] = None) -:canonical: bumpversion.exceptions.DirtyWorkingDirectoryError - -Bases: {py:obj}`bumpversion.exceptions.BumpVersionError` - -```{autodoc2-docstring} bumpversion.exceptions.DirtyWorkingDirectoryError -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.exceptions.DirtyWorkingDirectoryError.__init__ -:parser: myst -``` - -```` - -````{py:exception} SignedTagsError(message: str, ctx: typing.Optional[click.Context] = None) -:canonical: bumpversion.exceptions.SignedTagsError - -Bases: {py:obj}`bumpversion.exceptions.BumpVersionError` - -```{autodoc2-docstring} bumpversion.exceptions.SignedTagsError -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.exceptions.SignedTagsError.__init__ -:parser: myst -``` - -```` - -````{py:exception} VersionNotFoundError(message: str, ctx: typing.Optional[click.Context] = None) -:canonical: bumpversion.exceptions.VersionNotFoundError - -Bases: {py:obj}`bumpversion.exceptions.BumpVersionError` - -```{autodoc2-docstring} bumpversion.exceptions.VersionNotFoundError -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.exceptions.VersionNotFoundError.__init__ -:parser: myst -``` - -```` - -````{py:exception} InvalidVersionPartError(message: str, ctx: typing.Optional[click.Context] = None) -:canonical: bumpversion.exceptions.InvalidVersionPartError - -Bases: {py:obj}`bumpversion.exceptions.BumpVersionError` - -```{autodoc2-docstring} bumpversion.exceptions.InvalidVersionPartError -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.exceptions.InvalidVersionPartError.__init__ -:parser: myst -``` - -```` - -````{py:exception} ConfigurationError(message: str, ctx: typing.Optional[click.Context] = None) -:canonical: bumpversion.exceptions.ConfigurationError - -Bases: {py:obj}`bumpversion.exceptions.BumpVersionError` - -```{autodoc2-docstring} bumpversion.exceptions.ConfigurationError -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.exceptions.ConfigurationError.__init__ -:parser: myst -``` - -```` - -````{py:exception} BadInputError(message: str, ctx: typing.Optional[click.Context] = None) -:canonical: bumpversion.exceptions.BadInputError - -Bases: {py:obj}`bumpversion.exceptions.BumpVersionError` - -```{autodoc2-docstring} bumpversion.exceptions.BadInputError -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.exceptions.BadInputError.__init__ -:parser: myst -``` - -```` diff --git a/docsrc/reference/bumpversion/bumpversion.files.md b/docsrc/reference/bumpversion/bumpversion.files.md deleted file mode 100644 index 66835fb7..00000000 --- a/docsrc/reference/bumpversion/bumpversion.files.md +++ /dev/null @@ -1,241 +0,0 @@ -# {py:mod}`bumpversion.files` - -```{py:module} bumpversion.files -``` - -```{autodoc2-docstring} bumpversion.files -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`ConfiguredFile ` - - ```{autodoc2-docstring} bumpversion.files.ConfiguredFile - :parser: myst - :summary: - ``` -* - {py:obj}`FileUpdater ` - - ```{autodoc2-docstring} bumpversion.files.FileUpdater - :parser: myst - :summary: - ``` -* - {py:obj}`DataFileUpdater ` - - ```{autodoc2-docstring} bumpversion.files.DataFileUpdater - :parser: myst - :summary: - ``` -```` - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`contains_pattern ` - - ```{autodoc2-docstring} bumpversion.files.contains_pattern - :parser: myst - :summary: - ``` -* - {py:obj}`log_changes ` - - ```{autodoc2-docstring} bumpversion.files.log_changes - :parser: myst - :summary: - ``` -* - {py:obj}`resolve_file_config ` - - ```{autodoc2-docstring} bumpversion.files.resolve_file_config - :parser: myst - :summary: - ``` -* - {py:obj}`modify_files ` - - ```{autodoc2-docstring} bumpversion.files.modify_files - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.files.logger - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.files.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.files.logger -:parser: myst -``` - -```` - -````{py:function} contains_pattern(search: re.Pattern, contents: str) -> bool -:canonical: bumpversion.files.contains_pattern - -```{autodoc2-docstring} bumpversion.files.contains_pattern -:parser: myst -``` -```` - -````{py:function} log_changes(file_path: str, file_content_before: str, file_content_after: str, dry_run: bool = False) -> None -:canonical: bumpversion.files.log_changes - -```{autodoc2-docstring} bumpversion.files.log_changes -:parser: myst -``` -```` - -`````{py:class} ConfiguredFile(file_change: bumpversion.config.models.FileChange, version_config: bumpversion.version_part.VersionConfig, search: typing.Optional[str] = None, replace: typing.Optional[str] = None) -:canonical: bumpversion.files.ConfiguredFile - -```{autodoc2-docstring} bumpversion.files.ConfiguredFile -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.files.ConfiguredFile.__init__ -:parser: myst -``` - -````{py:method} get_file_contents() -> str -:canonical: bumpversion.files.ConfiguredFile.get_file_contents - -```{autodoc2-docstring} bumpversion.files.ConfiguredFile.get_file_contents -:parser: myst -``` - -```` - -````{py:method} write_file_contents(contents: str) -> None -:canonical: bumpversion.files.ConfiguredFile.write_file_contents - -```{autodoc2-docstring} bumpversion.files.ConfiguredFile.write_file_contents -:parser: myst -``` - -```` - -````{py:method} _contains_change_pattern(search_expression: re.Pattern, raw_search_expression: str, version: bumpversion.versioning.models.Version, context: typing.MutableMapping) -> bool -:canonical: bumpversion.files.ConfiguredFile._contains_change_pattern - -```{autodoc2-docstring} bumpversion.files.ConfiguredFile._contains_change_pattern -:parser: myst -``` - -```` - -````{py:method} make_file_change(current_version: bumpversion.versioning.models.Version, new_version: bumpversion.versioning.models.Version, context: typing.MutableMapping, dry_run: bool = False) -> None -:canonical: bumpversion.files.ConfiguredFile.make_file_change - -```{autodoc2-docstring} bumpversion.files.ConfiguredFile.make_file_change -:parser: myst -``` - -```` - -````{py:method} __str__() -> str -:canonical: bumpversion.files.ConfiguredFile.__str__ - -```` - -````{py:method} __repr__() -> str -:canonical: bumpversion.files.ConfiguredFile.__repr__ - -```` - -````` - -````{py:function} resolve_file_config(files: typing.List[bumpversion.config.models.FileChange], version_config: bumpversion.version_part.VersionConfig, search: typing.Optional[str] = None, replace: typing.Optional[str] = None) -> typing.List[bumpversion.files.ConfiguredFile] -:canonical: bumpversion.files.resolve_file_config - -```{autodoc2-docstring} bumpversion.files.resolve_file_config -:parser: myst -``` -```` - -````{py:function} modify_files(files: typing.List[bumpversion.files.ConfiguredFile], current_version: bumpversion.versioning.models.Version, new_version: bumpversion.versioning.models.Version, context: typing.MutableMapping, dry_run: bool = False) -> None -:canonical: bumpversion.files.modify_files - -```{autodoc2-docstring} bumpversion.files.modify_files -:parser: myst -``` -```` - -`````{py:class} FileUpdater(file_change: bumpversion.config.models.FileChange, version_config: bumpversion.version_part.VersionConfig, search: typing.Optional[str] = None, replace: typing.Optional[str] = None) -:canonical: bumpversion.files.FileUpdater - -```{autodoc2-docstring} bumpversion.files.FileUpdater -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.files.FileUpdater.__init__ -:parser: myst -``` - -````{py:method} update_file(current_version: bumpversion.versioning.models.Version, new_version: bumpversion.versioning.models.Version, context: typing.MutableMapping, dry_run: bool = False) -> None -:canonical: bumpversion.files.FileUpdater.update_file - -```{autodoc2-docstring} bumpversion.files.FileUpdater.update_file -:parser: myst -``` - -```` - -````` - -`````{py:class} DataFileUpdater(file_change: bumpversion.config.models.FileChange, version_part_configs: typing.Dict[str, bumpversion.versioning.models.VersionComponentSpec]) -:canonical: bumpversion.files.DataFileUpdater - -```{autodoc2-docstring} bumpversion.files.DataFileUpdater -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.files.DataFileUpdater.__init__ -:parser: myst -``` - -````{py:method} update_file(current_version: bumpversion.versioning.models.Version, new_version: bumpversion.versioning.models.Version, context: typing.MutableMapping, dry_run: bool = False) -> None -:canonical: bumpversion.files.DataFileUpdater.update_file - -```{autodoc2-docstring} bumpversion.files.DataFileUpdater.update_file -:parser: myst -``` - -```` - -````{py:method} _update_toml_file(search_for: re.Pattern, raw_search_pattern: str, replace_with: str, dry_run: bool = False) -> None -:canonical: bumpversion.files.DataFileUpdater._update_toml_file - -```{autodoc2-docstring} bumpversion.files.DataFileUpdater._update_toml_file -:parser: myst -``` - -```` - -````` diff --git a/docsrc/reference/bumpversion/bumpversion.indented_logger.md b/docsrc/reference/bumpversion/bumpversion.indented_logger.md deleted file mode 100644 index 6818cb89..00000000 --- a/docsrc/reference/bumpversion/bumpversion.indented_logger.md +++ /dev/null @@ -1,124 +0,0 @@ -# {py:mod}`bumpversion.indented_logger` - -```{py:module} bumpversion.indented_logger -``` - -```{autodoc2-docstring} bumpversion.indented_logger -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`IndentedLoggerAdapter ` - - ```{autodoc2-docstring} bumpversion.indented_logger.IndentedLoggerAdapter - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`CURRENT_INDENT ` - - ```{autodoc2-docstring} bumpversion.indented_logger.CURRENT_INDENT - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} CURRENT_INDENT -:canonical: bumpversion.indented_logger.CURRENT_INDENT -:value: > - 'ContextVar(...)' - -```{autodoc2-docstring} bumpversion.indented_logger.CURRENT_INDENT -:parser: myst -``` - -```` - -`````{py:class} IndentedLoggerAdapter(logger: logging.Logger, extra: typing.Optional[dict] = None, depth: int = 2, indent_char: str = ' ', reset: bool = False) -:canonical: bumpversion.indented_logger.IndentedLoggerAdapter - -Bases: {py:obj}`logging.LoggerAdapter` - -```{autodoc2-docstring} bumpversion.indented_logger.IndentedLoggerAdapter -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.indented_logger.IndentedLoggerAdapter.__init__ -:parser: myst -``` - -````{py:property} current_indent -:canonical: bumpversion.indented_logger.IndentedLoggerAdapter.current_indent -:type: int - -```{autodoc2-docstring} bumpversion.indented_logger.IndentedLoggerAdapter.current_indent -:parser: myst -``` - -```` - -````{py:method} indent(amount: int = 1) -> None -:canonical: bumpversion.indented_logger.IndentedLoggerAdapter.indent - -```{autodoc2-docstring} bumpversion.indented_logger.IndentedLoggerAdapter.indent -:parser: myst -``` - -```` - -````{py:method} dedent(amount: int = 1) -> None -:canonical: bumpversion.indented_logger.IndentedLoggerAdapter.dedent - -```{autodoc2-docstring} bumpversion.indented_logger.IndentedLoggerAdapter.dedent -:parser: myst -``` - -```` - -````{py:method} reset() -> None -:canonical: bumpversion.indented_logger.IndentedLoggerAdapter.reset - -```{autodoc2-docstring} bumpversion.indented_logger.IndentedLoggerAdapter.reset -:parser: myst -``` - -```` - -````{py:property} indent_str -:canonical: bumpversion.indented_logger.IndentedLoggerAdapter.indent_str -:type: str - -```{autodoc2-docstring} bumpversion.indented_logger.IndentedLoggerAdapter.indent_str -:parser: myst -``` - -```` - -````{py:method} process(msg: str, kwargs: typing.Optional[typing.MutableMapping[str, typing.Any]]) -> typing.Tuple[str, typing.MutableMapping[str, typing.Any]] -:canonical: bumpversion.indented_logger.IndentedLoggerAdapter.process - -```{autodoc2-docstring} bumpversion.indented_logger.IndentedLoggerAdapter.process -:parser: myst -``` - -```` - -````` diff --git a/docsrc/reference/bumpversion/bumpversion.md b/docsrc/reference/bumpversion/bumpversion.md deleted file mode 100644 index 348a25b4..00000000 --- a/docsrc/reference/bumpversion/bumpversion.md +++ /dev/null @@ -1,71 +0,0 @@ -# {py:mod}`bumpversion` - -```{py:module} bumpversion -``` - -```{autodoc2-docstring} bumpversion -:parser: myst -:allowtitles: -``` - -## Subpackages - -```{toctree} -:titlesonly: -:maxdepth: 3 - -bumpversion.config -bumpversion.versioning -``` - -## Submodules - -```{toctree} -:titlesonly: -:maxdepth: 1 - -bumpversion.version_part -bumpversion.files -bumpversion.show -bumpversion.indented_logger -bumpversion.ui -bumpversion.autocast -bumpversion.visualize -bumpversion.aliases -bumpversion.cli -bumpversion.utils -bumpversion.bump -bumpversion.exceptions -bumpversion.scm -bumpversion.yaml_dump -bumpversion.__main__ -``` - -## Package Contents - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`__version__ ` - - ```{autodoc2-docstring} bumpversion.__version__ - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} __version__ -:canonical: bumpversion.__version__ -:type: str -:value: > - '0.17.4' - -```{autodoc2-docstring} bumpversion.__version__ -:parser: myst -``` - -```` diff --git a/docsrc/reference/bumpversion/bumpversion.scm.md b/docsrc/reference/bumpversion/bumpversion.scm.md deleted file mode 100644 index a4143205..00000000 --- a/docsrc/reference/bumpversion/bumpversion.scm.md +++ /dev/null @@ -1,522 +0,0 @@ -# {py:mod}`bumpversion.scm` - -```{py:module} bumpversion.scm -``` - -```{autodoc2-docstring} bumpversion.scm -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`SCMInfo ` - - ```{autodoc2-docstring} bumpversion.scm.SCMInfo - :parser: myst - :summary: - ``` -* - {py:obj}`SourceCodeManager ` - - ```{autodoc2-docstring} bumpversion.scm.SourceCodeManager - :parser: myst - :summary: - ``` -* - {py:obj}`Git ` - - ```{autodoc2-docstring} bumpversion.scm.Git - :parser: myst - :summary: - ``` -* - {py:obj}`Mercurial ` - - ```{autodoc2-docstring} bumpversion.scm.Mercurial - :parser: myst - :summary: - ``` -```` - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`get_scm_info ` - - ```{autodoc2-docstring} bumpversion.scm.get_scm_info - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.scm.logger - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.scm.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.scm.logger -:parser: myst -``` - -```` - -`````{py:class} SCMInfo -:canonical: bumpversion.scm.SCMInfo - -```{autodoc2-docstring} bumpversion.scm.SCMInfo -:parser: myst -``` - -````{py:attribute} tool -:canonical: bumpversion.scm.SCMInfo.tool -:type: typing.Optional[typing.Type[SourceCodeManager]] -:value: > - None - -```{autodoc2-docstring} bumpversion.scm.SCMInfo.tool -:parser: myst -``` - -```` - -````{py:attribute} commit_sha -:canonical: bumpversion.scm.SCMInfo.commit_sha -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.scm.SCMInfo.commit_sha -:parser: myst -``` - -```` - -````{py:attribute} distance_to_latest_tag -:canonical: bumpversion.scm.SCMInfo.distance_to_latest_tag -:type: int -:value: > - 0 - -```{autodoc2-docstring} bumpversion.scm.SCMInfo.distance_to_latest_tag -:parser: myst -``` - -```` - -````{py:attribute} current_version -:canonical: bumpversion.scm.SCMInfo.current_version -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.scm.SCMInfo.current_version -:parser: myst -``` - -```` - -````{py:attribute} branch_name -:canonical: bumpversion.scm.SCMInfo.branch_name -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.scm.SCMInfo.branch_name -:parser: myst -``` - -```` - -````{py:attribute} short_branch_name -:canonical: bumpversion.scm.SCMInfo.short_branch_name -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.scm.SCMInfo.short_branch_name -:parser: myst -``` - -```` - -````{py:attribute} dirty -:canonical: bumpversion.scm.SCMInfo.dirty -:type: typing.Optional[bool] -:value: > - None - -```{autodoc2-docstring} bumpversion.scm.SCMInfo.dirty -:parser: myst -``` - -```` - -````{py:method} __str__() -:canonical: bumpversion.scm.SCMInfo.__str__ - -```` - -````{py:method} __repr__() -:canonical: bumpversion.scm.SCMInfo.__repr__ - -```` - -````` - -`````{py:class} SourceCodeManager -:canonical: bumpversion.scm.SourceCodeManager - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager -:parser: myst -``` - -````{py:attribute} _TEST_USABLE_COMMAND -:canonical: bumpversion.scm.SourceCodeManager._TEST_USABLE_COMMAND -:type: typing.ClassVar[typing.List[str]] -:value: > - [] - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager._TEST_USABLE_COMMAND -:parser: myst -``` - -```` - -````{py:attribute} _COMMIT_COMMAND -:canonical: bumpversion.scm.SourceCodeManager._COMMIT_COMMAND -:type: typing.ClassVar[typing.List[str]] -:value: > - [] - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager._COMMIT_COMMAND -:parser: myst -``` - -```` - -````{py:attribute} _ALL_TAGS_COMMAND -:canonical: bumpversion.scm.SourceCodeManager._ALL_TAGS_COMMAND -:type: typing.ClassVar[typing.List[str]] -:value: > - [] - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager._ALL_TAGS_COMMAND -:parser: myst -``` - -```` - -````{py:method} commit(message: str, current_version: str, new_version: str, extra_args: typing.Optional[list] = None) -> None -:canonical: bumpversion.scm.SourceCodeManager.commit -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.commit -:parser: myst -``` - -```` - -````{py:method} is_usable() -> bool -:canonical: bumpversion.scm.SourceCodeManager.is_usable -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.is_usable -:parser: myst -``` - -```` - -````{py:method} assert_nondirty() -> None -:canonical: bumpversion.scm.SourceCodeManager.assert_nondirty -:abstractmethod: -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.assert_nondirty -:parser: myst -``` - -```` - -````{py:method} latest_tag_info(tag_name: str, parse_pattern: str) -> bumpversion.scm.SCMInfo -:canonical: bumpversion.scm.SourceCodeManager.latest_tag_info -:abstractmethod: -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.latest_tag_info -:parser: myst -``` - -```` - -````{py:method} add_path(path: typing.Union[str, pathlib.Path]) -> None -:canonical: bumpversion.scm.SourceCodeManager.add_path -:abstractmethod: -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.add_path -:parser: myst -``` - -```` - -````{py:method} tag(name: str, sign: bool = False, message: typing.Optional[str] = None) -> None -:canonical: bumpversion.scm.SourceCodeManager.tag -:abstractmethod: -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.tag -:parser: myst -``` - -```` - -````{py:method} get_all_tags() -> typing.List[str] -:canonical: bumpversion.scm.SourceCodeManager.get_all_tags -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.get_all_tags -:parser: myst -``` - -```` - -````{py:method} get_version_from_tag(tag: str, tag_name: str, parse_pattern: str) -> typing.Optional[str] -:canonical: bumpversion.scm.SourceCodeManager.get_version_from_tag -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.get_version_from_tag -:parser: myst -``` - -```` - -````{py:method} commit_to_scm(files: typing.List[typing.Union[str, pathlib.Path]], config: bumpversion.config.Config, context: typing.MutableMapping, extra_args: typing.Optional[typing.List[str]] = None, dry_run: bool = False) -> None -:canonical: bumpversion.scm.SourceCodeManager.commit_to_scm -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.commit_to_scm -:parser: myst -``` - -```` - -````{py:method} tag_in_scm(config: bumpversion.config.Config, context: typing.MutableMapping, dry_run: bool = False) -> None -:canonical: bumpversion.scm.SourceCodeManager.tag_in_scm -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.SourceCodeManager.tag_in_scm -:parser: myst -``` - -```` - -````{py:method} __str__() -:canonical: bumpversion.scm.SourceCodeManager.__str__ - -```` - -````{py:method} __repr__() -:canonical: bumpversion.scm.SourceCodeManager.__repr__ - -```` - -````` - -`````{py:class} Git -:canonical: bumpversion.scm.Git - -Bases: {py:obj}`bumpversion.scm.SourceCodeManager` - -```{autodoc2-docstring} bumpversion.scm.Git -:parser: myst -``` - -````{py:attribute} _TEST_USABLE_COMMAND -:canonical: bumpversion.scm.Git._TEST_USABLE_COMMAND -:type: typing.ClassVar[typing.List[str]] -:value: > - ['git', 'rev-parse', '--git-dir'] - -```{autodoc2-docstring} bumpversion.scm.Git._TEST_USABLE_COMMAND -:parser: myst -``` - -```` - -````{py:attribute} _COMMIT_COMMAND -:canonical: bumpversion.scm.Git._COMMIT_COMMAND -:type: typing.ClassVar[typing.List[str]] -:value: > - ['git', 'commit', '-F'] - -```{autodoc2-docstring} bumpversion.scm.Git._COMMIT_COMMAND -:parser: myst -``` - -```` - -````{py:attribute} _ALL_TAGS_COMMAND -:canonical: bumpversion.scm.Git._ALL_TAGS_COMMAND -:type: typing.ClassVar[typing.List[str]] -:value: > - ['git', 'tag', '--list'] - -```{autodoc2-docstring} bumpversion.scm.Git._ALL_TAGS_COMMAND -:parser: myst -``` - -```` - -````{py:method} assert_nondirty() -> None -:canonical: bumpversion.scm.Git.assert_nondirty -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.Git.assert_nondirty -:parser: myst -``` - -```` - -````{py:method} latest_tag_info(tag_name: str, parse_pattern: str) -> bumpversion.scm.SCMInfo -:canonical: bumpversion.scm.Git.latest_tag_info -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.Git.latest_tag_info -:parser: myst -``` - -```` - -````{py:method} add_path(path: typing.Union[str, pathlib.Path]) -> None -:canonical: bumpversion.scm.Git.add_path -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.Git.add_path -:parser: myst -``` - -```` - -````{py:method} tag(name: str, sign: bool = False, message: typing.Optional[str] = None) -> None -:canonical: bumpversion.scm.Git.tag -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.Git.tag -:parser: myst -``` - -```` - -````` - -`````{py:class} Mercurial -:canonical: bumpversion.scm.Mercurial - -Bases: {py:obj}`bumpversion.scm.SourceCodeManager` - -```{autodoc2-docstring} bumpversion.scm.Mercurial -:parser: myst -``` - -````{py:attribute} _TEST_USABLE_COMMAND -:canonical: bumpversion.scm.Mercurial._TEST_USABLE_COMMAND -:type: typing.ClassVar[typing.List[str]] -:value: > - ['hg', 'root'] - -```{autodoc2-docstring} bumpversion.scm.Mercurial._TEST_USABLE_COMMAND -:parser: myst -``` - -```` - -````{py:attribute} _COMMIT_COMMAND -:canonical: bumpversion.scm.Mercurial._COMMIT_COMMAND -:type: typing.ClassVar[typing.List[str]] -:value: > - ['hg', 'commit', '--logfile'] - -```{autodoc2-docstring} bumpversion.scm.Mercurial._COMMIT_COMMAND -:parser: myst -``` - -```` - -````{py:attribute} _ALL_TAGS_COMMAND -:canonical: bumpversion.scm.Mercurial._ALL_TAGS_COMMAND -:type: typing.ClassVar[typing.List[str]] -:value: > - ['hg', 'log', '--rev="tag()"', '--template="{tags}\n"'] - -```{autodoc2-docstring} bumpversion.scm.Mercurial._ALL_TAGS_COMMAND -:parser: myst -``` - -```` - -````{py:method} latest_tag_info(tag_name: str, parse_pattern: str) -> bumpversion.scm.SCMInfo -:canonical: bumpversion.scm.Mercurial.latest_tag_info -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.Mercurial.latest_tag_info -:parser: myst -``` - -```` - -````{py:method} assert_nondirty() -> None -:canonical: bumpversion.scm.Mercurial.assert_nondirty -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.Mercurial.assert_nondirty -:parser: myst -``` - -```` - -````{py:method} add_path(path: typing.Union[str, pathlib.Path]) -> None -:canonical: bumpversion.scm.Mercurial.add_path -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.Mercurial.add_path -:parser: myst -``` - -```` - -````{py:method} tag(name: str, sign: bool = False, message: typing.Optional[str] = None) -> None -:canonical: bumpversion.scm.Mercurial.tag -:classmethod: - -```{autodoc2-docstring} bumpversion.scm.Mercurial.tag -:parser: myst -``` - -```` - -````` - -````{py:function} get_scm_info(tag_name: str, parse_pattern: str) -> bumpversion.scm.SCMInfo -:canonical: bumpversion.scm.get_scm_info - -```{autodoc2-docstring} bumpversion.scm.get_scm_info -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.show.md b/docsrc/reference/bumpversion/bumpversion.show.md deleted file mode 100644 index c10101d6..00000000 --- a/docsrc/reference/bumpversion/bumpversion.show.md +++ /dev/null @@ -1,123 +0,0 @@ -# {py:mod}`bumpversion.show` - -```{py:module} bumpversion.show -``` - -```{autodoc2-docstring} bumpversion.show -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`output_default ` - - ```{autodoc2-docstring} bumpversion.show.output_default - :parser: myst - :summary: - ``` -* - {py:obj}`output_yaml ` - - ```{autodoc2-docstring} bumpversion.show.output_yaml - :parser: myst - :summary: - ``` -* - {py:obj}`output_json ` - - ```{autodoc2-docstring} bumpversion.show.output_json - :parser: myst - :summary: - ``` -* - {py:obj}`resolve_name ` - - ```{autodoc2-docstring} bumpversion.show.resolve_name - :parser: myst - :summary: - ``` -* - {py:obj}`log_list ` - - ```{autodoc2-docstring} bumpversion.show.log_list - :parser: myst - :summary: - ``` -* - {py:obj}`do_show ` - - ```{autodoc2-docstring} bumpversion.show.do_show - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`OUTPUTTERS ` - - ```{autodoc2-docstring} bumpversion.show.OUTPUTTERS - :parser: myst - :summary: - ``` -```` - -### API - -````{py:function} output_default(value: dict) -> None -:canonical: bumpversion.show.output_default - -```{autodoc2-docstring} bumpversion.show.output_default -:parser: myst -``` -```` - -````{py:function} output_yaml(value: dict) -> None -:canonical: bumpversion.show.output_yaml - -```{autodoc2-docstring} bumpversion.show.output_yaml -:parser: myst -``` -```` - -````{py:function} output_json(value: dict) -> None -:canonical: bumpversion.show.output_json - -```{autodoc2-docstring} bumpversion.show.output_json -:parser: myst -``` -```` - -````{py:data} OUTPUTTERS -:canonical: bumpversion.show.OUTPUTTERS -:value: > - None - -```{autodoc2-docstring} bumpversion.show.OUTPUTTERS -:parser: myst -``` - -```` - -````{py:function} resolve_name(obj: typing.Any, name: str, default: typing.Any = None, err_on_missing: bool = False) -> typing.Any -:canonical: bumpversion.show.resolve_name - -```{autodoc2-docstring} bumpversion.show.resolve_name -:parser: myst -``` -```` - -````{py:function} log_list(config: bumpversion.config.Config, version_part: typing.Optional[str], new_version: typing.Optional[str]) -> None -:canonical: bumpversion.show.log_list - -```{autodoc2-docstring} bumpversion.show.log_list -:parser: myst -``` -```` - -````{py:function} do_show(*args, config: bumpversion.config.Config, format_: str = 'default', increment: typing.Optional[str] = None) -> None -:canonical: bumpversion.show.do_show - -```{autodoc2-docstring} bumpversion.show.do_show -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.ui.md b/docsrc/reference/bumpversion/bumpversion.ui.md deleted file mode 100644 index eb6a991d..00000000 --- a/docsrc/reference/bumpversion/bumpversion.ui.md +++ /dev/null @@ -1,126 +0,0 @@ -# {py:mod}`bumpversion.ui` - -```{py:module} bumpversion.ui -``` - -```{autodoc2-docstring} bumpversion.ui -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`get_indented_logger ` - - ```{autodoc2-docstring} bumpversion.ui.get_indented_logger - :parser: myst - :summary: - ``` -* - {py:obj}`setup_logging ` - - ```{autodoc2-docstring} bumpversion.ui.setup_logging - :parser: myst - :summary: - ``` -* - {py:obj}`print_info ` - - ```{autodoc2-docstring} bumpversion.ui.print_info - :parser: myst - :summary: - ``` -* - {py:obj}`print_error ` - - ```{autodoc2-docstring} bumpversion.ui.print_error - :parser: myst - :summary: - ``` -* - {py:obj}`print_warning ` - - ```{autodoc2-docstring} bumpversion.ui.print_warning - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.ui.logger - :parser: myst - :summary: - ``` -* - {py:obj}`VERBOSITY ` - - ```{autodoc2-docstring} bumpversion.ui.VERBOSITY - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.ui.logger -:value: > - 'getLogger(...)' - -```{autodoc2-docstring} bumpversion.ui.logger -:parser: myst -``` - -```` - -````{py:data} VERBOSITY -:canonical: bumpversion.ui.VERBOSITY -:value: > - None - -```{autodoc2-docstring} bumpversion.ui.VERBOSITY -:parser: myst -``` - -```` - -````{py:function} get_indented_logger(name: str) -> bumpversion.indented_logger.IndentedLoggerAdapter -:canonical: bumpversion.ui.get_indented_logger - -```{autodoc2-docstring} bumpversion.ui.get_indented_logger -:parser: myst -``` -```` - -````{py:function} setup_logging(verbose: int = 0) -> None -:canonical: bumpversion.ui.setup_logging - -```{autodoc2-docstring} bumpversion.ui.setup_logging -:parser: myst -``` -```` - -````{py:function} print_info(msg: str) -> None -:canonical: bumpversion.ui.print_info - -```{autodoc2-docstring} bumpversion.ui.print_info -:parser: myst -``` -```` - -````{py:function} print_error(msg: str) -> None -:canonical: bumpversion.ui.print_error - -```{autodoc2-docstring} bumpversion.ui.print_error -:parser: myst -``` -```` - -````{py:function} print_warning(msg: str) -> None -:canonical: bumpversion.ui.print_warning - -```{autodoc2-docstring} bumpversion.ui.print_warning -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.utils.md b/docsrc/reference/bumpversion/bumpversion.utils.md deleted file mode 100644 index f8d94a3f..00000000 --- a/docsrc/reference/bumpversion/bumpversion.utils.md +++ /dev/null @@ -1,151 +0,0 @@ -# {py:mod}`bumpversion.utils` - -```{py:module} bumpversion.utils -``` - -```{autodoc2-docstring} bumpversion.utils -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`extract_regex_flags ` - - ```{autodoc2-docstring} bumpversion.utils.extract_regex_flags - :parser: myst - :summary: - ``` -* - {py:obj}`recursive_sort_dict ` - - ```{autodoc2-docstring} bumpversion.utils.recursive_sort_dict - :parser: myst - :summary: - ``` -* - {py:obj}`key_val_string ` - - ```{autodoc2-docstring} bumpversion.utils.key_val_string - :parser: myst - :summary: - ``` -* - {py:obj}`prefixed_environ ` - - ```{autodoc2-docstring} bumpversion.utils.prefixed_environ - :parser: myst - :summary: - ``` -* - {py:obj}`labels_for_format ` - - ```{autodoc2-docstring} bumpversion.utils.labels_for_format - :parser: myst - :summary: - ``` -* - {py:obj}`base_context ` - - ```{autodoc2-docstring} bumpversion.utils.base_context - :parser: myst - :summary: - ``` -* - {py:obj}`get_context ` - - ```{autodoc2-docstring} bumpversion.utils.get_context - :parser: myst - :summary: - ``` -* - {py:obj}`get_overrides ` - - ```{autodoc2-docstring} bumpversion.utils.get_overrides - :parser: myst - :summary: - ``` -* - {py:obj}`get_nested_value ` - - ```{autodoc2-docstring} bumpversion.utils.get_nested_value - :parser: myst - :summary: - ``` -* - {py:obj}`set_nested_value ` - - ```{autodoc2-docstring} bumpversion.utils.set_nested_value - :parser: myst - :summary: - ``` -```` - -### API - -````{py:function} extract_regex_flags(regex_pattern: str) -> typing.Tuple[str, str] -:canonical: bumpversion.utils.extract_regex_flags - -```{autodoc2-docstring} bumpversion.utils.extract_regex_flags -:parser: myst -``` -```` - -````{py:function} recursive_sort_dict(input_value: typing.Any) -> typing.Any -:canonical: bumpversion.utils.recursive_sort_dict - -```{autodoc2-docstring} bumpversion.utils.recursive_sort_dict -:parser: myst -``` -```` - -````{py:function} key_val_string(d: dict) -> str -:canonical: bumpversion.utils.key_val_string - -```{autodoc2-docstring} bumpversion.utils.key_val_string -:parser: myst -``` -```` - -````{py:function} prefixed_environ() -> dict -:canonical: bumpversion.utils.prefixed_environ - -```{autodoc2-docstring} bumpversion.utils.prefixed_environ -:parser: myst -``` -```` - -````{py:function} labels_for_format(serialize_format: str) -> typing.List[str] -:canonical: bumpversion.utils.labels_for_format - -```{autodoc2-docstring} bumpversion.utils.labels_for_format -:parser: myst -``` -```` - -````{py:function} base_context(scm_info: typing.Optional[bumpversion.scm.SCMInfo] = None) -> collections.ChainMap -:canonical: bumpversion.utils.base_context - -```{autodoc2-docstring} bumpversion.utils.base_context -:parser: myst -``` -```` - -````{py:function} get_context(config: bumpversion.config.Config, current_version: typing.Optional[bumpversion.versioning.models.Version] = None, new_version: typing.Optional[bumpversion.versioning.models.Version] = None) -> collections.ChainMap -:canonical: bumpversion.utils.get_context - -```{autodoc2-docstring} bumpversion.utils.get_context -:parser: myst -``` -```` - -````{py:function} get_overrides(**kwargs) -> dict -:canonical: bumpversion.utils.get_overrides - -```{autodoc2-docstring} bumpversion.utils.get_overrides -:parser: myst -``` -```` - -````{py:function} get_nested_value(d: dict, path: str) -> typing.Any -:canonical: bumpversion.utils.get_nested_value - -```{autodoc2-docstring} bumpversion.utils.get_nested_value -:parser: myst -``` -```` - -````{py:function} set_nested_value(d: dict, value: typing.Any, path: str) -> None -:canonical: bumpversion.utils.set_nested_value - -```{autodoc2-docstring} bumpversion.utils.set_nested_value -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.version_part.md b/docsrc/reference/bumpversion/bumpversion.version_part.md deleted file mode 100644 index c20cf510..00000000 --- a/docsrc/reference/bumpversion/bumpversion.version_part.md +++ /dev/null @@ -1,104 +0,0 @@ -# {py:mod}`bumpversion.version_part` - -```{py:module} bumpversion.version_part -``` - -```{autodoc2-docstring} bumpversion.version_part -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`VersionConfig ` - - ```{autodoc2-docstring} bumpversion.version_part.VersionConfig - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.version_part.logger - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.version_part.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.version_part.logger -:parser: myst -``` - -```` - -`````{py:class} VersionConfig(parse: str, serialize: typing.Tuple[str], search: str, replace: str, part_configs: typing.Optional[typing.Dict[str, bumpversion.versioning.models.VersionComponentSpec]] = None) -:canonical: bumpversion.version_part.VersionConfig - -```{autodoc2-docstring} bumpversion.version_part.VersionConfig -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.version_part.VersionConfig.__init__ -:parser: myst -``` - -````{py:method} __repr__() -> str -:canonical: bumpversion.version_part.VersionConfig.__repr__ - -```` - -````{py:method} __eq__(other: typing.Any) -> bool -:canonical: bumpversion.version_part.VersionConfig.__eq__ - -```` - -````{py:property} order -:canonical: bumpversion.version_part.VersionConfig.order -:type: typing.List[str] - -```{autodoc2-docstring} bumpversion.version_part.VersionConfig.order -:parser: myst -``` - -```` - -````{py:method} parse(version_string: typing.Optional[str] = None) -> typing.Optional[bumpversion.versioning.models.Version] -:canonical: bumpversion.version_part.VersionConfig.parse - -```{autodoc2-docstring} bumpversion.version_part.VersionConfig.parse -:parser: myst -``` - -```` - -````{py:method} serialize(version: bumpversion.versioning.models.Version, context: typing.MutableMapping) -> str -:canonical: bumpversion.version_part.VersionConfig.serialize - -```{autodoc2-docstring} bumpversion.version_part.VersionConfig.serialize -:parser: myst -``` - -```` - -````` diff --git a/docsrc/reference/bumpversion/bumpversion.versioning.conventions.md b/docsrc/reference/bumpversion/bumpversion.versioning.conventions.md deleted file mode 100644 index 3bc8d18a..00000000 --- a/docsrc/reference/bumpversion/bumpversion.versioning.conventions.md +++ /dev/null @@ -1,149 +0,0 @@ -# {py:mod}`bumpversion.versioning.conventions` - -```{py:module} bumpversion.versioning.conventions -``` - -```{autodoc2-docstring} bumpversion.versioning.conventions -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`pep440_version_spec ` - - ```{autodoc2-docstring} bumpversion.versioning.conventions.pep440_version_spec - :parser: myst - :summary: - ``` -* - {py:obj}`semver_spec ` - - ```{autodoc2-docstring} bumpversion.versioning.conventions.semver_spec - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`PEP440_PATTERN ` - - ```{autodoc2-docstring} bumpversion.versioning.conventions.PEP440_PATTERN - :parser: myst - :summary: - ``` -* - {py:obj}`PEP440_SERIALIZE_PATTERNS ` - - ```{autodoc2-docstring} bumpversion.versioning.conventions.PEP440_SERIALIZE_PATTERNS - :parser: myst - :summary: - ``` -* - {py:obj}`PEP440_COMPONENT_CONFIGS ` - - ```{autodoc2-docstring} bumpversion.versioning.conventions.PEP440_COMPONENT_CONFIGS - :parser: myst - :summary: - ``` -* - {py:obj}`SEMVER_PATTERN ` - - ```{autodoc2-docstring} bumpversion.versioning.conventions.SEMVER_PATTERN - :parser: myst - :summary: - ``` -* - {py:obj}`SEMVER_SERIALIZE_PATTERNS ` - - ```{autodoc2-docstring} bumpversion.versioning.conventions.SEMVER_SERIALIZE_PATTERNS - :parser: myst - :summary: - ``` -* - {py:obj}`SEMVER_COMPONENT_CONFIGS ` - - ```{autodoc2-docstring} bumpversion.versioning.conventions.SEMVER_COMPONENT_CONFIGS - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} PEP440_PATTERN -:canonical: bumpversion.versioning.conventions.PEP440_PATTERN -:value: - -```{autodoc2-docstring} bumpversion.versioning.conventions.PEP440_PATTERN -:parser: myst -``` - -```` - -````{py:data} PEP440_SERIALIZE_PATTERNS -:canonical: bumpversion.versioning.conventions.PEP440_SERIALIZE_PATTERNS -:value: > - ['{major}.{minor}.{patch}{pre_l}{pre_n}.{post}.{dev}+{local}', '{major}.{minor}.{patch}{pre_l}{pre_n... - -```{autodoc2-docstring} bumpversion.versioning.conventions.PEP440_SERIALIZE_PATTERNS -:parser: myst -``` - -```` - -````{py:data} PEP440_COMPONENT_CONFIGS -:canonical: bumpversion.versioning.conventions.PEP440_COMPONENT_CONFIGS -:value: > - None - -```{autodoc2-docstring} bumpversion.versioning.conventions.PEP440_COMPONENT_CONFIGS -:parser: myst -``` - -```` - -````{py:function} pep440_version_spec() -> bumpversion.versioning.models.VersionSpec -:canonical: bumpversion.versioning.conventions.pep440_version_spec - -```{autodoc2-docstring} bumpversion.versioning.conventions.pep440_version_spec -:parser: myst -``` -```` - -````{py:data} SEMVER_PATTERN -:canonical: bumpversion.versioning.conventions.SEMVER_PATTERN -:value: - -```{autodoc2-docstring} bumpversion.versioning.conventions.SEMVER_PATTERN -:parser: myst -``` - -```` - -````{py:data} SEMVER_SERIALIZE_PATTERNS -:canonical: bumpversion.versioning.conventions.SEMVER_SERIALIZE_PATTERNS -:value: > - ['{major}.{minor}.{patch}-{pre_l}{pre_n}+{buildmetadata}', '{major}.{minor}.{patch}-{pre_l}{pre_n}',... - -```{autodoc2-docstring} bumpversion.versioning.conventions.SEMVER_SERIALIZE_PATTERNS -:parser: myst -``` - -```` - -````{py:data} SEMVER_COMPONENT_CONFIGS -:canonical: bumpversion.versioning.conventions.SEMVER_COMPONENT_CONFIGS -:value: > - None - -```{autodoc2-docstring} bumpversion.versioning.conventions.SEMVER_COMPONENT_CONFIGS -:parser: myst -``` - -```` - -````{py:function} semver_spec() -> bumpversion.versioning.models.VersionSpec -:canonical: bumpversion.versioning.conventions.semver_spec - -```{autodoc2-docstring} bumpversion.versioning.conventions.semver_spec -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.versioning.functions.md b/docsrc/reference/bumpversion/bumpversion.versioning.functions.md deleted file mode 100644 index 3c244c65..00000000 --- a/docsrc/reference/bumpversion/bumpversion.versioning.functions.md +++ /dev/null @@ -1,188 +0,0 @@ -# {py:mod}`bumpversion.versioning.functions` - -```{py:module} bumpversion.versioning.functions -``` - -```{autodoc2-docstring} bumpversion.versioning.functions -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`PartFunction ` - - ```{autodoc2-docstring} bumpversion.versioning.functions.PartFunction - :parser: myst - :summary: - ``` -* - {py:obj}`IndependentFunction ` - - ```{autodoc2-docstring} bumpversion.versioning.functions.IndependentFunction - :parser: myst - :summary: - ``` -* - {py:obj}`NumericFunction ` - - ```{autodoc2-docstring} bumpversion.versioning.functions.NumericFunction - :parser: myst - :summary: - ``` -* - {py:obj}`ValuesFunction ` - - ```{autodoc2-docstring} bumpversion.versioning.functions.ValuesFunction - :parser: myst - :summary: - ``` -```` - -### API - -`````{py:class} PartFunction -:canonical: bumpversion.versioning.functions.PartFunction - -```{autodoc2-docstring} bumpversion.versioning.functions.PartFunction -:parser: myst -``` - -````{py:attribute} first_value -:canonical: bumpversion.versioning.functions.PartFunction.first_value -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.versioning.functions.PartFunction.first_value -:parser: myst -``` - -```` - -````{py:attribute} optional_value -:canonical: bumpversion.versioning.functions.PartFunction.optional_value -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.versioning.functions.PartFunction.optional_value -:parser: myst -``` - -```` - -````{py:attribute} independent -:canonical: bumpversion.versioning.functions.PartFunction.independent -:type: bool -:value: > - None - -```{autodoc2-docstring} bumpversion.versioning.functions.PartFunction.independent -:parser: myst -``` - -```` - -````{py:method} bump(value: str) -> str -:canonical: bumpversion.versioning.functions.PartFunction.bump -:abstractmethod: - -```{autodoc2-docstring} bumpversion.versioning.functions.PartFunction.bump -:parser: myst -``` - -```` - -````` - -`````{py:class} IndependentFunction(value: typing.Union[str, int, None] = None) -:canonical: bumpversion.versioning.functions.IndependentFunction - -Bases: {py:obj}`bumpversion.versioning.functions.PartFunction` - -```{autodoc2-docstring} bumpversion.versioning.functions.IndependentFunction -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.versioning.functions.IndependentFunction.__init__ -:parser: myst -``` - -````{py:method} bump(value: typing.Optional[str] = None) -> str -:canonical: bumpversion.versioning.functions.IndependentFunction.bump - -```{autodoc2-docstring} bumpversion.versioning.functions.IndependentFunction.bump -:parser: myst -``` - -```` - -````` - -`````{py:class} NumericFunction(optional_value: typing.Union[str, int, None] = None, first_value: typing.Union[str, int, None] = None) -:canonical: bumpversion.versioning.functions.NumericFunction - -Bases: {py:obj}`bumpversion.versioning.functions.PartFunction` - -```{autodoc2-docstring} bumpversion.versioning.functions.NumericFunction -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.versioning.functions.NumericFunction.__init__ -:parser: myst -``` - -````{py:attribute} FIRST_NUMERIC -:canonical: bumpversion.versioning.functions.NumericFunction.FIRST_NUMERIC -:value: > - 'compile(...)' - -```{autodoc2-docstring} bumpversion.versioning.functions.NumericFunction.FIRST_NUMERIC -:parser: myst -``` - -```` - -````{py:method} bump(value: typing.Union[str, int]) -> str -:canonical: bumpversion.versioning.functions.NumericFunction.bump - -```{autodoc2-docstring} bumpversion.versioning.functions.NumericFunction.bump -:parser: myst -``` - -```` - -````` - -`````{py:class} ValuesFunction(values: typing.List[str], optional_value: typing.Optional[str] = None, first_value: typing.Optional[str] = None) -:canonical: bumpversion.versioning.functions.ValuesFunction - -Bases: {py:obj}`bumpversion.versioning.functions.PartFunction` - -```{autodoc2-docstring} bumpversion.versioning.functions.ValuesFunction -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.versioning.functions.ValuesFunction.__init__ -:parser: myst -``` - -````{py:method} bump(value: str) -> str -:canonical: bumpversion.versioning.functions.ValuesFunction.bump - -```{autodoc2-docstring} bumpversion.versioning.functions.ValuesFunction.bump -:parser: myst -``` - -```` - -````` diff --git a/docsrc/reference/bumpversion/bumpversion.versioning.md b/docsrc/reference/bumpversion/bumpversion.versioning.md deleted file mode 100644 index 58dff562..00000000 --- a/docsrc/reference/bumpversion/bumpversion.versioning.md +++ /dev/null @@ -1,21 +0,0 @@ -# {py:mod}`bumpversion.versioning` - -```{py:module} bumpversion.versioning -``` - -```{autodoc2-docstring} bumpversion.versioning -:parser: myst -:allowtitles: -``` - -## Submodules - -```{toctree} -:titlesonly: -:maxdepth: 1 - -bumpversion.versioning.functions -bumpversion.versioning.models -bumpversion.versioning.conventions -bumpversion.versioning.serialization -``` diff --git a/docsrc/reference/bumpversion/bumpversion.versioning.models.md b/docsrc/reference/bumpversion/bumpversion.versioning.models.md deleted file mode 100644 index cd6156c2..00000000 --- a/docsrc/reference/bumpversion/bumpversion.versioning.models.md +++ /dev/null @@ -1,330 +0,0 @@ -# {py:mod}`bumpversion.versioning.models` - -```{py:module} bumpversion.versioning.models -``` - -```{autodoc2-docstring} bumpversion.versioning.models -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`VersionComponent ` - - ```{autodoc2-docstring} bumpversion.versioning.models.VersionComponent - :parser: myst - :summary: - ``` -* - {py:obj}`VersionComponentSpec ` - - ```{autodoc2-docstring} bumpversion.versioning.models.VersionComponentSpec - :parser: myst - :summary: - ``` -* - {py:obj}`VersionSpec ` - - ```{autodoc2-docstring} bumpversion.versioning.models.VersionSpec - :parser: myst - :summary: - ``` -* - {py:obj}`Version ` - - ```{autodoc2-docstring} bumpversion.versioning.models.Version - :parser: myst - :summary: - ``` -```` - -### API - -`````{py:class} VersionComponent(values: typing.Optional[list] = None, optional_value: typing.Optional[str] = None, first_value: typing.Union[str, int, None] = None, independent: bool = False, source: typing.Optional[str] = None, value: typing.Union[str, int, None] = None) -:canonical: bumpversion.versioning.models.VersionComponent - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponent -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponent.__init__ -:parser: myst -``` - -````{py:property} value -:canonical: bumpversion.versioning.models.VersionComponent.value -:type: str - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponent.value -:parser: myst -``` - -```` - -````{py:method} copy() -> bumpversion.versioning.models.VersionComponent -:canonical: bumpversion.versioning.models.VersionComponent.copy - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponent.copy -:parser: myst -``` - -```` - -````{py:method} bump() -> bumpversion.versioning.models.VersionComponent -:canonical: bumpversion.versioning.models.VersionComponent.bump - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponent.bump -:parser: myst -``` - -```` - -````{py:method} null() -> bumpversion.versioning.models.VersionComponent -:canonical: bumpversion.versioning.models.VersionComponent.null - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponent.null -:parser: myst -``` - -```` - -````{py:property} is_optional -:canonical: bumpversion.versioning.models.VersionComponent.is_optional -:type: bool - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponent.is_optional -:parser: myst -``` - -```` - -````{py:property} is_independent -:canonical: bumpversion.versioning.models.VersionComponent.is_independent -:type: bool - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponent.is_independent -:parser: myst -``` - -```` - -````{py:method} __format__(format_spec: str) -> str -:canonical: bumpversion.versioning.models.VersionComponent.__format__ - -```` - -````{py:method} __repr__() -> str -:canonical: bumpversion.versioning.models.VersionComponent.__repr__ - -```` - -````{py:method} __eq__(other: typing.Any) -> bool -:canonical: bumpversion.versioning.models.VersionComponent.__eq__ - -```` - -````` - -`````{py:class} VersionComponentSpec(**data: typing.Any) -:canonical: bumpversion.versioning.models.VersionComponentSpec - -Bases: {py:obj}`pydantic.BaseModel` - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponentSpec -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponentSpec.__init__ -:parser: myst -``` - -````{py:attribute} values -:canonical: bumpversion.versioning.models.VersionComponentSpec.values -:type: typing.Optional[list] -:value: > - None - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponentSpec.values -:parser: myst -``` - -```` - -````{py:attribute} optional_value -:canonical: bumpversion.versioning.models.VersionComponentSpec.optional_value -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponentSpec.optional_value -:parser: myst -``` - -```` - -````{py:attribute} first_value -:canonical: bumpversion.versioning.models.VersionComponentSpec.first_value -:type: typing.Union[str, int, None] -:value: > - None - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponentSpec.first_value -:parser: myst -``` - -```` - -````{py:attribute} independent -:canonical: bumpversion.versioning.models.VersionComponentSpec.independent -:type: bool -:value: > - False - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponentSpec.independent -:parser: myst -``` - -```` - -````{py:attribute} depends_on -:canonical: bumpversion.versioning.models.VersionComponentSpec.depends_on -:type: typing.Optional[str] -:value: > - None - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponentSpec.depends_on -:parser: myst -``` - -```` - -````{py:method} create_component(value: typing.Union[str, int, None] = None) -> bumpversion.versioning.models.VersionComponent -:canonical: bumpversion.versioning.models.VersionComponentSpec.create_component - -```{autodoc2-docstring} bumpversion.versioning.models.VersionComponentSpec.create_component -:parser: myst -``` - -```` - -````` - -`````{py:class} VersionSpec(components: typing.Dict[str, bumpversion.versioning.models.VersionComponentSpec], order: typing.Optional[typing.List[str]] = None) -:canonical: bumpversion.versioning.models.VersionSpec - -```{autodoc2-docstring} bumpversion.versioning.models.VersionSpec -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.versioning.models.VersionSpec.__init__ -:parser: myst -``` - -````{py:method} create_version(values: typing.Dict[str, str]) -> bumpversion.versioning.models.Version -:canonical: bumpversion.versioning.models.VersionSpec.create_version - -```{autodoc2-docstring} bumpversion.versioning.models.VersionSpec.create_version -:parser: myst -``` - -```` - -````{py:method} get_dependents(component_name: str) -> typing.List[str] -:canonical: bumpversion.versioning.models.VersionSpec.get_dependents - -```{autodoc2-docstring} bumpversion.versioning.models.VersionSpec.get_dependents -:parser: myst -``` - -```` - -````` - -`````{py:class} Version(version_spec: bumpversion.versioning.models.VersionSpec, components: typing.Dict[str, bumpversion.versioning.models.VersionComponent], original: typing.Optional[str] = None) -:canonical: bumpversion.versioning.models.Version - -```{autodoc2-docstring} bumpversion.versioning.models.Version -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.versioning.models.Version.__init__ -:parser: myst -``` - -````{py:method} values() -> typing.Dict[str, str] -:canonical: bumpversion.versioning.models.Version.values - -```{autodoc2-docstring} bumpversion.versioning.models.Version.values -:parser: myst -``` - -```` - -````{py:method} __getitem__(key: str) -> bumpversion.versioning.models.VersionComponent -:canonical: bumpversion.versioning.models.Version.__getitem__ - -```{autodoc2-docstring} bumpversion.versioning.models.Version.__getitem__ -:parser: myst -``` - -```` - -````{py:method} __len__() -> int -:canonical: bumpversion.versioning.models.Version.__len__ - -```{autodoc2-docstring} bumpversion.versioning.models.Version.__len__ -:parser: myst -``` - -```` - -````{py:method} __iter__() -:canonical: bumpversion.versioning.models.Version.__iter__ - -```{autodoc2-docstring} bumpversion.versioning.models.Version.__iter__ -:parser: myst -``` - -```` - -````{py:method} __repr__() -:canonical: bumpversion.versioning.models.Version.__repr__ - -```` - -````{py:method} __eq__(other: typing.Any) -> bool -:canonical: bumpversion.versioning.models.Version.__eq__ - -```` - -````{py:method} required_components() -> typing.List[str] -:canonical: bumpversion.versioning.models.Version.required_components - -```{autodoc2-docstring} bumpversion.versioning.models.Version.required_components -:parser: myst -``` - -```` - -````{py:method} bump(component_name: str) -> bumpversion.versioning.models.Version -:canonical: bumpversion.versioning.models.Version.bump - -```{autodoc2-docstring} bumpversion.versioning.models.Version.bump -:parser: myst -``` - -```` - -````` diff --git a/docsrc/reference/bumpversion/bumpversion.versioning.serialization.md b/docsrc/reference/bumpversion/bumpversion.versioning.serialization.md deleted file mode 100644 index 35bfad2f..00000000 --- a/docsrc/reference/bumpversion/bumpversion.versioning.serialization.md +++ /dev/null @@ -1,84 +0,0 @@ -# {py:mod}`bumpversion.versioning.serialization` - -```{py:module} bumpversion.versioning.serialization -``` - -```{autodoc2-docstring} bumpversion.versioning.serialization -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`parse_version ` - - ```{autodoc2-docstring} bumpversion.versioning.serialization.parse_version - :parser: myst - :summary: - ``` -* - {py:obj}`multisort ` - - ```{autodoc2-docstring} bumpversion.versioning.serialization.multisort - :parser: myst - :summary: - ``` -* - {py:obj}`serialize ` - - ```{autodoc2-docstring} bumpversion.versioning.serialization.serialize - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`logger ` - - ```{autodoc2-docstring} bumpversion.versioning.serialization.logger - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} logger -:canonical: bumpversion.versioning.serialization.logger -:value: > - 'get_indented_logger(...)' - -```{autodoc2-docstring} bumpversion.versioning.serialization.logger -:parser: myst -``` - -```` - -````{py:function} parse_version(version_string: str, parse_pattern: str) -> typing.Dict[str, str] -:canonical: bumpversion.versioning.serialization.parse_version - -```{autodoc2-docstring} bumpversion.versioning.serialization.parse_version -:parser: myst -``` -```` - -````{py:function} multisort(xs: list, specs: tuple) -> list -:canonical: bumpversion.versioning.serialization.multisort - -```{autodoc2-docstring} bumpversion.versioning.serialization.multisort -:parser: myst -``` -```` - -````{py:function} serialize(version: bumpversion.versioning.models.Version, serialize_patterns: typing.List[str], context: typing.MutableMapping) -> str -:canonical: bumpversion.versioning.serialization.serialize - -```{autodoc2-docstring} bumpversion.versioning.serialization.serialize -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.visualize.md b/docsrc/reference/bumpversion/bumpversion.visualize.md deleted file mode 100644 index 20963908..00000000 --- a/docsrc/reference/bumpversion/bumpversion.visualize.md +++ /dev/null @@ -1,264 +0,0 @@ -# {py:mod}`bumpversion.visualize` - -```{py:module} bumpversion.visualize -``` - -```{autodoc2-docstring} bumpversion.visualize -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`Border ` - - ```{autodoc2-docstring} bumpversion.visualize.Border - :parser: myst - :summary: - ``` -```` - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`lead_string ` - - ```{autodoc2-docstring} bumpversion.visualize.lead_string - :parser: myst - :summary: - ``` -* - {py:obj}`connection_str ` - - ```{autodoc2-docstring} bumpversion.visualize.connection_str - :parser: myst - :summary: - ``` -* - {py:obj}`labeled_line ` - - ```{autodoc2-docstring} bumpversion.visualize.labeled_line - :parser: myst - :summary: - ``` -* - {py:obj}`filter_version_parts ` - - ```{autodoc2-docstring} bumpversion.visualize.filter_version_parts - :parser: myst - :summary: - ``` -* - {py:obj}`visualize ` - - ```{autodoc2-docstring} bumpversion.visualize.visualize - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`BOX_CHARS ` - - ```{autodoc2-docstring} bumpversion.visualize.BOX_CHARS - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} BOX_CHARS -:canonical: bumpversion.visualize.BOX_CHARS -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.BOX_CHARS -:parser: myst -``` - -```` - -`````{py:class} Border -:canonical: bumpversion.visualize.Border - -```{autodoc2-docstring} bumpversion.visualize.Border -:parser: myst -``` - -````{py:attribute} corner_bottom_right -:canonical: bumpversion.visualize.Border.corner_bottom_right -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.corner_bottom_right -:parser: myst -``` - -```` - -````{py:attribute} corner_top_right -:canonical: bumpversion.visualize.Border.corner_top_right -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.corner_top_right -:parser: myst -``` - -```` - -````{py:attribute} corner_top_left -:canonical: bumpversion.visualize.Border.corner_top_left -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.corner_top_left -:parser: myst -``` - -```` - -````{py:attribute} corner_bottom_left -:canonical: bumpversion.visualize.Border.corner_bottom_left -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.corner_bottom_left -:parser: myst -``` - -```` - -````{py:attribute} divider_left -:canonical: bumpversion.visualize.Border.divider_left -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.divider_left -:parser: myst -``` - -```` - -````{py:attribute} divider_up -:canonical: bumpversion.visualize.Border.divider_up -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.divider_up -:parser: myst -``` - -```` - -````{py:attribute} divider_down -:canonical: bumpversion.visualize.Border.divider_down -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.divider_down -:parser: myst -``` - -```` - -````{py:attribute} divider_right -:canonical: bumpversion.visualize.Border.divider_right -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.divider_right -:parser: myst -``` - -```` - -````{py:attribute} line -:canonical: bumpversion.visualize.Border.line -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.line -:parser: myst -``` - -```` - -````{py:attribute} pipe -:canonical: bumpversion.visualize.Border.pipe -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.pipe -:parser: myst -``` - -```` - -````{py:attribute} cross -:canonical: bumpversion.visualize.Border.cross -:type: str -:value: > - None - -```{autodoc2-docstring} bumpversion.visualize.Border.cross -:parser: myst -``` - -```` - -````` - -````{py:function} lead_string(version_str: str, border: bumpversion.visualize.Border, blank: bool = False) -> str -:canonical: bumpversion.visualize.lead_string - -```{autodoc2-docstring} bumpversion.visualize.lead_string -:parser: myst -``` -```` - -````{py:function} connection_str(border: bumpversion.visualize.Border, has_next: bool = False, has_previous: bool = False) -> str -:canonical: bumpversion.visualize.connection_str - -```{autodoc2-docstring} bumpversion.visualize.connection_str -:parser: myst -``` -```` - -````{py:function} labeled_line(label: str, border: bumpversion.visualize.Border, fit_length: typing.Optional[int] = None) -> str -:canonical: bumpversion.visualize.labeled_line - -```{autodoc2-docstring} bumpversion.visualize.labeled_line -:parser: myst -``` -```` - -````{py:function} filter_version_parts(config: bumpversion.config.Config) -> typing.List[str] -:canonical: bumpversion.visualize.filter_version_parts - -```{autodoc2-docstring} bumpversion.visualize.filter_version_parts -:parser: myst -``` -```` - -````{py:function} visualize(config: bumpversion.config.Config, version_str: str, box_style: str = 'light') -> None -:canonical: bumpversion.visualize.visualize - -```{autodoc2-docstring} bumpversion.visualize.visualize -:parser: myst -``` -```` diff --git a/docsrc/reference/bumpversion/bumpversion.yaml_dump.md b/docsrc/reference/bumpversion/bumpversion.yaml_dump.md deleted file mode 100644 index 034426da..00000000 --- a/docsrc/reference/bumpversion/bumpversion.yaml_dump.md +++ /dev/null @@ -1,247 +0,0 @@ -# {py:mod}`bumpversion.yaml_dump` - -```{py:module} bumpversion.yaml_dump -``` - -```{autodoc2-docstring} bumpversion.yaml_dump -:parser: myst -:allowtitles: -``` - -## Module Contents - -### Classes - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`YAMLDumpers ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.YAMLDumpers - :parser: myst - :summary: - ``` -```` - -### Functions - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`dump ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.dump - :parser: myst - :summary: - ``` -* - {py:obj}`format_str ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.format_str - :parser: myst - :summary: - ``` -* - {py:obj}`format_int ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.format_int - :parser: myst - :summary: - ``` -* - {py:obj}`format_float ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.format_float - :parser: myst - :summary: - ``` -* - {py:obj}`format_bool ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.format_bool - :parser: myst - :summary: - ``` -* - {py:obj}`format_dict ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.format_dict - :parser: myst - :summary: - ``` -* - {py:obj}`format_sequence ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.format_sequence - :parser: myst - :summary: - ``` -* - {py:obj}`format_none ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.format_none - :parser: myst - :summary: - ``` -* - {py:obj}`format_date ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.format_date - :parser: myst - :summary: - ``` -* - {py:obj}`format_datetime ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.format_datetime - :parser: myst - :summary: - ``` -```` - -### Data - -````{list-table} -:class: autosummary longtable -:align: left - -* - {py:obj}`DumperFunc ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.DumperFunc - :parser: myst - :summary: - ``` -* - {py:obj}`YAML_DUMPERS ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.YAML_DUMPERS - :parser: myst - :summary: - ``` -* - {py:obj}`INDENT ` - - ```{autodoc2-docstring} bumpversion.yaml_dump.INDENT - :parser: myst - :summary: - ``` -```` - -### API - -````{py:data} DumperFunc -:canonical: bumpversion.yaml_dump.DumperFunc -:value: > - None - -```{autodoc2-docstring} bumpversion.yaml_dump.DumperFunc -:parser: myst -``` - -```` - -`````{py:class} YAMLDumpers(dict=None, /, **kwargs) -:canonical: bumpversion.yaml_dump.YAMLDumpers - -Bases: {py:obj}`collections.UserDict` - -```{autodoc2-docstring} bumpversion.yaml_dump.YAMLDumpers -:parser: myst -``` - -```{rubric} Initialization -``` - -```{autodoc2-docstring} bumpversion.yaml_dump.YAMLDumpers.__init__ -:parser: myst -``` - -````{py:method} add_dumper(data_type: type, dumper: bumpversion.yaml_dump.DumperFunc) -> None -:canonical: bumpversion.yaml_dump.YAMLDumpers.add_dumper - -```{autodoc2-docstring} bumpversion.yaml_dump.YAMLDumpers.add_dumper -:parser: myst -``` - -```` - -````` - -````{py:data} YAML_DUMPERS -:canonical: bumpversion.yaml_dump.YAML_DUMPERS -:value: > - 'YAMLDumpers(...)' - -```{autodoc2-docstring} bumpversion.yaml_dump.YAML_DUMPERS -:parser: myst -``` - -```` - -````{py:data} INDENT -:canonical: bumpversion.yaml_dump.INDENT -:value: > - ' ' - -```{autodoc2-docstring} bumpversion.yaml_dump.INDENT -:parser: myst -``` - -```` - -````{py:function} dump(data: typing.Any) -> str -:canonical: bumpversion.yaml_dump.dump - -```{autodoc2-docstring} bumpversion.yaml_dump.dump -:parser: myst -``` -```` - -````{py:function} format_str(val: str) -> str -:canonical: bumpversion.yaml_dump.format_str - -```{autodoc2-docstring} bumpversion.yaml_dump.format_str -:parser: myst -``` -```` - -````{py:function} format_int(val: int) -> str -:canonical: bumpversion.yaml_dump.format_int - -```{autodoc2-docstring} bumpversion.yaml_dump.format_int -:parser: myst -``` -```` - -````{py:function} format_float(data: float) -> str -:canonical: bumpversion.yaml_dump.format_float - -```{autodoc2-docstring} bumpversion.yaml_dump.format_float -:parser: myst -``` -```` - -````{py:function} format_bool(val: bool) -> str -:canonical: bumpversion.yaml_dump.format_bool - -```{autodoc2-docstring} bumpversion.yaml_dump.format_bool -:parser: myst -``` -```` - -````{py:function} format_dict(val: dict) -> str -:canonical: bumpversion.yaml_dump.format_dict - -```{autodoc2-docstring} bumpversion.yaml_dump.format_dict -:parser: myst -``` -```` - -````{py:function} format_sequence(val: typing.Union[list, tuple]) -> str -:canonical: bumpversion.yaml_dump.format_sequence - -```{autodoc2-docstring} bumpversion.yaml_dump.format_sequence -:parser: myst -``` -```` - -````{py:function} format_none(_: None) -> str -:canonical: bumpversion.yaml_dump.format_none - -```{autodoc2-docstring} bumpversion.yaml_dump.format_none -:parser: myst -``` -```` - -````{py:function} format_date(val: datetime.date) -> str -:canonical: bumpversion.yaml_dump.format_date - -```{autodoc2-docstring} bumpversion.yaml_dump.format_date -:parser: myst -``` -```` - -````{py:function} format_datetime(val: datetime.datetime) -> str -:canonical: bumpversion.yaml_dump.format_datetime - -```{autodoc2-docstring} bumpversion.yaml_dump.format_datetime -:parser: myst -``` -```` diff --git a/docsrc/reference/cli.md b/docsrc/reference/cli.md new file mode 100644 index 00000000..7e32e484 --- /dev/null +++ b/docsrc/reference/cli.md @@ -0,0 +1,6 @@ +::: mkdocs-click + :module: bumpversion.cli + :command: cli + :prog_name: bump-my-version + :style: table + :list_subcommands: true diff --git a/docsrc/reference/cli.rst b/docsrc/reference/cli.rst deleted file mode 100644 index eadf1706..00000000 --- a/docsrc/reference/cli.rst +++ /dev/null @@ -1,6 +0,0 @@ -Command-line Interface -====================== - -.. click:: bumpversion.cli:cli - :prog: bump-my-version - :nested: full diff --git a/docsrc/reference/configuration.md b/docsrc/reference/configuration.md index e43cae22..6b424e25 100644 --- a/docsrc/reference/configuration.md +++ b/docsrc/reference/configuration.md @@ -1,6 +1,6 @@ # Configuration -`bump-my-version` looks in three places for configuration information (in order of precedence): +Bump My Version looks in three places for configuration information (in order of precedence): 1. command line 2. configuration file @@ -9,7 +9,7 @@ ## Configuration files -`bump-my-version` looks in four places for the configuration file to parse (in order of precedence): +Bump My Version looks in four places for the configuration file to parse (in order of precedence): 1. `--config-file ` _(command line argument)_ 2. `BUMPVERSION_CONFIG_FILE=file` _(environment variable)_ @@ -29,166 +29,213 @@ The general configuration is grouped in a `[tool.bumpversion]` or `[bumpversion ### `allow_dirty` -:required: No - -:default: `False` (Don't do anything if there are uncommitted changes) - -:type: boolean - -:command line option: `--allow-dirty | --no-allow-dirty` - -:environment var: `BUMPVERSION_ALLOW_DIRTY` - -Bump-my-version's default behavior is to abort if the working directory is dirty. This is to protect you from releasing unversioned files and/or overwriting unsaved changes. +::: field-list + required + : No + + default + : `False` + + type + : boolean + + command line option + : `--allow-dirty | --no-allow-dirty` + + environment var + : `BUMPVERSION_ALLOW_DIRTY` + + +Bump-my-version's default behavior is to abort if the working directory has uncommitted changes. This is to protect you from releasing unversioned files and/or overwriting unsaved changes. ### `commit` -:required: No - -:default: `False` (Don't create a commit) - -:type: boolean - -:command line option: `--commit | --no-commit` - -:environment var: `BUMPVERSION_COMMIT` +::: field-list + required + : No + + default + : `False` (Don't create a commit) + + type + : boolean + + command line option + : `--commit | --no-commit` + + environment var + : `BUMPVERSION_COMMIT` Whether to create a commit using git or Mercurial. If you have pre-commit hooks, you might also want to add an option to [`commit_args`](configuration.md#commit-args) to disable your pre-commit hooks. For Git use `--no-verify` and use `--config hooks.pre-commit=` for Mercurial. -### `message` - -:required: No - -:default: `Bump version: {current_version} → {new_version}` - -:type: string - -:command line option: `--message` - -:environment var: `BUMPVERSION_MESSAGE` - -The commit message template to use when creating a commit. This is only used when the [`commit`](configuration.md#commit) option is set to `True`. - -This string is templated using the [Python Format String Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). The [formatting context reference](formatting-context.md) describes the available variables. - ### `commit_args` -:required: No +::: field-list + + required + : No -:default: `""` + default + : `""` -:type: string + type + : string -:command line option: `--commit-args` + command line option + : `--commit-args` -:environment var: `BUMPVERSION_COMMIT_ARGS` + environment var + : `BUMPVERSION_COMMIT_ARGS` Extra arguments to pass to commit command. This is only used when the [`commit`](configuration.md#commit) option is set to `True`. If you have pre-commit hooks, you might also want to add an option to disable your pre-commit hooks. For Git use `--no-verify` and use `--config hooks.pre-commit=` for Mercurial. -### `tag` - -:required: No - -:default: `False` (Don't create a tag) - -:type: boolean - -:command line option: `(--tag | --no-tag)` - -:environment var: `BUMPVERSION_TAG` - -If `True`, create a tag after committing the changes. The tag is named using the [`tag_name`](configuration.md#tag-name) option. - -If you are using `git`, don't forget to `git-push` with the `--tags` flag when you are done. - -### `sign_tags` -:required: No - -:default: `False` (Don't sign tags) - -:type: boolean - -:command line option: `(--sign-tags | --no-sign-tags)` - -:environment var: `BUMPVERSION_SIGN_TAGS` - -If `True`, sign the created tag, when [`tag`](configuration.md#tag) is `True`. +### `current_version` -### `tag_name` -:required: No +::: field-list -:default: `v{new_version}` + required + : **Yes** -:type: string + default + : `""` -:command line option: `--tag-name` + type + : string -:environment var: `BUMPVERSION_TAG_NAME` + command line option + : `--current-version` -The name template used to render the tag, when [`tag`](configuration.md#tag) is `True`. + environment var + : `BUMPVERSION_CURRENT_VERSION` -This string is templated using the [Python Format String Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). The [formatting context reference](formatting-context.md) describes the available variables. +The current version of the software package before bumping. A value for this is required. -### `tag_message` -:required: No +### `ignore_missing_version` -:default: `Bump version: {current_version} → {new_version}` +::: field-list + required + : No + + default + : `False` + + type + : boolean + + command line option + : `--ignore-missing-version` + + environment var + : `BUMPVERSION_IGNORE_MISSING_VERSION` -:type: string +If `True`, don't fail if the version string to be replaced is not found in the file. -:command line option: `--tag-message` +### `message` -:environment var: `BUMPVERSION_TAG_MESSAGE` +::: field-list + + required + : No + + default + : `Bump version: {current_version} → {new_version}` + + type + : string + + command line option + : `--message` + + environment var + : `BUMPVERSION_MESSAGE` -The tag message template to use when creating a tag, when [`tag`](configuration.md#tag) is `True` +The commit message template to use when creating a commit. This is only used when the [`commit`](configuration.md#commit) option is set to `True`. This string is templated using the [Python Format String Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). The [formatting context reference](formatting-context.md) describes the available variables. -`bump-my-version` creates an *annotated* tag in Git by default. To disable this and create a *lightweight* tag, you must explicitly set an empty `tag_message` value. - -### `current_version` - -:required: **Yes** - -:default: `""` - -:type: string - -:command line option: `--current-version` - -:environment var: `BUMPVERSION_CURRENT_VERSION` - -The current version of the software package before bumping. A value for this is required. - ### `parse` -:required: No +::: field-list + required + : No + + default + : `(?P\d+)\.(?P\d+)\.(?P\d+)` + + type + : string + + command line option + : `--parse` + + environment var + : `BUMPVERSION_PARSE` -:default: `(?P\d+)\.(?P\d+)\.(?P\d+)` +This is the default regular expression (using [Python regular expression syntax](https://docs.python.org/3/library/re.html#regular-expression-syntax)) for finding and parsing the version string into its components. Individual part or file configurations may override this. -:type: string +The regular expression must be able to parse all strings produced by the configured [`serialize`](configuration.md#serialize) value. Named matching groups ("`(?P...)`") indicate the version part the matched value belongs to. -:command line option: `--parse` +### `replace` +::: field-list + required + : No + + default + : `{new_version}` + + type + : string + + command line option + : `--replace` + + environment var + : `BUMPVERSION_REPLACE` -:environment var: `BUMPVERSION_PARSE` +This is the template to create the string that will replace the current version number in the file. -This is the default regular expression (using [Python regular expression syntax](https://docs.python.org/3/library/re.html#regular-expression-syntax)) for finding and parsing the version string into its components. Individual part or file configurations may override this. +### `search` -The regular expression must be able to parse all strings produced by the configured [`serialize`](configuration.md#serialize) value. Named matching groups ("`(?P...)`") indicate the version part the matched value belongs to. +::: field-list + required + : No + + default + : `{current_version}` + + type + : string + + command line option + : `--search` + + environment var + : `BUMPVERSION_SEARCH` -### `serialize` -:required: No - -:default: `["{major}.{minor}.{patch}"]` +This is the template string how to search for the string to be replaced in the file. Individual file configurations may override this. This can span multiple lines, and is templated using [Python Format String Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). The [formatting context reference](formatting-context.md) describes the available variables. -:type: an array of strings +This is useful if there is the remotest possibility that the current version number might be present multiple times in the file and you mean to only bump one of the occurrences. -:command line option: `--serialize` +### `serialize` -:environment var: `BUMPVERSION_SERIALIZE` +::: field-list + required + : No + + default + : `["{major}.{minor}.{patch}"]` + + type + : an array of strings + + command line option + : `--serialize` + + environment var + : `BUMPVERSION_SERIALIZE` This is the default list of templates specifying how to serialize the version parts back to a version string. Individual part or file configurations may override this. @@ -208,87 +255,139 @@ Since `0` is optional by default, Version `1.8.9` will serialize to `1.8.9`, `1 Each string is templated using the [Python Format String Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). The [formatting context reference](formatting-context.md) describes the available variables. -### `search` -:required: No +### `sign_tags` -:default: `{current_version}` +::: field-list + + required + : No + + default + : `False` (Don't sign tags) + + type + : boolean + + command line option + : `(--sign-tags | --no-sign-tags)` + + environment var + : `BUMPVERSION_SIGN_TAGS` -:type: string +If `True`, sign the created tag, when [`tag`](configuration.md#tag) is `True`. -:command line option: `--search` +### `tag` -:environment var: `BUMPVERSION_SEARCH` +::: field-list -This is the template string how to search for the string to be replaced in the file. Individual file configurations may override this. This can span multiple lines, and is templated using [Python Format String Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). The [formatting context reference](formatting-context.md) describes the available variables. + required + : No -This is useful if there is the remotest possibility that the current version number might be present multiple times in the file and you mean to only bump one of the occurrences. + default + : `False` (Don't create a tag) -### `replace` -:required: No + type + : boolean -:default: `{new_version}` + command line option + : `(--tag | --no-tag)` -:type: string + environment var + : `BUMPVERSION_TAG` -:command line option: `--replace` +If `True`, create a tag after committing the changes. The tag is named using the [`tag_name`](configuration.md#tag-name) option. -:environment var: `BUMPVERSION_REPLACE` +If you are using `git`, don't forget to `git-push` with the `--tags` flag when you are done. -This is the template to create the string that will replace the current version number in the file. +### `tag_name` -### `ignore_missing_version` -:required: No +::: field-list -:default: `False` + required + : No -:type: boolean + default + : `v{new_version}` -:command line option: `--ignore-missing-version` + type + : string -:environment var: `BUMPVERSION_IGNORE_MISSING_VERSION` + command line option + : `--tag-name` -If `True`, don't fail if the version string to be replaced is not found in the file. + environment var + : `BUMPVERSION_TAG_NAME` -### TOML example +The name template used to render the tag, when [`tag`](configuration.md#tag) is `True`. -```toml -[tool.bumpversion] -allow_dirty = false -commit = false -message = "Bump version: {current_version} → {new_version}" -commit_args = "" -tag = false -sign_tags = false -tag_name = "v{new_version}" -tag_message = "Bump version: {current_version} → {new_version}" -current_version = "1.0.0" -parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" -serialize = [ - "{major}.{minor}.{patch}" -] -search = "{current_version}" -replace = "{new_version}" -``` +This string is templated using the [Python Format String Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). The [formatting context reference](formatting-context.md) describes the available variables. -### INI-style example +### `tag_message` -```ini -[bumpversion] -allow_dirty = False -commit = False -message = Bump version: {current_version} → {new_version} -commit_args = -tag = False -sign_tags = False -tag_name = v{new_version} -tag_message = Bump version: {current_version} → {new_version} -current_version = 1.0.0 -parse = (?P\d+)\.(?P\d+)\.(?P\d+) -serialize = - {major}.{minor}.{patch} -search = {current_version} -replace = {new_version} -``` +::: field-list + required + : No + + default + : `Bump version: {current_version} → {new_version}` + + type + : string + + command line option + : `--tag-message` + + environment var + : `BUMPVERSION_TAG_MESSAGE` + +The tag message template to use when creating a tag, when [`tag`](configuration.md#tag) is `True` + +This string is templated using the [Python Format String Syntax](https://docs.python.org/3/library/string.html#format-string-syntax). The [formatting context reference](formatting-context.md) describes the available variables. + +Bump My Version creates an *annotated* tag in Git by default. To disable this and create a *lightweight* tag, you must explicitly set an empty `tag_message` value. + +### Examples + +=== "TOML" + + ```toml + [tool.bumpversion] + allow_dirty = false + commit = false + message = "Bump version: {current_version} → {new_version}" + commit_args = "" + tag = false + sign_tags = false + tag_name = "v{new_version}" + tag_message = "Bump version: {current_version} → {new_version}" + current_version = "1.0.0" + parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" + serialize = [ + "{major}.{minor}.{patch}" + ] + search = "{current_version}" + replace = "{new_version}" + ``` + +=== "CFG" + + ```ini + [bumpversion] + allow_dirty = False + commit = False + message = Bump version: {current_version} → {new_version} + commit_args = + tag = False + sign_tags = False + tag_name = v{new_version} + tag_message = Bump version: {current_version} → {new_version} + current_version = 1.0.0 + parse = (?P\d+)\.(?P\d+)\.(?P\d+) + serialize = + {major}.{minor}.{patch} + search = {current_version} + replace = {new_version} + ``` ## Version part-specific configuration @@ -298,161 +397,211 @@ You only need to configure version parts if they deviate from the default, and t ### `values` -:required: No - -:default: numeric (i.e. `0`, `1`, `2`, …) +::: field-list + required + : No + + default + : numeric (i.e. `0`, `1`, `2`, …) + + type + : array of strings -:type: an array of strings. An empty array is treated as indicating `numeric` values. - -An explicit list of all values to iterate through when bumping this part. +An explicit list of all values to iterate through when bumping this part. An empty array is treated as indicating `numeric` values. ### `optional_value` -:required: No - -:default: The first entry in `values`, `0` when using numeric values -:type: string +::: field-list + required + : No + + default + : The first entry in `values`, `0` when using numeric values + + type + : string When the version part matches this value it is considered optional when serializing the final version string. -:::{note} +!!! note -Numeric values are still treated as strings internally, so when specifying an optional value, you must use a string. + Numeric values are still treated as strings internally, so when specifying an optional value, you must use a string. -::: ### `first_value` -:required: No -:default: The first entry in `values`, `0` when using numeric values +::: field-list + required + : No -:type: string + default + : The first entry in `values`, `0` when using numeric values -When the part is reset, the value will be set to the value specified here. + type + : string -:::{note} +When the part is reset, the value will be set to the value specified here. -Numeric values are still treated as strings internally, so when specifying a first value, you must use a string. +!!! note -::: + Numeric values are still treated as strings internally, so when specifying a first value, you must use a string. ### `independent` -:required: No - -:default: `False` -:type: boolean +::: field-list + required + : No + + default + : `False` + + type + : boolean When this value is set to `True`, the part is not reset when other parts are incremented. Its incrementation is independent of the other parts. It is useful when you have a build number in your version that is incremented independently of the actual version. -### TOML example +### Examples -```toml -[tool.bumpversion.parts.release] -values = [ - "alpha", - "beta", - "gamma" -] -optional_value = "gamma" -``` +=== "TOML" -### INI-style example + ```toml + [tool.bumpversion.parts.release] + values = [ + "alpha", + "beta", + "gamma" + ] + optional_value = "gamma" + ``` -```ini -[bumpversion:part:release] -optional_value = gamma -values = - alpha - beta - gamma -``` +=== "CFG" + + ```ini + [bumpversion:part:release] + optional_value = gamma + values = + alpha + beta + gamma + ``` ## File-specific configuration -This section configures which files bump-my-version should update by replacing their current version with the newly bumped version. +This section configures which files Bump My Version should update by replacing their current version with the newly bumped version. ### `filename` -:required: **Yes‡** - -:default: empty - -:type: string +::: field-list + required + : **Yes‡** + + default + : empty + + type + : string The name of the file to modify. -:::{Note} +!!! note -‡ This is only used with TOML configuration, and is only required if [`glob`](#glob) is _not_ specified. INI-style configuration files specify the file name as part of the grouping. + ‡ This is only used with TOML configuration, and is only required if [`glob`](#glob) is _not_ specified. INI-style configuration files specify the file name as part of the grouping. -::: ### `glob` -:required: **Yes‡** - -:default: empty - -:type: string +::: field-list + required + : **Yes‡** + + default + : empty + + type + : string The glob pattern specifying the files to modify. -:::{Note} +!!! note -‡ This is only used with TOML configuration, and is only required if [`filename`](#filename) is _not_ specified. INI-style configuration files specify the glob pattern as part of the grouping. + ‡ This is only used with TOML configuration, and is only required if [`filename`](#filename) is _not_ specified. INI-style configuration files specify the glob pattern as part of the grouping. -::: ### `parse` -:required: No - -:default: the value configured in the global `parse` field +::: field-list -:type: string + required + : No + + default + : the value configured in the global `parse` field + + type + : string This is an override to the default pattern to parse the version number from this file. ### `serialize` -:required: No +::: field-list -:default: The value configured in the global `serialize` field - -:type: an array of strings + required + : No + + default + : the value configured in the global `serialize` field + + type + : an array of strings This is an override to the default templates to serialize the new version number in this file. ### `search` -:required: No - -:default: The value configured in the global `search` field +::: field-list -:type: string + required + : No + + default + : the value configured in the global `search` field + + type + : string This is an override to the default template string how to search for the string to be replaced in the file. ### `replace` -:required: No - -:default: The value configured in the global `replace` field +::: field-list -:type: string + required + : No + + default + : the value configured in the global `replace` field + + type + : string This is an override to the template to create the string that will replace the current version number in the file. ### `ignore_missing_version` -:required: No -:default: The value configured in the global `ignore_missing_version` field +::: field-list -:type: boolean + required + : No + + default + : The value configured in the global `ignore_missing_version` field + + type + : boolean If `True`, don't fail if the version string to be replaced is not found in the file. @@ -462,11 +611,10 @@ INI-style configuration is in the section: `[bumpversion:file:]` or `[ Both, `file:` and `glob:` are configured the same. Their difference is that file will match file names directly like `requirements.txt`. While glob also matches multiple files via wildcards like `**/pom.xml`. -:::{note} +!!! note -The configuration file format requires each section header to be unique. If you want to process a certain file multiple times, you may append a description between parens to the `file` keyword: `[bumpversion:file (special one):…]`. + The configuration file format requires each section header to be unique. If you want to process a certain file multiple times, you may append a description between parens to the `file` keyword: `[bumpversion:file (special one):…]`. -::: For example, to change `coolapp/__init__.py` with the defaults, and alter `CHANGELOG.md` in twice: diff --git a/docsrc/reference/formatting-context.md b/docsrc/reference/formatting-context.md index 1f7bb7dc..345fe0c9 100644 --- a/docsrc/reference/formatting-context.md +++ b/docsrc/reference/formatting-context.md @@ -10,16 +10,24 @@ These fields are available for ## Escaped characters -**`#`** The literal hash or [octothorpe](https://www.merriam-webster.com/dictionary/octothorpe) character. +::: field-list -**`;`** The literal semicolon character. + `#` + : The literal hash or [octothorpe](https://www.merriam-webster.com/dictionary/octothorpe) character. + + `;` + : The literal semicolon character. ## Date and time fields -**`now`** A Python datetime object representing the current local time, without a time zone reference. +::: field-list -**`utcnow`** A Python datetime object representing the current local time in the UTC time zone. + `now` + : A Python datetime object representing the current local time, without a time zone reference. + + `utcnow` + : A Python datetime object representing the current local time in the UTC time zone. You can provide [additional formatting guidance](https://docs.python.org/3.11/library/datetime.html#strftime-and-strptime-format-codes) for datetime objects using formatting codes. Put the formatting codes after the field and a colon. For example, `{now:%Y-%m-%d}` would output the current local time as `2023-04-20`. @@ -27,34 +35,50 @@ You can provide [additional formatting guidance](https://docs.python.org/3.11/li These fields will only have values if the code is in a Git or Mercurial repository. -**`commit_sha`** The latest commit reference. - -**`distance_to_latest_tag`** The number of commits since the latest tag. - -**`dirty`** A boolean indicating if the current repository has pending changes. - -**`branch_name`** The current branch name. - -**`short_branch_name`** The current branch name, converted to lowercase, with non-alphanumeric characters removed and truncated to 20 characters. For example, `feature/MY-long_branch-name` would become `featuremylongbranchn`. +::: field-list + + `commit_sha` + : The latest commit reference. + + `distance_to_latest_tag` + : The number of commits since the latest tag. + + `dirty` + : A boolean indicating if the current repository has pending changes. + + `branch_name` + : The current branch name. + + `short_branch_name` + : The current branch name, converted to lowercase, with non-alphanumeric characters removed and truncated to 20 characters. For example, `feature/MY-long_branch-name` would become `featuremylongbranchn`. ## Version fields -**`current_version`** The current version serialized as a string +::: field-list + `current_version` + : The current version serialized as a string + + `current_` + : Each version part defined by the [version configuration parsing regular expression](version-parts.md#version-configuration). The default configuration would have `current_major`, `current_minor`, and `current_patch` available. + + `new_version` + : The new version serialized as a string + + `new_` + : Each version part defined by the [version configuration parsing regular expression](version-parts.md#version-configuration). The default configuration would have `new_major`, `new_minor`, and `new_patch` available. -**`current_`** Each version part defined by the [version configuration parsing regular expression](version-parts.md#version-configuration). The default configuration would have `current_major`, `current_minor`, and `current_patch` available. +!!! note -**`new_version`** The new version serialized as a string + The following fields are only available when serializing a version. -**`new_`** Each version part defined by the [version configuration parsing regular expression](version-parts.md#version-configuration). The default configuration would have `new_major`, `new_minor`, and `new_patch` available. - -:::{note} -The following fields are only available when serializing a version. -::: - -**``** Each version part defined by the [version configuration parsing regular expression](version-parts.md#version-configuration). The default configuration would have `major`, `minor`, and `patch` available. +::: field-list + `` + : Each version part defined by the [version configuration parsing regular expression](version-parts.md#version-configuration). The default configuration would have `major`, `minor`, and `patch` available. ## Environment variables Every environment variable available at runtime is included with a `$` prefix. For example if `USER` was in the environment, `{$USER}` would render that value. -If you use environment variables in your version serialization, you might want to ensure they are set by executing `export VAR=value` before running the `bump-my-version` command. +!!! tip + + If you use environment variables in your version serialization, you might want to ensure they are set by executing `export VAR=value` before running the `bump-my-version` command. diff --git a/docsrc/reference/index.md b/docsrc/reference/index.md index 61c12d36..598778f3 100644 --- a/docsrc/reference/index.md +++ b/docsrc/reference/index.md @@ -1,15 +1,9 @@ # Reference - -```{toctree} ---- -titlesonly: true ---- -cli -configuration -formatting-context -version-parts -search-and-replace-config -bumpversion/bumpversion -``` +- [Command-line interface](cli.md) +- [Configuration](configuration.md) +- [Formatting context](formatting-context.md) +- [Version parts](version-parts.md) +- [Search and replace configuration](search-and-replace-config.md) +- [API](api/bumpversion.md) diff --git a/docsrc/reference/search-and-replace-config.md b/docsrc/reference/search-and-replace-config.md index d4dd4ecc..6a74f2ec 100644 --- a/docsrc/reference/search-and-replace-config.md +++ b/docsrc/reference/search-and-replace-config.md @@ -53,17 +53,17 @@ If you are using a TOML-formatted configuration file, you must also escape backs The following template: -```toml -# TOML-formatted configuration file -search = "{current_version} date-released: \\d{{4}}-\\d{{2}}-\\d{{2}}" -``` +=== "TOML" -or + ```toml + search = "{current_version} date-released: \\d{{4}}-\\d{{2}}-\\d{{2}}" + ``` -```ini -# INI-formatted configuration file -search = "{current_version} date-released: \d{{4}}-\d{{2}}-\d{{2}}" -``` +=== "CFG" + + ```ini + search = "{current_version} date-released: \d{{4}}-\d{{2}}-\d{{2}}" + ``` Gets rendered to: diff --git a/docsrc/reference/version-parts.md b/docsrc/reference/version-parts.md index 116da766..06900061 100644 --- a/docsrc/reference/version-parts.md +++ b/docsrc/reference/version-parts.md @@ -1,7 +1,7 @@ # Version parts - The version string is the rendering of some or all version parts. -- While the version string may be rendered differently in various places, the value for all parts is maintained in bump-my-version's configuration. +- While the version string may be rendered differently in various places, the value for all parts is maintained in Bump My Version's configuration. - The version parts are typically dependent on each other. Incrementing one part might change other elements. - You can compare two version strings (of the same project) and know which is more recent. @@ -25,7 +25,7 @@ serialize = [ ] ``` -Bump-my-version will serialize using the first format if the `patch` value is not `0`. If the `patch` value *is* `0`, bump-my-version will use the second format. +Bump-my-version will serialize using the first format if the `patch` value is not `0`. If the `patch` value *is* `0`, Bump My Version will use the second format. ## Version part configuration diff --git a/docsrc/tutorials/index.md b/docsrc/tutorials/index.md index 46166c25..4978d42d 100644 --- a/docsrc/tutorials/index.md +++ b/docsrc/tutorials/index.md @@ -1,7 +1,5 @@ # Tutorials - -```{toctree} -semantic-versioning-example -``` +- [Versioning using semantic versioning](semantic-versioning-example.md) +- [Basic usage](usage.md) diff --git a/docsrc/usage.md b/docsrc/tutorials/usage.md similarity index 84% rename from docsrc/usage.md rename to docsrc/tutorials/usage.md index e6a70819..ec0b0acf 100644 --- a/docsrc/usage.md +++ b/docsrc/tutorials/usage.md @@ -1,22 +1,18 @@ # Usage -```{admonition} NOTE - -You can use `bumpversion` or `bump-my-version` throughout this document interchangeably. -``` There are two modes of operation: On the command line for single-file operation and using a configuration file (`pyproject.toml` or `.bumpversion.toml`) for more complex multi-file processes. We recommend using a configuration file for all but the simplest of projects. -```{admonition} WARNING +!!! Warning + + The invocation of `bump-my-version` changed in version 0.6.0. It splits functionality into sub-commands. It remains backward-compatible with previous versions. Previous usage is discouraged and may be removed in a 1.0 release. -The invocation of `bump-my-version` changed in version 0.6.0. It splits functionality into sub-commands. It remains backward-compatible with previous versions. Previous usage is discouraged and may be removed in a 1.0 release. -``` ## Incrementing a version ```console bump-my-version bump [OPTIONS] [ARGS]... ``` -The `bump` sub-command triggers a version increment. The [complete list of options](reference/cli.rst#bumpversion-bump) is available. The `ARGS` may contain a `VERSION_PART` or `FILES` +The `bump` sub-command triggers a version increment. The [complete list of options](../reference/cli.md#bump-my-version-bump) is available. The `ARGS` may contain a `VERSION_PART` or `FILES` ### `VERSION_PART` @@ -25,7 +21,7 @@ _**[optional]**_ The part of the version to increase, e.g., `minor`. -Valid values include those given in the [`--serialize`](reference/configuration.md#serialize) / [`--parse`](reference/configuration.md#parse) option. +Valid values include those given in the [`--serialize`](../reference/configuration.md#serialize) / [`--parse`](../reference/configuration.md#parse) option. For example, if the current version is `0.5.1` and you want to bump it to `0.6.0`: diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 00000000..15527dd7 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,114 @@ +site_name: Bump My Version +repo_url: https://github.com/callowayproject/bump-my-version +edit_uri: edit/master/docs/ +copyright: Calloway Project +docs_dir: docsrc +watch: + - overrides +theme: + name: material + custom_dir: overrides + logo: _static/bump-my-version-logo.svg + favicon: _static/favicon.png + features: + - navigation.tabs + - navigation.sections + - navigation.path + - navigation.indexes + - toc.integrate + - content.action.edit + - content.action.view + - content.code.annotate + - content.tabs.link + palette: + - media: "(prefers-color-scheme: light)" + scheme: default + toggle: + icon: material/toggle-switch-off-outline + name: Switch to dark mode + - media: "(prefers-color-scheme: dark)" + scheme: slate + toggle: + icon: material/toggle-switch + name: Switch to light mode +use_directory_urls: false +markdown_extensions: + - abbr + - admonition + - attr_list + - def_list + - customblocks + - footnotes + - md_in_html + - mdx_truly_sane_lists + - mkdocs-click + - pymdownx.details + - pymdownx.emoji: + emoji_index: !!python/name:material.extensions.emoji.twemoji + emoji_generator: !!python/name:material.extensions.emoji.to_svg + - pymdownx.highlight + - pymdownx.snippets + - pymdownx.superfences + - pymdownx.tabbed: + alternate_style: true + slugify: !!python/object/apply:pymdownx.slugs.slugify + kwds: + case: lower + - toc: + permalink: true + toc_depth: 3 + - tables + +plugins: + - search + - git-revision-date-localized + - git-authors: + show_email_address: false + - include-markdown + - drawio + - literate-nav: + nav_file: SUMMARY.md + - gen-files: + scripts: + - docsrc/gen_doc_stubs.py + - mkdocstrings: + custom_templates: overrides/mkdocstrings + handlers: + python: + import: + - https://docs.python.org/3/objects.inv + - https://numpy.org/doc/stable/objects.inv + - https://pandas.pydata.org/docs/objects.inv + - https://api.python.langchain.com/en/latest/objects.inv + options: + allow_inspection: true + docstring_style: google + docstring_options: + ignore_init_summary: true + docstring_section_style: spacy + enable_inventory: true + group_by_category: true + members_order: alphabetical + merge_init_into_class: true + separate_signature: true + show_docstring_parameters: true + show_signature_annotations: true + show_source: false + show_symbol_type_heading: true + show_symbol_type_toc: true + show_category_heading: true + +extra_javascript: + - "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-MML-AM_CHTML" + +extra_css: + - _static/css/custom.css + - _static/css/mkdocstrings.css + - _static/css/cards.css + +#nav: +# - General: "general/" +# - Provisioning LLMs for Applications: "provisioning-llms/" +# - Tutorials: "tutorials/" +# - Security & Privacy: "security-and-privacy/" +# - Guilds: "guilds/" diff --git a/pyproject.toml b/pyproject.toml index 1aa304ca..97b1eb24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -58,15 +58,19 @@ dev = [ "pre-commit", ] docs = [ - "ghp-import", - "linkify-it-py", - "myst-parser", - "furo", - "Sphinx>=4.3.0", - "sphinx-autodoc2", - "sphinx-autodoc-typehints", - "sphinx-click", - "sphinx-copybutton", + "markdown-customblocks", + "mdx-truly-sane-lists", + "mkdocs", + "mkdocs-click", + "mkdocs-gen-files", + "mkdocs-git-authors-plugin", + "mkdocs-git-committers-plugin", + "mkdocs-git-revision-date-localized-plugin", + "mkdocs-include-markdown-plugin", + "mkdocs-literate-nav", + "mkdocs-material", + "mkdocstrings", + "mkdocstrings[python]", ] test = [ "coverage", @@ -226,9 +230,6 @@ values = ["release", "post"] [[tool.bumpversion.files]] filename = "bumpversion/__init__.py" -[[tool.bumpversion.files]] -filename = "docsrc/reference/bumpversion/bumpversion.md" - [[tool.bumpversion.files]] filename = "CHANGELOG.md" search = "Unreleased" diff --git a/tests/fixtures/basic_cfg_expected.txt b/tests/fixtures/basic_cfg_expected.txt index a4bbdc63..4ef4dc51 100644 --- a/tests/fixtures/basic_cfg_expected.txt +++ b/tests/fixtures/basic_cfg_expected.txt @@ -5,6 +5,7 @@ 'excluded_paths': [], 'files': [{'filename': 'setup.py', 'glob': None, + 'ignore_missing_file': False, 'ignore_missing_version': False, 'key_path': None, 'parse': '(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?', @@ -15,6 +16,7 @@ '{major}.{minor}.{patch}')}, {'filename': 'bumpversion/__init__.py', 'glob': None, + 'ignore_missing_file': False, 'ignore_missing_version': False, 'key_path': None, 'parse': '(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?', @@ -25,6 +27,7 @@ '{major}.{minor}.{patch}')}, {'filename': 'CHANGELOG.md', 'glob': None, + 'ignore_missing_file': False, 'ignore_missing_version': False, 'key_path': None, 'parse': '(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?', @@ -33,6 +36,7 @@ 'search': '**unreleased**', 'serialize': ('{major}.{minor}.{patch}-{release}', '{major}.{minor}.{patch}')}], + 'ignore_missing_files': False, 'ignore_missing_version': False, 'included_paths': [], 'message': 'Bump version: {current_version} → {new_version}', diff --git a/tests/fixtures/basic_cfg_expected.yaml b/tests/fixtures/basic_cfg_expected.yaml index 34fb8cdd..ef6ba4be 100644 --- a/tests/fixtures/basic_cfg_expected.yaml +++ b/tests/fixtures/basic_cfg_expected.yaml @@ -7,6 +7,7 @@ excluded_paths: files: - filename: "setup.py" glob: null + ignore_missing_file: false ignore_missing_version: false key_path: null parse: "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?" @@ -18,6 +19,7 @@ files: - "{major}.{minor}.{patch}" - filename: "bumpversion/__init__.py" glob: null + ignore_missing_file: false ignore_missing_version: false key_path: null parse: "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?" @@ -29,6 +31,7 @@ files: - "{major}.{minor}.{patch}" - filename: "CHANGELOG.md" glob: null + ignore_missing_file: false ignore_missing_version: false key_path: null parse: "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?" @@ -38,6 +41,7 @@ files: serialize: - "{major}.{minor}.{patch}-{release}" - "{major}.{minor}.{patch}" +ignore_missing_files: false ignore_missing_version: false included_paths: diff --git a/tests/fixtures/basic_cfg_expected_full.json b/tests/fixtures/basic_cfg_expected_full.json index 2027e73e..c1e3a4c7 100644 --- a/tests/fixtures/basic_cfg_expected_full.json +++ b/tests/fixtures/basic_cfg_expected_full.json @@ -8,6 +8,7 @@ { "filename": "setup.py", "glob": null, + "ignore_missing_file": false, "ignore_missing_version": false, "key_path": null, "parse": "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?", @@ -22,6 +23,7 @@ { "filename": "bumpversion/__init__.py", "glob": null, + "ignore_missing_file": false, "ignore_missing_version": false, "key_path": null, "parse": "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?", @@ -36,6 +38,7 @@ { "filename": "CHANGELOG.md", "glob": null, + "ignore_missing_file": false, "ignore_missing_version": false, "key_path": null, "parse": "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?", @@ -48,6 +51,7 @@ ] } ], + "ignore_missing_files": false, "ignore_missing_version": false, "included_paths": [], "message": "Bump version: {current_version} \u2192 {new_version}", diff --git a/tests/test_cli/test_bump.py b/tests/test_cli/test_bump.py index 6105e2d6..cc658212 100644 --- a/tests/test_cli/test_bump.py +++ b/tests/test_cli/test_bump.py @@ -2,6 +2,7 @@ import shutil import subprocess +import traceback from datetime import datetime from pathlib import Path @@ -89,6 +90,7 @@ def test_with_version_part_includes_new_version(self, tmp_path: Path, fixtures_p "search={current_version}", "replace={new_version}", "regex=False", + "ignore_missing_files=False", "ignore_missing_version=False", "included_paths=[]", "tag=True", @@ -105,19 +107,19 @@ def test_with_version_part_includes_new_version(self, tmp_path: Path, fixtures_p "'serialize': ('{major}.{minor}.{patch}-{release}', " "'{major}.{minor}.{patch}'), 'search': '{current_version}', 'replace': " "'{new_version}', 'regex': False, 'ignore_missing_version': False, " - "'filename': 'setup.py', 'glob': None, 'key_path': None}, {'parse': " + "'ignore_missing_file': False, 'filename': 'setup.py', 'glob': None, 'key_path': None}, {'parse': " "'(?P\\\\d+)\\\\.(?P\\\\d+)\\\\.(?P\\\\d+)(\\\\-(?P[a-z]+))?', " "'serialize': ('{major}.{minor}.{patch}-{release}', " "'{major}.{minor}.{patch}'), 'search': '{current_version}', 'replace': " "'{new_version}', 'regex': False, 'ignore_missing_version': False, " - "'filename': 'bumpversion/__init__.py', 'glob': None, 'key_path': None}, " + "'ignore_missing_file': False, 'filename': 'bumpversion/__init__.py', 'glob': None, 'key_path': None}, " "{'parse': " "'(?P\\\\d+)\\\\.(?P\\\\d+)\\\\.(?P\\\\d+)(\\\\-(?P[a-z]+))?', " "'serialize': ('{major}.{minor}.{patch}-{release}', " "'{major}.{minor}.{patch}'), 'search': '**unreleased**', 'replace': " "'**unreleased**\\n**v{new_version}**', 'regex': False, " - "'ignore_missing_version': False, 'filename': 'CHANGELOG.md', 'glob': None, " - "'key_path': None}]" + "'ignore_missing_version': False, 'ignore_missing_file': False, 'filename': 'CHANGELOG.md', " + "'glob': None, 'key_path': None}]" ), } @@ -148,6 +150,7 @@ def test_without_version_part_excludes_new_version(self, tmp_path: Path, fixture "search={current_version}", "replace={new_version}", "regex=False", + "ignore_missing_files=False", "ignore_missing_version=False", "included_paths=[]", "tag=True", @@ -164,19 +167,19 @@ def test_without_version_part_excludes_new_version(self, tmp_path: Path, fixture "'serialize': ('{major}.{minor}.{patch}-{release}', " "'{major}.{minor}.{patch}'), 'search': '{current_version}', 'replace': " "'{new_version}', 'regex': False, 'ignore_missing_version': False, " - "'filename': 'setup.py', 'glob': None, 'key_path': None}, {'parse': " + "'ignore_missing_file': False, 'filename': 'setup.py', 'glob': None, 'key_path': None}, {'parse': " "'(?P\\\\d+)\\\\.(?P\\\\d+)\\\\.(?P\\\\d+)(\\\\-(?P[a-z]+))?', " "'serialize': ('{major}.{minor}.{patch}-{release}', " "'{major}.{minor}.{patch}'), 'search': '{current_version}', 'replace': " "'{new_version}', 'regex': False, 'ignore_missing_version': False, " - "'filename': 'bumpversion/__init__.py', 'glob': None, 'key_path': None}, " + "'ignore_missing_file': False, 'filename': 'bumpversion/__init__.py', 'glob': None, 'key_path': None}, " "{'parse': " "'(?P\\\\d+)\\\\.(?P\\\\d+)\\\\.(?P\\\\d+)(\\\\-(?P[a-z]+))?', " "'serialize': ('{major}.{minor}.{patch}-{release}', " "'{major}.{minor}.{patch}'), 'search': '**unreleased**', 'replace': " "'**unreleased**\\n**v{new_version}**', 'regex': False, " - "'ignore_missing_version': False, 'filename': 'CHANGELOG.md', 'glob': None, " - "'key_path': None}]" + "'ignore_missing_version': False, 'ignore_missing_file': False, 'filename': 'CHANGELOG.md', " + "'glob': None, 'key_path': None}]" ), } @@ -348,3 +351,41 @@ def test_detects_bad_or_missing_version_part(version_part: str, tmp_path: Path, # Assert assert result.exception is not None assert "Unknown version part:" in result.stdout + + +def test_ignores_missing_files_with_option(tmp_path, fixtures_path): + """The replace subcommand should ignore missing.""" + + config_file = tmp_path / ".bumpversion.toml" + config_file.write_text( + "[tool.bumpversion]\n" + 'current_version = "0.0.1"\n' + "allow_dirty = true\n\n" + "[[tool.bumpversion.files]]\n" + 'filename = "VERSION"\n' + "regex = false\n" + ) + + # Act + runner: CliRunner = CliRunner() + with inside_dir(tmp_path): + result: Result = runner.invoke( + cli.cli, + [ + "bump", + "--verbose", + "--no-regex", + "--no-configured-files", + "--ignore-missing-files", + "minor", + "VERSION", + ], + ) + + # Assert + if result.exit_code != 0: + print("Here is the output:") + print(result.output) + print(traceback.print_exception(result.exc_info[1])) + + assert result.exit_code == 0 diff --git a/tests/test_cli/test_replace.py b/tests/test_cli/test_replace.py index d749d995..3c6c061b 100644 --- a/tests/test_cli/test_replace.py +++ b/tests/test_cli/test_replace.py @@ -9,75 +9,6 @@ from bumpversion import cli from tests.conftest import inside_dir - -def test_replace(mocker, tmp_path, fixtures_path): - """The replace subcommand should replace the version in the file.""" - # Arrange - toml_path = fixtures_path / "basic_cfg.toml" - config_path = tmp_path / "pyproject.toml" - shutil.copy(toml_path, config_path) - - mocked_modify_files = mocker.patch("bumpversion.cli.modify_files") - runner: CliRunner = CliRunner() - with inside_dir(tmp_path): - result: Result = runner.invoke(cli.cli, ["replace", "--new-version", "1.1.0"]) - - if result.exit_code != 0: - print(result.output) - - assert result.exit_code == 0 - - call_args = mocked_modify_files.call_args[0] - configured_files = call_args[0] - assert len(configured_files) == 3 - actual_filenames = {f.file_change.filename for f in configured_files} - assert actual_filenames == {"setup.py", "CHANGELOG.md", "bumpversion/__init__.py"} - - -def test_replace_no_newversion(mocker, tmp_path, fixtures_path): - """The replace subcommand should set new_version to None in the context.""" - # Arrange - toml_path = fixtures_path / "basic_cfg.toml" - config_path = tmp_path / "pyproject.toml" - shutil.copy(toml_path, config_path) - - mocked_modify_files = mocker.patch("bumpversion.cli.modify_files") - runner: CliRunner = CliRunner() - with inside_dir(tmp_path): - result: Result = runner.invoke(cli.cli, ["replace"]) - - if result.exit_code != 0: - print(result.output) - - assert result.exit_code == 0 - - call_args = mocked_modify_files.call_args[0] - assert call_args[2] is None - - -def test_replace_specific_files(mocker, git_repo, fixtures_path): - """The replace subcommand should set the files to only the specified files.""" - # Arrange - toml_path = fixtures_path / "basic_cfg.toml" - config_path = git_repo / "pyproject.toml" - shutil.copy(toml_path, config_path) - - mocked_modify_files = mocker.patch("bumpversion.cli.modify_files") - runner: CliRunner = CliRunner() - with inside_dir(git_repo): - result: Result = runner.invoke(cli.cli, ["replace", "--no-configured-files", "VERSION"]) - - if result.exit_code != 0: - print(result.output) - - assert result.exit_code == 0 - - call_args = mocked_modify_files.call_args[0] - configured_files = call_args[0] - assert len(configured_files) == 1 - assert configured_files[0].file_change.filename == "VERSION" - - TEST_REPLACE_CONFIG = { "tool": { "bumpversion": { @@ -104,118 +35,277 @@ def test_replace_specific_files(mocker, git_repo, fixtures_path): } -def test_replace_search_with_plain_string(tmp_path, fixtures_path): - """Replace should not worry if the search or replace values have version info.""" - from tomlkit import dumps - - # Arrange - config_path = tmp_path / "pyproject.toml" - config_path.write_text(dumps(TEST_REPLACE_CONFIG)) - doc_path = tmp_path / "docs.yaml" - doc_path.write_text("url: https://github.com/sampleuser/workflows/main/.github/update_mailmap.py") - - runner: CliRunner = CliRunner() - with inside_dir(tmp_path): - result: Result = runner.invoke( - cli.cli, - [ - "replace", - "--no-configured-files", - "--search", - "/workflows/main/", - "--replace", - "/workflows/v{current_version}/", - "./docs.yaml", - ], - ) - - if result.exit_code != 0: - print("Here is the output:") - print(result.output) - print(traceback.print_exception(result.exc_info[1])) - - assert result.exit_code == 0 - - -def test_replace_with_empty_string(tmp_path, fixtures_path): - """Replace should not worry if the replace value has version info.""" - from tomlkit import dumps - - # Arrange - config_path = tmp_path / "pyproject.toml" - config_path.write_text(dumps(TEST_REPLACE_CONFIG)) - doc_path = tmp_path / "docs.yaml" - doc_path.write_text("We should censor profanity\n\n") - - runner: CliRunner = CliRunner() - with inside_dir(tmp_path): - result: Result = runner.invoke( - cli.cli, - [ - "replace", - "--verbose", - "--no-configured-files", - "--allow-dirty", - "--search", - "profanity", - "--replace", - "", - "./docs.yaml", - ], - ) - - if result.exit_code != 0: - print("Here is the output:") - print(result.output) - print(traceback.print_exception(result.exc_info[1])) - assert result.exit_code == 0 - assert doc_path.read_text() == "We should censor \n\n" - - -def test_valid_regex_not_ignoring_regex(tmp_path: Path, caplog) -> None: - """A search string not meant to be a regex (but is) is still found and replaced correctly.""" - # Arrange - search = "(unreleased)" - replace = "(2023-01-01)" - - version_path = tmp_path / "VERSION" - version_path.write_text("# Changelog\n\n## [0.0.1 (unreleased)](https://cool.url)\n\n- Test unreleased package.\n") - config_file = tmp_path / ".bumpversion.toml" - config_file.write_text( - "[tool.bumpversion]\n" - 'current_version = "0.0.1"\n' - "allow_dirty = true\n\n" - "[[tool.bumpversion.files]]\n" - 'filename = "VERSION"\n' - "regex = false\n" - f'search = "{search}"\n' - f'replace = "{replace}"\n' - ) - - # Act - runner: CliRunner = CliRunner() - with inside_dir(tmp_path): - result: Result = runner.invoke( - cli.cli, - [ - "replace", - "--verbose", - "--no-regex", - "--no-configured-files", - "--search", - search, - "--replace", - replace, - "VERSION", - ], - ) - - # Assert - if result.exit_code != 0: - print(result.output) - - assert result.exit_code == 0 - assert ( - version_path.read_text() - == "# Changelog\n\n## [0.0.1 (2023-01-01)](https://cool.url)\n\n- Test unreleased package.\n" - ) +class TestReplaceCLI: + """Test the replace CLI subcommand.""" + + class TestDefaultReplacesVersion: + """Test the default behavior of the replace subcommand.""" + + def test_default_affects_all_configured_files(self, mocker, tmp_path, fixtures_path): + """The replace subcommand should replace the version in all configured files.""" + # Arrange + toml_path = fixtures_path / "basic_cfg.toml" + config_path = tmp_path / "pyproject.toml" + shutil.copy(toml_path, config_path) + + mocked_modify_files = mocker.patch("bumpversion.cli.modify_files") + runner: CliRunner = CliRunner() + with inside_dir(tmp_path): + result: Result = runner.invoke(cli.cli, ["replace", "--new-version", "1.1.0"]) + + if result.exit_code != 0: + print("Here is the output:") + print(result.output) + print(traceback.print_exception(result.exc_info[1])) + + assert result.exit_code == 0 + + call_args = mocked_modify_files.call_args[0] + configured_files = call_args[0] + assert len(configured_files) == 3 + actual_filenames = {f.file_change.filename for f in configured_files} + assert actual_filenames == {"setup.py", "CHANGELOG.md", "bumpversion/__init__.py"} + + def test_can_limit_to_specific_files(self, mocker, git_repo, fixtures_path): + """The replace subcommand should set the files to only the specified files.""" + # Arrange + toml_path = fixtures_path / "basic_cfg.toml" + config_path = git_repo / "pyproject.toml" + shutil.copy(toml_path, config_path) + + mocked_modify_files = mocker.patch("bumpversion.cli.modify_files") + runner: CliRunner = CliRunner() + with inside_dir(git_repo): + result: Result = runner.invoke(cli.cli, ["replace", "--no-configured-files", "VERSION"]) + + if result.exit_code != 0: + print("Here is the output:") + print(result.output) + print(traceback.print_exception(result.exc_info[1])) + + assert result.exit_code == 0 + + call_args = mocked_modify_files.call_args[0] + configured_files = call_args[0] + assert len(configured_files) == 1 + assert configured_files[0].file_change.filename == "VERSION" + + class TestOptions: + """Test the options of the replace subcommand.""" + + def test_missing_newversion_is_set_to_none(self, mocker, tmp_path, fixtures_path): + """The replace subcommand should set new_version to None in the context.""" + # Arrange + toml_path = fixtures_path / "basic_cfg.toml" + config_path = tmp_path / "pyproject.toml" + shutil.copy(toml_path, config_path) + + mocked_modify_files = mocker.patch("bumpversion.cli.modify_files") + runner: CliRunner = CliRunner() + with inside_dir(tmp_path): + result: Result = runner.invoke(cli.cli, ["replace"]) + + if result.exit_code != 0: + print("Here is the output:") + print(result.output) + print(traceback.print_exception(result.exc_info[1])) + + assert result.exit_code == 0 + + call_args = mocked_modify_files.call_args[0] + assert call_args[2] is None + + def test_ignores_missing_files_with_option(self, mocker, tmp_path, fixtures_path): + """The replace subcommand should ignore missing.""" + + config_file = tmp_path / ".bumpversion.toml" + config_file.write_text( + "[tool.bumpversion]\n" + 'current_version = "0.0.1"\n' + "allow_dirty = true\n\n" + "[[tool.bumpversion.files]]\n" + 'filename = "VERSION"\n' + "regex = false\n" + ) + + # Act + runner: CliRunner = CliRunner() + with inside_dir(tmp_path): + result: Result = runner.invoke( + cli.cli, + [ + "replace", + "--verbose", + "--no-regex", + "--no-configured-files", + "--ignore-missing-files", + "VERSION", + ], + ) + + # Assert + if result.exit_code != 0: + print("Here is the output:") + print(result.output) + print(traceback.print_exception(result.exc_info[1])) + + assert result.exit_code == 0 + + class TestSearchInputs: + """Test the search inputs of the replace subcommand.""" + + def test_accepts_plain_string(self, tmp_path, fixtures_path): + """Replace should not worry if the search values have version info.""" + from tomlkit import dumps + + # Arrange + config_path = tmp_path / "pyproject.toml" + config_path.write_text(dumps(TEST_REPLACE_CONFIG)) + doc_path = tmp_path / "docs.yaml" + doc_path.write_text("url: https://github.com/sampleuser/workflows/main/.github/update_mailmap.py") + + runner: CliRunner = CliRunner() + with inside_dir(tmp_path): + result: Result = runner.invoke( + cli.cli, + [ + "replace", + "--no-configured-files", + "--search", + "/workflows/main/", + "--replace", + "/workflows/v{current_version}/", + "./docs.yaml", + ], + ) + + if result.exit_code != 0: + print("Here is the output:") + print(result.output) + print(traceback.print_exception(result.exc_info[1])) + + assert result.exit_code == 0 + + def test_unintentional_valid_regex_still_found(self, tmp_path: Path, caplog) -> None: + """A search string not meant to be a regex (but is) is still found and replaced correctly.""" + # Arrange + search = "(unreleased)" + replace = "(2023-01-01)" + + version_path = tmp_path / "VERSION" + version_path.write_text( + "# Changelog\n\n## [0.0.1 (unreleased)](https://cool.url)\n\n- Test unreleased package.\n" + ) + config_file = tmp_path / ".bumpversion.toml" + config_file.write_text( + "[tool.bumpversion]\n" + 'current_version = "0.0.1"\n' + "allow_dirty = true\n\n" + "[[tool.bumpversion.files]]\n" + 'filename = "VERSION"\n' + "regex = false\n" + f'search = "{search}"\n' + f'replace = "{replace}"\n' + ) + + # Act + runner: CliRunner = CliRunner() + with inside_dir(tmp_path): + result: Result = runner.invoke( + cli.cli, + [ + "replace", + "--verbose", + "--no-regex", + "--no-configured-files", + "--search", + search, + "--replace", + replace, + "VERSION", + ], + ) + + # Assert + if result.exit_code != 0: + print("Here is the output:") + print(result.output) + print(traceback.print_exception(result.exc_info[1])) + + assert result.exit_code == 0 + assert ( + version_path.read_text() + == "# Changelog\n\n## [0.0.1 (2023-01-01)](https://cool.url)\n\n- Test unreleased package.\n" + ) + + class TestReplaceInputs: + """Test the replace inputs of the replace subcommand.""" + + def test_accepts_empty_string(self, tmp_path, fixtures_path): + """Replace should be able to replace strings with an empty string.""" + from tomlkit import dumps + + # Arrange + config_path = tmp_path / "pyproject.toml" + config_path.write_text(dumps(TEST_REPLACE_CONFIG)) + doc_path = tmp_path / "docs.yaml" + doc_path.write_text("We should censor profanity\n\n") + + runner: CliRunner = CliRunner() + with inside_dir(tmp_path): + result: Result = runner.invoke( + cli.cli, + [ + "replace", + "--verbose", + "--no-configured-files", + "--allow-dirty", + "--search", + "profanity", + "--replace", + "", + "./docs.yaml", + ], + ) + + if result.exit_code != 0: + print("Here is the output:") + print(result.output) + print(traceback.print_exception(result.exc_info[1])) + assert result.exit_code == 0 + assert doc_path.read_text() == "We should censor \n\n" + + def test_accepts_plain_string(self, tmp_path, fixtures_path): + """Replace should not worry if the replace values have version info.""" + from tomlkit import dumps + + # Arrange + config_path = tmp_path / "pyproject.toml" + config_path.write_text(dumps(TEST_REPLACE_CONFIG)) + doc_path = tmp_path / "docs.yaml" + doc_path.write_text("url: https://github.com/sampleuser/workflows/v2.17.7/.github/update_mailmap.py") + + runner: CliRunner = CliRunner() + with inside_dir(tmp_path): + result: Result = runner.invoke( + cli.cli, + [ + "replace", + "--no-configured-files", + "--search", + "/workflows/v{current_version}/", + "--replace", + "/workflows/main/", + "./docs.yaml", + ], + ) + + if result.exit_code != 0: + print("Here is the output:") + print(result.output) + print(traceback.print_exception(result.exc_info[1])) + + assert result.exit_code == 0 + assert ( + doc_path.read_text() == "url: https://github.com/sampleuser/workflows/main/.github/update_mailmap.py" + ) diff --git a/tests/test_configuredfile.py b/tests/test_configuredfile.py index 2df3c0fc..3ef2ca66 100644 --- a/tests/test_configuredfile.py +++ b/tests/test_configuredfile.py @@ -21,6 +21,7 @@ def test_file_change_is_identical_to_input(self): serialize=("{major}-{minor}-{patch}",), regex=True, ignore_missing_version=False, + ignore_missing_file=False, ) version_config = VersionConfig( parse="(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?", @@ -47,6 +48,7 @@ def test_version_config_uses_file_change_attrs(self): serialize=("{major}-{minor}-{patch}",), regex=True, ignore_missing_version=False, + ignore_missing_file=False, ) version_config = VersionConfig( parse="(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)(\\-(?P[a-z]+))?", diff --git a/tests/test_files.py b/tests/test_files.py index 5b10509b..df8586b4 100644 --- a/tests/test_files.py +++ b/tests/test_files.py @@ -479,6 +479,7 @@ def test_update_file_does_not_modify_non_toml_files(self, tmp_path: Path) -> Non replace=conf.replace, regex=conf.regex, ignore_missing_version=conf.ignore_missing_version, + ignore_missing_file=conf.ignore_missing_files, serialize=conf.serialize, parse=conf.parse, ) @@ -510,6 +511,7 @@ def test_update_replaces_key(self, tmp_path: Path, fixtures_path: Path) -> None: replace=conf.replace, regex=conf.regex, ignore_missing_version=conf.ignore_missing_version, + ignore_missing_file=conf.ignore_missing_files, serialize=conf.serialize, parse=conf.parse, ) diff --git a/tools/drawioexport.py b/tools/drawioexport.py new file mode 100644 index 00000000..3d22a27e --- /dev/null +++ b/tools/drawioexport.py @@ -0,0 +1,135 @@ +"""Draw.io export script.""" + +import os.path +import shutil +import subprocess +import sys +from pathlib import Path +from typing import List, Optional + + +def get_executable_paths() -> list[str]: + """Get the Draw.io executable paths for the platform. + + Declared as a function to allow us to use API/environment information + available only when running under the specified platform. + + Returns: + All known paths. + """ + if sys.platform.startswith("darwin"): + applications = [os.path.expanduser("~/Applications"), "/Applications"] + drawio_path = os.path.join("draw.io.app", "Contents", "MacOS", "draw.io") + return [os.path.join(d, drawio_path) for d in applications] + elif sys.platform.startswith("linux"): + return ["/opt/draw.io/drawio"] + elif sys.platform.startswith("win32"): + program_files = [os.environ["ProgramFiles"]] + if "ProgramFiles(x86)" in os.environ: + program_files.append(os.environ["ProgramFiles(x86)"]) + return [os.path.join(d, "draw.io", "draw.io.exe") for d in program_files] + else: + return [] + + +def get_drawio_executable(executable_names: Optional[List[str]] = None) -> Optional[str]: + """Ensure the Draw.io executable path is configured, or guess it. + + Args: + executable_names: List of executable names to check. + + Returns: + Final Draw.io executable. + """ + executable_names = executable_names or ["draw.io", "drawio"] + + for executable_name in executable_names: + executable = shutil.which(executable_name) + if executable: + return executable + + executable_paths = get_executable_paths() + + return next( + (executable_path for executable_path in executable_paths if os.path.isfile(executable_path)), + None, + ) + + +def use_cached_file(source: Path, cache_filename: Path) -> bool: + """Is the cached copy up to date? + + Args: + source: Source path. + cache_filename: Export cache filename. + + Returns: + True if cache is up to date else False. + """ + return cache_filename.exists() and cache_filename.stat().st_mtime >= source.stat().st_mtime + + +def export_file( + source: Path, + page_index: int, + dest: Path, + export_format: str, +) -> int: + """Export an individual file. + + Args: + source: Source path, absolute. + page_index: Page index, numbered from zero. + dest: Destination path, within cache. + export_format: Export format. + + Returns: + The Draw.io exit status. + """ + drawio_executable = get_drawio_executable() + cmd = [ + str(drawio_executable), + "--export", + str(source), + "--page-index", + str(page_index), + "--output", + str(dest), + "--format", + export_format, + "--embed-svg-images", + "--scale", + "2", + ] + result = subprocess.run(cmd) # noqa: S603 + return result.returncode + + +def export_file_if_needed(source: Path, page_index: int, dest_path: Path) -> None: + """Export an individual file if needed. + + Args: + source: Source path, absolute. + page_index: Page index, numbered from zero. + dest_path: Destination path. + """ + if not use_cached_file(source, dest_path): + export_file(source, page_index, dest_path, "svg") + else: + print(f"Using cached file {dest_path}") # noqa: T201 + + +if __name__ == "__main__": + output_files = [ + "creating-a-version-spec.svg", + "creating-a-version.svg", + "serializing-a-version-1.svg", + "serializing-a-version-1-0-0.svg", + "serializing-a-version-1-2-0.svg", + "serializing-a-version-1-2-3.svg", + ] + source_path = Path(__file__).parent.parent.joinpath("docsrc/_static/bump-my-version-model.drawio") + dest_path = Path(__file__).parent.parent.joinpath("docsrc/_static/") + for index, filename in enumerate(output_files): + filepath = dest_path.joinpath(filename) + export_file_if_needed(source_path, index, filepath)