autopub 1.0.0a22__py3-none-any.whl → 1.0.0a24__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
autopub/__init__.py CHANGED
@@ -2,6 +2,8 @@ from __future__ import annotations
2
2
 
3
3
  import hashlib
4
4
  import json
5
+ import subprocess
6
+ import textwrap
5
7
  from functools import cached_property
6
8
  from pathlib import Path
7
9
  from typing import Iterable, Mapping, TypeAlias
@@ -151,6 +153,8 @@ class Autopub:
151
153
  plugin.post_publish(release_info)
152
154
 
153
155
  self._delete_release_file()
156
+ self._commit()
157
+ self._push()
154
158
 
155
159
  def validate_config(self) -> None:
156
160
  errors: dict[str, ValidationError] = {}
@@ -167,6 +171,22 @@ class Autopub:
167
171
  def _delete_release_file(self) -> None:
168
172
  self.release_file.unlink(missing_ok=True)
169
173
 
174
+ def _commit(self) -> None:
175
+ commit_message = textwrap.dedent(
176
+ f"""
177
+ Release {self.release_info.version}
178
+
179
+ {self.release_info.release_notes}
180
+
181
+ [skip ci]
182
+ """
183
+ )
184
+
185
+ subprocess.run(["git", "commit", "-m", commit_message])
186
+
187
+ def _push(self) -> None:
188
+ subprocess.run(["git", "push"])
189
+
170
190
  def _write_artifact(self, release_info: ReleaseInfo) -> None:
171
191
  data = {
172
192
  **release_info.dict(),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autopub
3
- Version: 1.0.0a22
3
+ Version: 1.0.0a24
4
4
  Summary: Automatic package release upon pull request merge
5
5
  Home-page: https://github.com/autopub/autopub
6
6
  Author: Justin Mayer
@@ -18,5 +18,6 @@ Requires-Dist: pydantic (>=2.10.5,<3.0.0)
18
18
  Requires-Dist: python-frontmatter (>=1.1.0,<2.0.0)
19
19
  Requires-Dist: rich (>=13.9.4,<14.0.0)
20
20
  Requires-Dist: tomlkit (>=0.13.2,<0.14.0)
21
+ Requires-Dist: typer (>=0.15.1,<0.16.0)
21
22
  Project-URL: Issue Tracker, https://github.com/autopub/autopub/issues
22
23
  Project-URL: Repository, https://github.com/autopub/autopub
@@ -1,4 +1,4 @@
1
- autopub/__init__.py,sha256=7u8F9STpmbbuMyfFx7piaICsAAQ4hd9z4Qjqq78wkfE,7057
1
+ autopub/__init__.py,sha256=prGRO0WeB5HD5G_tPrujwumgDBHXF20IjTmkkrkAk-U,7505
2
2
  autopub/cli/__init__.py,sha256=GZ1YNC0UDZqdMfQyNMD4D_D2ItTLcaiJLhPtsLwpH4s,3860
3
3
  autopub/exceptions.py,sha256=gNUbiG3_fVmNjhk2kyueQHPSifNgQf0Bl6IDNvkVhxQ,1534
4
4
  autopub/plugin_loader.py,sha256=i8nz0cmu5eaSRJ2Hx5KxbA-tOMR2mjcz8fdRg4zkGLE,1813
@@ -11,8 +11,8 @@ autopub/plugins/update_changelog.py,sha256=g_6flOP5wocZbjOaYSayWxobL3ld8f0wT78nF
11
11
  autopub/plugins/uv.py,sha256=goo8QxaD3FVJ1c3xOSmN1hikZTCUXN8jWNac1S5uDDY,1089
12
12
  autopub/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
13
13
  autopub/types.py,sha256=gY1WR93XZVFS7vf5JMSmL_h5z7zO51-rtmZ6MYsh3so,1043
14
- autopub-1.0.0a22.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
15
- autopub-1.0.0a22.dist-info/METADATA,sha256=EaL-7uaLKUyKt2WdhL0kWA7J90iuU5fE7bZ2gIZLooc,911
16
- autopub-1.0.0a22.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
17
- autopub-1.0.0a22.dist-info/entry_points.txt,sha256=oeTav5NgCxif6mcZ_HeVGgGv5LzS4DwdI01nr4bO1IM,43
18
- autopub-1.0.0a22.dist-info/RECORD,,
14
+ autopub-1.0.0a24.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
15
+ autopub-1.0.0a24.dist-info/METADATA,sha256=HXFZnpdPrZohj9DCZPUj6tCat_5p4CYq5ruO0OLbx_U,951
16
+ autopub-1.0.0a24.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
17
+ autopub-1.0.0a24.dist-info/entry_points.txt,sha256=oeTav5NgCxif6mcZ_HeVGgGv5LzS4DwdI01nr4bO1IM,43
18
+ autopub-1.0.0a24.dist-info/RECORD,,