fast-dev-cli 0.25.2__tar.gz → 0.25.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fast_dev_cli-0.25.2 → fast_dev_cli-0.25.3}/PKG-INFO +1 -1
- fast_dev_cli-0.25.3/fast_dev_cli/__init__.py +1 -0
- {fast_dev_cli-0.25.2 → fast_dev_cli-0.25.3}/fast_dev_cli/cli.py +29 -7
- {fast_dev_cli-0.25.2 → fast_dev_cli-0.25.3}/pyproject.toml +1 -1
- fast_dev_cli-0.25.2/fast_dev_cli/__init__.py +0 -1
- {fast_dev_cli-0.25.2 → fast_dev_cli-0.25.3}/LICENSE +0 -0
- {fast_dev_cli-0.25.2 → fast_dev_cli-0.25.3}/README.md +0 -0
- {fast_dev_cli-0.25.2 → fast_dev_cli-0.25.3}/fast_dev_cli/__main__.py +0 -0
- {fast_dev_cli-0.25.2 → fast_dev_cli-0.25.3}/fast_dev_cli/py.typed +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.25.3"
|
|
@@ -593,6 +593,29 @@ class BumpUp(DryRun):
|
|
|
593
593
|
echo(f"Invalid part: {s!r}")
|
|
594
594
|
raise Exit(1) from e
|
|
595
595
|
|
|
596
|
+
@staticmethod
|
|
597
|
+
def parse_new_version(part: str, version: str) -> str:
|
|
598
|
+
version_parts = version.split(".")
|
|
599
|
+
if not version_parts[-1].isdigit():
|
|
600
|
+
try:
|
|
601
|
+
p1, p2, p3 = version_parts[:3]
|
|
602
|
+
p2i = int(p2)
|
|
603
|
+
p1i = int(p1)
|
|
604
|
+
except ValueError:
|
|
605
|
+
...
|
|
606
|
+
else:
|
|
607
|
+
match part:
|
|
608
|
+
case "patch":
|
|
609
|
+
p3i = int(m.group()) if (m := re.match(r"\d+", p3)) else 0
|
|
610
|
+
if len(version_parts) == 3:
|
|
611
|
+
p3i += 1
|
|
612
|
+
return f"{p1}.{p2}.{p3i}"
|
|
613
|
+
case "minor":
|
|
614
|
+
return f"{p1}.{p2i + 1}.0"
|
|
615
|
+
case "major":
|
|
616
|
+
return f"{p1i + 1}.0.0"
|
|
617
|
+
return ""
|
|
618
|
+
|
|
596
619
|
def gen(self) -> str:
|
|
597
620
|
should_sync, _version = get_current_version(check_version=True)
|
|
598
621
|
filename = self.filename
|
|
@@ -606,9 +629,10 @@ class BumpUp(DryRun):
|
|
|
606
629
|
self.part = part
|
|
607
630
|
parse = r'--parse "(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)"'
|
|
608
631
|
filename_arg = _quote_shell_arg(filename)
|
|
609
|
-
cmd =
|
|
610
|
-
|
|
611
|
-
|
|
632
|
+
cmd = f'bumpversion {parse} --current-version="{_version}" '
|
|
633
|
+
if new_version := self.parse_new_version(part, _version):
|
|
634
|
+
cmd += f'--new-version="{new_version}" '
|
|
635
|
+
cmd += f"{part} {filename_arg}"
|
|
612
636
|
if self.commit:
|
|
613
637
|
if part != "patch":
|
|
614
638
|
cmd += " --tag"
|
|
@@ -674,15 +698,13 @@ def version() -> None:
|
|
|
674
698
|
@cli.command(name="bump")
|
|
675
699
|
def bump_version(
|
|
676
700
|
part: BumpUp.PartChoices,
|
|
701
|
+
sync: bool = False,
|
|
677
702
|
commit: bool = Option(
|
|
678
703
|
False, "--commit", "-c", help="Whether run `git commit` after version changed"
|
|
679
704
|
),
|
|
680
705
|
emoji: bool | None = Option(
|
|
681
706
|
None, "--emoji", help="Whether add emoji prefix to commit message"
|
|
682
707
|
),
|
|
683
|
-
no_sync: bool = Option(
|
|
684
|
-
False, "--no-sync", help="Do not run sync command to update version"
|
|
685
|
-
),
|
|
686
708
|
dry: bool = DryOption,
|
|
687
709
|
) -> None:
|
|
688
710
|
"""Bump up version string in pyproject.toml"""
|
|
@@ -691,7 +713,7 @@ def bump_version(
|
|
|
691
713
|
return BumpUp(
|
|
692
714
|
_ensure_bool(commit),
|
|
693
715
|
getattr(part, "value", part),
|
|
694
|
-
no_sync=_ensure_bool(
|
|
716
|
+
no_sync=not _ensure_bool(sync),
|
|
695
717
|
emoji=emoji,
|
|
696
718
|
dry=dry,
|
|
697
719
|
).run()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.25.2"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|