git-tag-bump 0.3.2__tar.gz → 0.4__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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
import subprocess
|
|
3
3
|
from enum import Enum
|
|
4
|
-
from pathlib import Path
|
|
5
4
|
|
|
6
5
|
import typer
|
|
7
6
|
from dunamai import Version
|
|
@@ -50,23 +49,6 @@ def git_tag_new_version(tag):
|
|
|
50
49
|
git(['tag', '--annotate', '--message', 'Version', tag])
|
|
51
50
|
|
|
52
51
|
|
|
53
|
-
def git_push_tag(tag):
|
|
54
|
-
branch = git_output(['rev-parse', '--abbrev-ref', 'HEAD'])
|
|
55
|
-
try:
|
|
56
|
-
remote = git_output(['config', f'branch.{branch}.remote'])
|
|
57
|
-
except subprocess.CalledProcessError as error:
|
|
58
|
-
raise ClickException(f'Git branch `{branch}` has no remote') from error
|
|
59
|
-
|
|
60
|
-
git(['push', remote, tag])
|
|
61
|
-
rich_print(f'New tag was pushed to `{remote}`')
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def uv_build():
|
|
65
|
-
uv_build_command = ['uv', 'build', '--clear']
|
|
66
|
-
rich_print(f'Run: {" ".join(uv_build_command)}')
|
|
67
|
-
subprocess.check_call(uv_build_command)
|
|
68
|
-
|
|
69
|
-
|
|
70
52
|
app = typer.Typer()
|
|
71
53
|
|
|
72
54
|
|
|
@@ -80,8 +62,6 @@ def bump(
|
|
|
80
62
|
' [bold green]m[/bold green]inor'
|
|
81
63
|
' or [bold green]p[/bold green]atch',
|
|
82
64
|
),
|
|
83
|
-
push: bool = typer.Option(False, '--push', '-p', help='Push tag to remote repository.'),
|
|
84
|
-
build: bool = typer.Option(True, '--build/--no-build', '-b/-no-b', help='Run `uv build`'),
|
|
85
65
|
):
|
|
86
66
|
version = Version.from_git(ignore_untracked=True)
|
|
87
67
|
|
|
@@ -96,12 +76,6 @@ def bump(
|
|
|
96
76
|
git_tag_new_version(new_tag)
|
|
97
77
|
rich_print(f'[green]Created tag:[/green] [bold white]{new_tag}[/bold white]')
|
|
98
78
|
|
|
99
|
-
if push:
|
|
100
|
-
git_push_tag(new_tag)
|
|
101
|
-
|
|
102
|
-
if build and Path.isdir('dist'):
|
|
103
|
-
uv_build()
|
|
104
|
-
|
|
105
79
|
|
|
106
80
|
if __name__ == '__main__':
|
|
107
81
|
app()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|