From a2a302bce29825988c9aa0dbe71bd356523ae9c3 Mon Sep 17 00:00:00 2001 From: Dave Wapstra Date: Sun, 17 Jan 2021 19:05:30 +0100 Subject: [PATCH 1/7] check for tag if tag-num specified --- .gitignore | 5 ++++- src/bumpver/v2version.py | 5 +++++ test/test_version.py | 12 ++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c899f50..e910e29 100644 --- a/.gitignore +++ b/.gitignore @@ -216,4 +216,7 @@ fabric.properties .idea/httpRequests # Android studio 3.1+ serialized cache file -.idea/caches/build_file_checksums.ser \ No newline at end of file +.idea/caches/build_file_checksums.ser + +# Visual Studio Code +.vscode diff --git a/src/bumpver/v2version.py b/src/bumpver/v2version.py index 39e0e1e..8cd1ec7 100644 --- a/src/bumpver/v2version.py +++ b/src/bumpver/v2version.py @@ -754,6 +754,11 @@ def incr( else: cur_vinfo = old_vinfo._replace(**cur_cinfo._asdict()) + has_tag_part = cur_vinfo.tag != "final" + if tag_num and not tag and not has_tag_part: + logger.error("Invalid arguments, non-final --tag= is needed to use --tag-num.") + return None + cur_vinfo = _incr_numeric( raw_pattern, old_vinfo, diff --git a/test/test_version.py b/test/test_version.py index 191a534..ac5a1a5 100644 --- a/test/test_version.py +++ b/test/test_version.py @@ -73,6 +73,18 @@ def test_bump_random(monkeypatch): cur_version = new_version +def test_bump_tag_num(): + raw_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]" + cur_version = "0.1.1b0" + assert v2version.incr(cur_version, raw_pattern, tag_num=True ) == "0.1.1b1" + + +def test_bump_tag_num_without_tag(): + raw_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]" + cur_version = "0.1.1" + assert v2version.incr(cur_version, raw_pattern, tag_num=True ) == None + + def test_parse_version_info(): version_str = "v201712.0001-alpha" version_info = v1version.parse_version_info(version_str) From a73ab98acbd8b8e5ed7083a427fd3b4823e0d968 Mon Sep 17 00:00:00 2001 From: Dave Wapstra Date: Sun, 17 Jan 2021 19:45:53 +0100 Subject: [PATCH 2/7] Fix linting errors --- test/test_version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_version.py b/test/test_version.py index ac5a1a5..40b3da1 100644 --- a/test/test_version.py +++ b/test/test_version.py @@ -76,13 +76,13 @@ def test_bump_random(monkeypatch): def test_bump_tag_num(): raw_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]" cur_version = "0.1.1b0" - assert v2version.incr(cur_version, raw_pattern, tag_num=True ) == "0.1.1b1" + assert v2version.incr(cur_version, raw_pattern, tag_num=True) == "0.1.1b1" def test_bump_tag_num_without_tag(): raw_pattern = "MAJOR.MINOR.PATCH[PYTAGNUM]" cur_version = "0.1.1" - assert v2version.incr(cur_version, raw_pattern, tag_num=True ) == None + assert v2version.incr(cur_version, raw_pattern, tag_num=True) is None def test_parse_version_info(): From 140ac2e79b0ff384437c4e3119aa162333efc7f6 Mon Sep 17 00:00:00 2001 From: Dave Wapstra Date: Sun, 17 Jan 2021 22:20:14 +0100 Subject: [PATCH 3/7] Add environment output option (#152) Add --env option for environment output --- README.md | 17 ++++++++++++++++- src/bumpver/cli.py | 23 ++++++++++++++++++++--- test/test_cli.py | 11 +++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6aa9bf0..1c89c7a 100644 --- a/README.md +++ b/README.md @@ -538,7 +538,7 @@ ERROR - No patterns matched for file 'src/mymodule/utils.py' $ bumpver --help Usage: bumpver [OPTIONS] COMMAND [ARGS]... - Automatically update CalVer version strings in plaintext files. + Automatically update version strings in plaintext files. Options: --version Show the version and exit. @@ -591,6 +591,21 @@ Options: +To help with shell script automation, you can use `bumpver show --env`. + +```shell +$ bumpver show -n --env +YEAR_Y=2020 +YEAR_G= +... +TAG=final +... + +$ eval $(bumpver show -n --env) +$ echo $TAG +final +``` + ### Part Overview diff --git a/src/bumpver/cli.py b/src/bumpver/cli.py index 8f7255d..d2c113f 100755 --- a/src/bumpver/cli.py +++ b/src/bumpver/cli.py @@ -189,6 +189,15 @@ fetch_option = click.option( ) +env_option = click.option( + "-e", + "--env", + is_flag=True, + default=False, + help="Print version state for use with shell scripts: eval $(bumpver show --env)", +) + + def version_options(function: typ.Callable) -> typ.Callable: decorators = [ click.option("--major", is_flag=True, default=False, help="Increment major component."), @@ -413,7 +422,8 @@ def grep( @cli.command() @verbose_option @fetch_option -def show(verbose: int = 0, fetch: bool = True) -> None: +@env_option +def show(verbose: int = 0, fetch: bool = True, env: bool = False) -> None: """Show current version of your project.""" _configure_logging(verbose=max(_VERBOSE, verbose)) @@ -424,8 +434,15 @@ def show(verbose: int = 0, fetch: bool = True) -> None: sys.exit(1) cfg = _update_cfg_from_vcs(cfg, fetch) - click.echo(f"Current Version: {cfg.current_version}") - click.echo(f"PEP440 : {cfg.pep440_version}") + if env: + version_info = v2version.parse_version_info(cfg.current_version, cfg.version_pattern) + for key, val in version_info._asdict().items(): + click.echo(f"{key.upper()}={val if val else ''}") + click.echo(f"CURRENT_VERSION={cfg.current_version}") + click.echo(f"PEP440_VERSION={cfg.pep440_version}") + else: + click.echo(f"Current Version: {cfg.current_version}") + click.echo(f"PEP440 : {cfg.pep440_version}") def _colored_diff_lines(diff: str) -> typ.Iterable[str]: diff --git a/test/test_cli.py b/test/test_cli.py index 701c002..5145772 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -116,6 +116,17 @@ def test_version(runner): assert match +def test_show_env(runner): + _add_project_files("README.md", "setup.cfg") + + result = runner.invoke(cli.cli, ['init', "-vv"]) + assert result.exit_code == 0 + + result = runner.invoke(cli.cli, ['show', "-e"]) + assert result.exit_code == 0 + assert "TAG=alpha" in result.output + + def test_incr_default(runner): old_version = "v201709.1004-alpha" From 732f74439b77499b1f33dc31595bf06066d7b990 Mon Sep 17 00:00:00 2001 From: Manuel Barkhau Date: Sun, 17 Jan 2021 21:34:29 +0000 Subject: [PATCH 4/7] update license headers pycalver -> bumpver --- license.header | 6 +++--- setup.py | 4 ++-- src/bumpver/__init__.py | 4 ++-- src/bumpver/__main__.py | 4 ++-- src/bumpver/cli.py | 4 ++-- src/bumpver/config.py | 4 ++-- src/bumpver/parse.py | 4 ++-- src/bumpver/patterns.py | 4 ++-- src/bumpver/pysix.py | 4 ++-- src/bumpver/regexfmt.py | 4 ++-- src/bumpver/rewrite.py | 4 ++-- src/bumpver/utils.py | 4 ++-- src/bumpver/v1patterns.py | 4 ++-- src/bumpver/v1rewrite.py | 4 ++-- src/bumpver/v1version.py | 4 ++-- src/bumpver/v2patterns.py | 4 ++-- src/bumpver/v2rewrite.py | 4 ++-- src/bumpver/v2version.py | 4 ++-- src/bumpver/vcs.py | 4 ++-- src/bumpver/version.py | 4 ++-- test/test_rewrite.py | 8 ++++---- 21 files changed, 45 insertions(+), 45 deletions(-) diff --git a/license.header b/license.header index cb08b33..53ee994 100644 --- a/license.header +++ b/license.header @@ -1,9 +1,9 @@ Individual files contain the following tag instead of the full license text. - This file is part of the pycalver project - https://github.com/mbarkhau/pycalver + This file is part of the bumpver project + https://github.com/mbarkhau/bumpver - Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License + Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License SPDX-License-Identifier: MIT This enables machine processing of license information based on the SPDX diff --git a/setup.py b/setup.py index d131c85..80b82eb 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/__init__.py b/src/bumpver/__init__.py index 625139a..60fa7a9 100644 --- a/src/bumpver/__init__.py +++ b/src/bumpver/__init__.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/__main__.py b/src/bumpver/__main__.py index 588684c..ffaa6df 100644 --- a/src/bumpver/__main__.py +++ b/src/bumpver/__main__.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/cli.py b/src/bumpver/cli.py index d2c113f..ce81a1c 100755 --- a/src/bumpver/cli.py +++ b/src/bumpver/cli.py @@ -1,6 +1,6 @@ #!/usr/bin/env python -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/config.py b/src/bumpver/config.py index af48613..b893845 100644 --- a/src/bumpver/config.py +++ b/src/bumpver/config.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://gitlab.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://gitlab.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/parse.py b/src/bumpver/parse.py index d45c390..628781a 100644 --- a/src/bumpver/parse.py +++ b/src/bumpver/parse.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/patterns.py b/src/bumpver/patterns.py index 157d62b..84cc09f 100644 --- a/src/bumpver/patterns.py +++ b/src/bumpver/patterns.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/pysix.py b/src/bumpver/pysix.py index f11c7d8..abaecff 100644 --- a/src/bumpver/pysix.py +++ b/src/bumpver/pysix.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/regexfmt.py b/src/bumpver/regexfmt.py index 8d7a850..2c1e3f1 100644 --- a/src/bumpver/regexfmt.py +++ b/src/bumpver/regexfmt.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/rewrite.py b/src/bumpver/rewrite.py index 93a9b53..183066c 100644 --- a/src/bumpver/rewrite.py +++ b/src/bumpver/rewrite.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/utils.py b/src/bumpver/utils.py index 5f7c5bc..01606a4 100644 --- a/src/bumpver/utils.py +++ b/src/bumpver/utils.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/v1patterns.py b/src/bumpver/v1patterns.py index 265fffd..df42666 100644 --- a/src/bumpver/v1patterns.py +++ b/src/bumpver/v1patterns.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/v1rewrite.py b/src/bumpver/v1rewrite.py index bb594dd..8a7a67f 100644 --- a/src/bumpver/v1rewrite.py +++ b/src/bumpver/v1rewrite.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/v1version.py b/src/bumpver/v1version.py index b149974..b6ccd87 100644 --- a/src/bumpver/v1version.py +++ b/src/bumpver/v1version.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/v2patterns.py b/src/bumpver/v2patterns.py index ccf41ee..4b530f9 100644 --- a/src/bumpver/v2patterns.py +++ b/src/bumpver/v2patterns.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/v2rewrite.py b/src/bumpver/v2rewrite.py index e70ea12..4f67c43 100644 --- a/src/bumpver/v2rewrite.py +++ b/src/bumpver/v2rewrite.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/v2version.py b/src/bumpver/v2version.py index 8cd1ec7..d4cea33 100644 --- a/src/bumpver/v2version.py +++ b/src/bumpver/v2version.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/vcs.py b/src/bumpver/vcs.py index 87c144d..93f641e 100644 --- a/src/bumpver/vcs.py +++ b/src/bumpver/vcs.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/src/bumpver/version.py b/src/bumpver/version.py index fae6376..6ee0890 100644 --- a/src/bumpver/version.py +++ b/src/bumpver/version.py @@ -1,5 +1,5 @@ -# This file is part of the pycalver project -# https://github.com/mbarkhau/pycalver +# This file is part of the bumpver project +# https://github.com/mbarkhau/bumpver # # Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT diff --git a/test/test_rewrite.py b/test/test_rewrite.py index a306920..f4c94e3 100644 --- a/test/test_rewrite.py +++ b/test/test_rewrite.py @@ -227,8 +227,8 @@ def test_v1_iter_rewritten(): rewritten_datas = v1rewrite.iter_rewritten(file_patterns, new_vinfo) rfd = list(rewritten_datas)[0] expected = [ - "# This file is part of the pycalver project", - "# https://github.com/mbarkhau/pycalver", + "# This file is part of the bumpver project", + "# https://github.com/mbarkhau/bumpver", "#", "# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License", "# SPDX-License-Identifier: MIT", @@ -253,8 +253,8 @@ def test_v2_iter_rewritten(): rewritten_datas = v2rewrite.iter_rewritten(file_patterns, new_vinfo) rfd = list(rewritten_datas)[0] expected = [ - "# This file is part of the pycalver project", - "# https://github.com/mbarkhau/pycalver", + "# This file is part of the bumpver project", + "# https://github.com/mbarkhau/bumpver", "#", "# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License", "# SPDX-License-Identifier: MIT", From 1576a7373d1e259aecd6293f243e13523bfee314 Mon Sep 17 00:00:00 2001 From: Manuel Barkhau Date: Sun, 17 Jan 2021 21:36:37 +0000 Subject: [PATCH 5/7] update changelog --- CHANGELOG.md | 10 ++++++++++ license.header | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 715f937..d2c08f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog for https://github.com/mbarkhau/pycalver +## BumpVer 2021.1109 + + - Add `-e/--env` option to support shell script automation. + - Fix [github#151][github_i151]: invalid increment of `TAGNUM` when `TAG=final` is set. + +[github_i151]: https://gitlab.com/mbarkhau/pycalver/-/issues/15 + +Thank you to Dave Wapstra @dwapstra for your contributions. + + ## BumpVer 2020.1108 - Don't match empty patterns (possibly causing a whole file to be rewritten if braces `[]` are not escaped). diff --git a/license.header b/license.header index 53ee994..3ff84de 100644 --- a/license.header +++ b/license.header @@ -3,7 +3,7 @@ Individual files contain the following tag instead of the full license text. This file is part of the bumpver project https://github.com/mbarkhau/bumpver - Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License + Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License SPDX-License-Identifier: MIT This enables machine processing of license information based on the SPDX From 873ff229de0e80e89481ec7ee94f089f775d2b1d Mon Sep 17 00:00:00 2001 From: Manuel Barkhau Date: Sun, 17 Jan 2021 21:39:29 +0000 Subject: [PATCH 6/7] bump 2020.1108 -> 2021.1109 --- LICENSE | 2 +- README.md | 6 +++--- bootstrapit.sh | 2 +- license.header | 2 +- setup.cfg | 2 +- setup.py | 2 +- src/bumpver/__init__.py | 4 ++-- src/bumpver/__main__.py | 2 +- src/bumpver/cli.py | 4 ++-- src/bumpver/config.py | 2 +- src/bumpver/parse.py | 2 +- src/bumpver/patterns.py | 2 +- src/bumpver/pysix.py | 2 +- src/bumpver/regexfmt.py | 2 +- src/bumpver/rewrite.py | 2 +- src/bumpver/utils.py | 2 +- src/bumpver/v1patterns.py | 2 +- src/bumpver/v1rewrite.py | 2 +- src/bumpver/v1version.py | 2 +- src/bumpver/v2patterns.py | 2 +- src/bumpver/v2rewrite.py | 2 +- src/bumpver/v2version.py | 2 +- src/bumpver/vcs.py | 2 +- src/bumpver/version.py | 2 +- 24 files changed, 28 insertions(+), 28 deletions(-) diff --git a/LICENSE b/LICENSE index a7b7ab4..a3f8f80 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -MIT License Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) +MIT License Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 1c89c7a..a11ab36 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ Project/Repo: [![MIT License][img_license]][url_license] [![Supported Python Versions][img_pyversions]][url_pyversions] -[![CalVer 2020.1107][img_version]][url_version] +[![CalVer 2021.1109][img_version]][url_version] [![PyPI Releases][img_pypi]][url_pypi] [![PyPI Downloads][img_downloads]][url_downloads] @@ -56,7 +56,7 @@ Code Quality/CI: [img_downloads]: https://pepy.tech/badge/bumpver/month [url_downloads]: https://pepy.tech/project/bumpver -[img_version]: https://img.shields.io/static/v1.svg?label=CalVer&message=2020.1107&color=blue +[img_version]: https://img.shields.io/static/v1.svg?label=CalVer&message=2021.1109&color=blue [url_version]: https://pypi.org/project/bumpver/ [img_pypi]: https://img.shields.io/badge/PyPI-wheels-green.svg @@ -764,7 +764,7 @@ The create an initial configuration for project with `bumpver init`. $ pip install bumpver ... Installing collected packages: click toml lexid bumpver -Successfully installed bumpver-2020.1107 +Successfully installed bumpver-2021.1109 $ cd myproject ~/myproject/ diff --git a/bootstrapit.sh b/bootstrapit.sh index 63cc36b..f52d67d 100644 --- a/bootstrapit.sh +++ b/bootstrapit.sh @@ -13,7 +13,7 @@ PACKAGE_NAME="bumpver" GIT_REPO_NAMESPACE="mbarkhau" GIT_REPO_DOMAIN="github.com" -PACKAGE_VERSION="2020.1107" +PACKAGE_VERSION="2021.1109" DEFAULT_PYTHON_VERSION="python=3.8" SUPPORTED_PYTHON_VERSIONS="python=2.7 python=3.6 pypy2.7 pypy3.5 python=3.8" diff --git a/license.header b/license.header index 3ff84de..53ee994 100644 --- a/license.header +++ b/license.header @@ -3,7 +3,7 @@ Individual files contain the following tag instead of the full license text. This file is part of the bumpver project https://github.com/mbarkhau/bumpver - Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License + Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License SPDX-License-Identifier: MIT This enables machine processing of license information based on the SPDX diff --git a/setup.cfg b/setup.cfg index 265c531..917b049 100644 --- a/setup.cfg +++ b/setup.cfg @@ -89,7 +89,7 @@ addopts = --doctest-modules [bumpver] -current_version = "2020.1107" +current_version = "2021.1109" version_pattern = "YYYY.BUILD[-TAG]" commit_message = "bump {old_version} -> {new_version}" commit = True diff --git a/setup.py b/setup.py index 80b82eb..4129fc3 100644 --- a/setup.py +++ b/setup.py @@ -63,7 +63,7 @@ setuptools.setup( author="Manuel Barkhau", author_email="mbarkhau@gmail.com", url="https://github.com/mbarkhau/bumpver", - version="2020.1107", + version="2021.1109", keywords="version bumpver calver semver versioning bumpversion pep440", description="Bump version numbers in project files.", long_description=long_description, diff --git a/src/bumpver/__init__.py b/src/bumpver/__init__.py index 60fa7a9..21bd94d 100644 --- a/src/bumpver/__init__.py +++ b/src/bumpver/__init__.py @@ -1,8 +1,8 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """BumpVer: A CLI program for versioning.""" -__version__ = "2020.1107" +__version__ = "2021.1109" diff --git a/src/bumpver/__main__.py b/src/bumpver/__main__.py index ffaa6df..dced799 100644 --- a/src/bumpver/__main__.py +++ b/src/bumpver/__main__.py @@ -2,7 +2,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """ __main__ module for BumpVer. diff --git a/src/bumpver/cli.py b/src/bumpver/cli.py index ce81a1c..9b0fa80 100755 --- a/src/bumpver/cli.py +++ b/src/bumpver/cli.py @@ -2,7 +2,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """cli module for BumpVer.""" import io @@ -246,7 +246,7 @@ def version_options(function: typ.Callable) -> typ.Callable: @click.group() -@click.version_option(version="2020.1107") +@click.version_option(version="2021.1109") @click.help_option() @verbose_option def cli(verbose: int = 0) -> None: diff --git a/src/bumpver/config.py b/src/bumpver/config.py index b893845..d4789c4 100644 --- a/src/bumpver/config.py +++ b/src/bumpver/config.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://gitlab.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """Parse bumpver.toml, setup.cfg or pyproject.toml files.""" diff --git a/src/bumpver/parse.py b/src/bumpver/parse.py index 628781a..9afc286 100644 --- a/src/bumpver/parse.py +++ b/src/bumpver/parse.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """Parse PyCalVer strings from files.""" diff --git a/src/bumpver/patterns.py b/src/bumpver/patterns.py index 84cc09f..1f0d49a 100644 --- a/src/bumpver/patterns.py +++ b/src/bumpver/patterns.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT import typing as typ diff --git a/src/bumpver/pysix.py b/src/bumpver/pysix.py index abaecff..1b2b77a 100644 --- a/src/bumpver/pysix.py +++ b/src/bumpver/pysix.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT import sys import typing as typ diff --git a/src/bumpver/regexfmt.py b/src/bumpver/regexfmt.py index 2c1e3f1..a6fb458 100644 --- a/src/bumpver/regexfmt.py +++ b/src/bumpver/regexfmt.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT import re import logging diff --git a/src/bumpver/rewrite.py b/src/bumpver/rewrite.py index 183066c..269639f 100644 --- a/src/bumpver/rewrite.py +++ b/src/bumpver/rewrite.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT import typing as typ import difflib diff --git a/src/bumpver/utils.py b/src/bumpver/utils.py index 01606a4..313542d 100644 --- a/src/bumpver/utils.py +++ b/src/bumpver/utils.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT import typing as typ import functools diff --git a/src/bumpver/v1patterns.py b/src/bumpver/v1patterns.py index df42666..9b891dc 100644 --- a/src/bumpver/v1patterns.py +++ b/src/bumpver/v1patterns.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """Compose Regular Expressions from Patterns. diff --git a/src/bumpver/v1rewrite.py b/src/bumpver/v1rewrite.py index 8a7a67f..76bcd3e 100644 --- a/src/bumpver/v1rewrite.py +++ b/src/bumpver/v1rewrite.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """Rewrite files, updating occurences of version strings.""" diff --git a/src/bumpver/v1version.py b/src/bumpver/v1version.py index b6ccd87..67176b5 100644 --- a/src/bumpver/v1version.py +++ b/src/bumpver/v1version.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """Functions related to version string manipulation.""" diff --git a/src/bumpver/v2patterns.py b/src/bumpver/v2patterns.py index 4b530f9..e8857ea 100644 --- a/src/bumpver/v2patterns.py +++ b/src/bumpver/v2patterns.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """Compose Regular Expressions from Patterns. diff --git a/src/bumpver/v2rewrite.py b/src/bumpver/v2rewrite.py index 4f67c43..80604f5 100644 --- a/src/bumpver/v2rewrite.py +++ b/src/bumpver/v2rewrite.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """Rewrite files, updating occurences of version strings.""" diff --git a/src/bumpver/v2version.py b/src/bumpver/v2version.py index d4cea33..85366b5 100644 --- a/src/bumpver/v2version.py +++ b/src/bumpver/v2version.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT """Functions related to version string manipulation.""" diff --git a/src/bumpver/vcs.py b/src/bumpver/vcs.py index 93f641e..0613d47 100644 --- a/src/bumpver/vcs.py +++ b/src/bumpver/vcs.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT # # bumpver/vcs.py (this file) is based on code from the diff --git a/src/bumpver/version.py b/src/bumpver/version.py index 6ee0890..5c855b6 100644 --- a/src/bumpver/version.py +++ b/src/bumpver/version.py @@ -1,7 +1,7 @@ # This file is part of the bumpver project # https://github.com/mbarkhau/bumpver # -# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License +# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License # SPDX-License-Identifier: MIT import typing as typ import datetime as dt From f2bbde7ae2efa31da97a0cc275d8f4a098c413ae Mon Sep 17 00:00:00 2001 From: Manuel Barkhau Date: Sun, 17 Jan 2021 21:42:09 +0000 Subject: [PATCH 7/7] fix test --- test/test_rewrite.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_rewrite.py b/test/test_rewrite.py index f4c94e3..033abb3 100644 --- a/test/test_rewrite.py +++ b/test/test_rewrite.py @@ -230,7 +230,7 @@ def test_v1_iter_rewritten(): "# This file is part of the bumpver project", "# https://github.com/mbarkhau/bumpver", "#", - "# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License", + "# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License", "# SPDX-License-Identifier: MIT", '"""BumpVer: A CLI program for versioning."""', '', @@ -256,7 +256,7 @@ def test_v2_iter_rewritten(): "# This file is part of the bumpver project", "# https://github.com/mbarkhau/bumpver", "#", - "# Copyright (c) 2018-2020 Manuel Barkhau (mbarkhau@gmail.com) - MIT License", + "# Copyright (c) 2018-2021 Manuel Barkhau (mbarkhau@gmail.com) - MIT License", "# SPDX-License-Identifier: MIT", '"""BumpVer: A CLI program for versioning."""', '',