mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 06:20:08 +01:00
Add dev to the list of valid release tags (#199)
* Add dev to the list of valid release tags * Add test for --tag=dev * Update changelog for #203 --------- Co-authored-by: Manuel Barkhau <mbarkhau@gmail.com>
This commit is contained in:
parent
8dc594c055
commit
a0f092c61b
6 changed files with 34 additions and 21 deletions
|
|
@ -3,8 +3,12 @@
|
|||
## BumpVer 2023.1121
|
||||
|
||||
- Fix [#200][gh_i200]: Fix compatability with packaging 23.0.
|
||||
- Fix [#203][gh_i203]: Add dev to the list of valid release tags
|
||||
|
||||
[gh_i200]: https://github.com/mbarkhau/bumpver/issues/200
|
||||
[gh_i203]: https://github.com/mbarkhau/bumpver/issues/203
|
||||
|
||||
Thank you [Sharon Yogev](https://github.com/sharonyogev) for your contribution.
|
||||
|
||||
|
||||
## BumpVer 2022.1120
|
||||
|
|
|
|||
|
|
@ -609,7 +609,7 @@ Options:
|
|||
--tag-num Increment release tag number (rc1, rc2,
|
||||
rc3..).
|
||||
-t, --tag <NAME> Override release tag of current_version. Valid
|
||||
options are: alpha, beta, rc, post, final.
|
||||
options are: alpha, beta, dev, rc, post, final.
|
||||
-p, --patch Increment PATCH component.
|
||||
-m, --minor Increment MINOR component.
|
||||
--major Increment MAJOR component.
|
||||
|
|
@ -645,11 +645,11 @@ final
|
|||
[url_calver_org_scheme]: https://calver.org/#scheme
|
||||
|
||||
| part | range / example(s) | info |
|
||||
|------------|---------------------------|---------------------------------------------|
|
||||
|------------|----------------------------|---------------------------------------------|
|
||||
| `MAJOR` | 0..9, 10..99, 100.. | `bumpver update --major` |
|
||||
| `MINOR` | 0..9, 10..99, 100.. | `bumpver update --minor` |
|
||||
| `PATCH` | 0..9, 10..99, 100.. | `bumpver update --patch` |
|
||||
| `TAG` | alpha, beta, rc, post | `--tag=<tag>` |
|
||||
| `TAG` | dev, alpha, beta, rc, post | `--tag=<tag>` |
|
||||
| `PYTAG` | a, b, rc, post | `--tag=<tag>` |
|
||||
| `NUM` | 0, 1, 2... | `-r/--tag-num` |
|
||||
| `YYYY` | 2019, 2020... | Full year, based on `strftime('%Y')` |
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ def _configure_logging(verbose: int = 0) -> None:
|
|||
logger.debug("Logging configured.")
|
||||
|
||||
|
||||
VALID_RELEASE_TAG_VALUES = ("alpha", "beta", "rc", "post", "final")
|
||||
VALID_RELEASE_TAG_VALUES = ("alpha", "beta", "dev", "rc", "post", "final")
|
||||
|
||||
|
||||
_current_date = dt.date.today().isoformat()
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ PART_PATTERNS = collections.OrderedDict(
|
|||
('PATCH' , r"[0-9]+"),
|
||||
('BUILD' , r"[0-9]+"),
|
||||
('BLD' , r"[1-9][0-9]*"),
|
||||
('TAG' , r"preview|final|alpha|beta|post|rc"),
|
||||
('PYTAG' , r"post|rc|a|b"),
|
||||
('TAG' , r"preview|final|dev|alpha|beta|post|rc"),
|
||||
('PYTAG' , r"dev|post|rc|a|b"),
|
||||
('GITHASH', r"\.[0-9]+\+.*"),
|
||||
('NUM' , r"[0-9]+"),
|
||||
('INC0' , r"[0-9]+"),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ def parse_version(version: str) -> typ.Any:
|
|||
import pkg_resources
|
||||
|
||||
return pkg_resources.parse_version(version)
|
||||
except (ImportError, pkg_resources.extern.packaging.version.InvalidVersion):
|
||||
except (ImportError, ValueError):
|
||||
import looseversion
|
||||
|
||||
return looseversion.LooseVersion(version)
|
||||
|
|
|
|||
|
|
@ -258,6 +258,15 @@ def test_incr_tag(runner):
|
|||
assert f"Version: {new_version}\n" in result.output
|
||||
|
||||
|
||||
def test_dev_tag(runner):
|
||||
old_version = "0.1.0"
|
||||
new_version = "0.1.1dev0"
|
||||
|
||||
result = runner.invoke(cli.cli, ['test', "-vv", old_version, SEMVER, "--patch", "--tag", "dev"])
|
||||
assert result.exit_code == 0
|
||||
assert f"Version: {new_version}\n" in result.output
|
||||
|
||||
|
||||
def test_incr_tag_num(runner):
|
||||
old_version = "0.1.0b0"
|
||||
new_version = "0.1.0b1"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue