autopub 1.0.0a41__py3-none-any.whl → 1.0.0a43__py3-none-any.whl
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.
- autopub/cli/__init__.py +32 -31
- autopub/plugins/__init__.py +3 -2
- autopub/plugins/github.py +3 -0
- {autopub-1.0.0a41.dist-info → autopub-1.0.0a43.dist-info}/METADATA +1 -1
- {autopub-1.0.0a41.dist-info → autopub-1.0.0a43.dist-info}/RECORD +8 -8
- {autopub-1.0.0a41.dist-info → autopub-1.0.0a43.dist-info}/LICENSE +0 -0
- {autopub-1.0.0a41.dist-info → autopub-1.0.0a43.dist-info}/WHEEL +0 -0
- {autopub-1.0.0a41.dist-info → autopub-1.0.0a43.dist-info}/entry_points.txt +0 -0
autopub/cli/__init__.py
CHANGED
@@ -28,36 +28,6 @@ def check(context: AutoPubCLI):
|
|
28
28
|
|
29
29
|
autopub = context.obj
|
30
30
|
|
31
|
-
try:
|
32
|
-
autopub.validate_config()
|
33
|
-
except InvalidConfiguration as e:
|
34
|
-
title = "[red]🚨 Some of the plugins have invalid configuration[/]"
|
35
|
-
|
36
|
-
parts: list[RenderableType] = []
|
37
|
-
|
38
|
-
for id_ in e.validation_errors:
|
39
|
-
error = e.validation_errors[id_]
|
40
|
-
parts.append("")
|
41
|
-
parts.append(f"[bold on bright_magenta] Plugin: [/] {id_}")
|
42
|
-
parts.append("")
|
43
|
-
|
44
|
-
errors: list[RenderableType] = []
|
45
|
-
|
46
|
-
for error in error.errors():
|
47
|
-
location = " -> ".join(map(str, error["loc"]))
|
48
|
-
message = error["msg"]
|
49
|
-
|
50
|
-
errors.append(f"[bold on blue] {location} [/]: {message}")
|
51
|
-
errors.append("")
|
52
|
-
|
53
|
-
parts.append(Padding(Group(*errors), (0, 2)))
|
54
|
-
|
55
|
-
content = Group(f"[red]{title}[/]", *parts)
|
56
|
-
|
57
|
-
rich.print(Padding(content, (1, 1)))
|
58
|
-
|
59
|
-
raise typer.Exit(1) from e
|
60
|
-
|
61
31
|
try:
|
62
32
|
autopub.check()
|
63
33
|
except AutopubException as e:
|
@@ -146,8 +116,39 @@ def main(
|
|
146
116
|
raise typer.Exit()
|
147
117
|
|
148
118
|
autopub = Autopub()
|
149
|
-
|
119
|
+
|
120
|
+
|
150
121
|
# default plugins we always want to load (?)
|
151
122
|
autopub.load_plugins(["git", "update_changelog", "bump_version"])
|
152
123
|
|
124
|
+
try:
|
125
|
+
autopub.validate_config()
|
126
|
+
except InvalidConfiguration as e:
|
127
|
+
title = "[red]🚨 Some of the plugins have invalid configuration[/]"
|
128
|
+
|
129
|
+
parts: list[RenderableType] = []
|
130
|
+
|
131
|
+
for id_ in e.validation_errors:
|
132
|
+
error = e.validation_errors[id_]
|
133
|
+
parts.append("")
|
134
|
+
parts.append(f"[bold on bright_magenta] Plugin: [/] {id_}")
|
135
|
+
parts.append("")
|
136
|
+
|
137
|
+
errors: list[RenderableType] = []
|
138
|
+
|
139
|
+
for error in error.errors():
|
140
|
+
location = " -> ".join(map(str, error["loc"]))
|
141
|
+
message = error["msg"]
|
142
|
+
|
143
|
+
errors.append(f"[bold on blue] {location} [/]: {message}")
|
144
|
+
errors.append("")
|
145
|
+
|
146
|
+
parts.append(Padding(Group(*errors), (0, 2)))
|
147
|
+
|
148
|
+
content = Group(f"[red]{title}[/]", *parts)
|
149
|
+
|
150
|
+
rich.print(Padding(content, (1, 1)))
|
151
|
+
|
152
|
+
raise typer.Exit(1) from e
|
153
|
+
|
153
154
|
context.obj = autopub
|
autopub/plugins/__init__.py
CHANGED
@@ -19,6 +19,8 @@ class AutopubPlugin:
|
|
19
19
|
id: str
|
20
20
|
data: dict[str, object] = {}
|
21
21
|
|
22
|
+
_config: ConfigType | None = None
|
23
|
+
|
22
24
|
def validate_config(self, config: ConfigType):
|
23
25
|
configuration_class: type[BaseModel] | None = getattr(self, "Config", None)
|
24
26
|
|
@@ -31,8 +33,7 @@ class AutopubPlugin:
|
|
31
33
|
|
32
34
|
@property
|
33
35
|
def config(self) -> ConfigType:
|
34
|
-
self.
|
35
|
-
|
36
|
+
assert self._config is not None
|
36
37
|
return self._config
|
37
38
|
|
38
39
|
def run_command(self, command: list[str]) -> None:
|
autopub/plugins/github.py
CHANGED
@@ -408,6 +408,7 @@ class GithubPlugin(AutopubPlugin):
|
|
408
408
|
)
|
409
409
|
|
410
410
|
for asset in pathlib.Path("dist").glob("*"):
|
411
|
+
print("asset", asset, asset.suffix)
|
411
412
|
if asset.suffix in [".tar.gz", ".whl"]:
|
412
413
|
release.upload_asset(str(asset))
|
413
414
|
|
@@ -424,4 +425,6 @@ class GithubPlugin(AutopubPlugin):
|
|
424
425
|
if self.config.create_discussions:
|
425
426
|
discussion_url = self._create_discussion(release_info)
|
426
427
|
|
428
|
+
print("discussion_url", discussion_url)
|
429
|
+
|
427
430
|
self._create_release(release_info, discussion_url)
|
@@ -1,19 +1,19 @@
|
|
1
1
|
autopub/__init__.py,sha256=JOFsdJMarqnRydwUibnWL8JlmijG66I340q4zdcRENs,7263
|
2
|
-
autopub/cli/__init__.py,sha256=
|
2
|
+
autopub/cli/__init__.py,sha256=pIfIQaRPM8GZ1ANIWqWBZrRmaGjRGz-HiCUlPO0_q0I,3870
|
3
3
|
autopub/exceptions.py,sha256=gNUbiG3_fVmNjhk2kyueQHPSifNgQf0Bl6IDNvkVhxQ,1534
|
4
4
|
autopub/plugin_loader.py,sha256=2ysITgpHGUmcb1mP1Qvs-iBX2wZxmfP9obnebThwUMA,1809
|
5
|
-
autopub/plugins/__init__.py,sha256=
|
5
|
+
autopub/plugins/__init__.py,sha256=vpmk0u8nu_ex8eoEtpXJe-gpqww4OnMQaIfSDGx2XDw,2264
|
6
6
|
autopub/plugins/bump_version.py,sha256=yOXhKHAGFb1DcmeBdh5RfwkOpEYeTqMlE69HgIyUB58,1628
|
7
7
|
autopub/plugins/git.py,sha256=d0SMLc6hwuk0eymj8aHyu3_cEd-7x4fhkwu35wPPV4k,1054
|
8
|
-
autopub/plugins/github.py,sha256=
|
8
|
+
autopub/plugins/github.py,sha256=vVSmxDmoOnlJCwdQXMGbXQi90kheatghiwQ8sWPJYyI,13788
|
9
9
|
autopub/plugins/pdm.py,sha256=Pczye06fKg8_HMJDkEfMXQyvao9rZ7sqzTHFd6lLEpU,532
|
10
10
|
autopub/plugins/poetry.py,sha256=d2LvW9RI7ZB3reBOXbcp1mqWmzQ06Uyg_T-MxTvlSBg,517
|
11
11
|
autopub/plugins/update_changelog.py,sha256=g_6flOP5wocZbjOaYSayWxobL3ld8f0wT78nFtAIkFc,1586
|
12
12
|
autopub/plugins/uv.py,sha256=goo8QxaD3FVJ1c3xOSmN1hikZTCUXN8jWNac1S5uDDY,1089
|
13
13
|
autopub/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
14
14
|
autopub/types.py,sha256=gY1WR93XZVFS7vf5JMSmL_h5z7zO51-rtmZ6MYsh3so,1043
|
15
|
-
autopub-1.0.
|
16
|
-
autopub-1.0.
|
17
|
-
autopub-1.0.
|
18
|
-
autopub-1.0.
|
19
|
-
autopub-1.0.
|
15
|
+
autopub-1.0.0a43.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
16
|
+
autopub-1.0.0a43.dist-info/METADATA,sha256=YDDkhMJJHRbtkD5D9D_NYDc-oTcXaElsMA7zLUkmlw0,992
|
17
|
+
autopub-1.0.0a43.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
18
|
+
autopub-1.0.0a43.dist-info/entry_points.txt,sha256=oeTav5NgCxif6mcZ_HeVGgGv5LzS4DwdI01nr4bO1IM,43
|
19
|
+
autopub-1.0.0a43.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|