autopub 1.0.0a39__py3-none-any.whl → 1.0.0a41__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/plugins/__init__.py +7 -1
- autopub/plugins/github.py +7 -10
- {autopub-1.0.0a39.dist-info → autopub-1.0.0a41.dist-info}/METADATA +1 -1
- {autopub-1.0.0a39.dist-info → autopub-1.0.0a41.dist-info}/RECORD +7 -7
- {autopub-1.0.0a39.dist-info → autopub-1.0.0a41.dist-info}/LICENSE +0 -0
- {autopub-1.0.0a39.dist-info → autopub-1.0.0a41.dist-info}/WHEEL +0 -0
- {autopub-1.0.0a39.dist-info → autopub-1.0.0a41.dist-info}/entry_points.txt +0 -0
autopub/plugins/__init__.py
CHANGED
@@ -27,7 +27,13 @@ class AutopubPlugin:
|
|
27
27
|
|
28
28
|
plugin_config = config.get(self.id, {})
|
29
29
|
|
30
|
-
self.
|
30
|
+
self._config = configuration_class.model_validate(plugin_config)
|
31
|
+
|
32
|
+
@property
|
33
|
+
def config(self) -> ConfigType:
|
34
|
+
self.validate_config()
|
35
|
+
|
36
|
+
return self._config
|
31
37
|
|
32
38
|
def run_command(self, command: list[str]) -> None:
|
33
39
|
try:
|
autopub/plugins/github.py
CHANGED
@@ -85,9 +85,6 @@ class GithubPlugin(AutopubPlugin):
|
|
85
85
|
raise AutopubException("GITHUB_TOKEN environment variable is required")
|
86
86
|
|
87
87
|
self.repository_name = os.environ.get("GITHUB_REPOSITORY")
|
88
|
-
self.discussion_category_name = os.environ.get(
|
89
|
-
"DISCUSSION_CATEGORY_NAME", self.configuration.discussion_category
|
90
|
-
)
|
91
88
|
|
92
89
|
@cached_property
|
93
90
|
def _github(self) -> Github:
|
@@ -265,11 +262,11 @@ class GithubPlugin(AutopubPlugin):
|
|
265
262
|
)
|
266
263
|
|
267
264
|
for node in response["data"]["repository"]["discussionCategories"]["nodes"]:
|
268
|
-
if node["name"] == self.
|
265
|
+
if node["name"] == self.config.discussion_category:
|
269
266
|
return node["id"]
|
270
267
|
|
271
268
|
raise AutopubException(
|
272
|
-
f"Discussion category {self.
|
269
|
+
f"Discussion category {self.config.discussion_category} not found"
|
273
270
|
)
|
274
271
|
|
275
272
|
def _create_discussion(self, release_info: ReleaseInfo) -> str:
|
@@ -330,19 +327,19 @@ class GithubPlugin(AutopubPlugin):
|
|
330
327
|
|
331
328
|
changelog = self._get_release_message(release_info)
|
332
329
|
|
333
|
-
message = self.
|
330
|
+
message = self.config.comment_template_success.format(
|
334
331
|
changelog=changelog
|
335
332
|
)
|
336
333
|
|
337
334
|
self._update_or_create_comment(message)
|
338
335
|
|
339
336
|
def on_release_file_not_found(self) -> None:
|
340
|
-
message = self.
|
337
|
+
message = self.config.comment_template_missing_release
|
341
338
|
|
342
339
|
self._update_or_create_comment(message)
|
343
340
|
|
344
341
|
def on_release_notes_invalid(self, exception: AutopubException) -> None:
|
345
|
-
message = self.
|
342
|
+
message = self.config.comment_template_error.format(error=str(exception))
|
346
343
|
|
347
344
|
self._update_or_create_comment(message)
|
348
345
|
|
@@ -381,7 +378,7 @@ class GithubPlugin(AutopubPlugin):
|
|
381
378
|
reviewers = [f"@{reviewer}" for reviewer in contributors["reviewers"]]
|
382
379
|
message += f"\n\nReviewers: {', '.join(reviewers)}"
|
383
380
|
|
384
|
-
if self.
|
381
|
+
if self.config.include_sponsors:
|
385
382
|
sponsors = self._get_sponsors()
|
386
383
|
if sponsors["sponsors"]:
|
387
384
|
public_sponsors = [f"@{sponsor}" for sponsor in sponsors["sponsors"]]
|
@@ -424,7 +421,7 @@ class GithubPlugin(AutopubPlugin):
|
|
424
421
|
|
425
422
|
discussion_url = None
|
426
423
|
|
427
|
-
if self.
|
424
|
+
if self.config.create_discussions:
|
428
425
|
discussion_url = self._create_discussion(release_info)
|
429
426
|
|
430
427
|
self._create_release(release_info, discussion_url)
|
@@ -2,18 +2,18 @@ autopub/__init__.py,sha256=JOFsdJMarqnRydwUibnWL8JlmijG66I340q4zdcRENs,7263
|
|
2
2
|
autopub/cli/__init__.py,sha256=77rx1yYi8adLUZAW7Rs48CNVyYe4HgSMZ7pZyIxD1iQ,3894
|
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=S70a1xsmlBScfqPqn5stl8XzFw9D3nVVe4uVU2_gAdQ,2217
|
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=w2wsTsSklxZopi3ePnd-F5xoT5-faPhjnx_BvdZgNCA,13687
|
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.0a41.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
16
|
+
autopub-1.0.0a41.dist-info/METADATA,sha256=I3tjsBkAeMvesJiqdmJyUioI1miqvUkKBn-ssEx3-ao,992
|
17
|
+
autopub-1.0.0a41.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
18
|
+
autopub-1.0.0a41.dist-info/entry_points.txt,sha256=oeTav5NgCxif6mcZ_HeVGgGv5LzS4DwdI01nr4bO1IM,43
|
19
|
+
autopub-1.0.0a41.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|