autopub 1.0.0a7__py3-none-any.whl → 1.0.0a9__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
@@ -105,16 +105,15 @@ class Autopub:
105
105
  self.release_file.unlink()
106
106
 
107
107
  def publish(self, repository: str | None = None) -> None:
108
- # TODO: shall we put this in a function, to make it
109
- # clear that we are triggering the logic to check the release file?
110
- self.release_data
108
+ release_info = self.release_data
111
109
 
112
110
  for plugin in self.plugins:
111
+ # TODO: maybe pass release info to publish method?
113
112
  if isinstance(plugin, AutopubPackageManagerPlugin):
114
113
  plugin.publish(repository=repository)
115
114
 
116
115
  for plugin in self.plugins:
117
- plugin.post_publish()
116
+ plugin.post_publish(release_info)
118
117
 
119
118
  self._delete_release_file()
120
119
 
@@ -32,7 +32,7 @@ class AutopubPlugin:
32
32
  def on_release_notes_invalid(self, exception: AutopubException): # pragma: no cover
33
33
  ...
34
34
 
35
- def post_publish(self) -> None: # pragma: no cover
35
+ def post_publish(self, release_info: ReleaseInfo) -> None: # pragma: no cover
36
36
  ...
37
37
 
38
38
 
autopub/plugins/git.py CHANGED
@@ -1,14 +1,16 @@
1
1
  from __future__ import annotations
2
2
 
3
- from typing import Any
4
-
5
3
  from autopub.plugins import AutopubPlugin
4
+ from autopub.types import ReleaseInfo
6
5
 
7
6
 
8
7
  class GitPlugin(AutopubPlugin):
9
- def post_publish(self, repository: str | None = None, **kwargs: Any) -> None:
10
- self.run_command(["git", "add", "."])
8
+ def post_publish(self, release_info: ReleaseInfo) -> None:
9
+ self.run_command(["git", "config", "--global", "user.email", "autopub@autopub"])
10
+ self.run_command(["git", "config", "--global", "user.name", "autopub"])
11
11
 
12
- self.run_command(["git", "commit", "-m", "🤖 autopub publish"])
12
+ self.run_command(["git", "tag", release_info.additional_info["new_version"]])
13
13
 
14
- self.run_command(["git", "push"])
14
+ self.run_command(["git", "add", "--all", "--", ":!main/.autopub"])
15
+ self.run_command(["git", "commit", "-m", "🤖 autopub publish"])
16
+ self.run_command(["git", "push", "--tags"])
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: autopub
3
- Version: 1.0.0a7
3
+ Version: 1.0.0a9
4
4
  Summary: Automatic package release upon pull request merge
5
5
  Home-page: https://github.com/autopub/autopub
6
6
  License: AGPL-3.0
@@ -1,17 +1,17 @@
1
- autopub/__init__.py,sha256=qEStdLBp3kmz78ThFjI_xDJeITDDli5U_zyZ6ZhBZ-w,5927
1
+ autopub/__init__.py,sha256=aUty-LxZ0GN1o26hCZQnIjVAo1W2M18bNe5WRvKNIE8,5881
2
2
  autopub/cli/__init__.py,sha256=2tpSa8AVa2dnE62GSG5R8fnalAqybcCK-aV2flQItjQ,3068
3
3
  autopub/cli/plugins.py,sha256=0wzL1ipSrNWh2hi2fp0k0HL15GPncSqKgt15tHRM_pw,1117
4
4
  autopub/exceptions.py,sha256=JYn8sIYWCedhtO3XfftZ0M5M_rAPxiGQ4MGbWUaTYwE,1243
5
- autopub/plugins/__init__.py,sha256=a5BK-onl3KBM37vCcuWERlgA1OyeYQGSL4_mMIvK7B8,1351
5
+ autopub/plugins/__init__.py,sha256=kh4bLjHLgjjlb2GGBI5zaTPfJ1wv5WANg1qQbaEs86I,1378
6
6
  autopub/plugins/bump_version.py,sha256=rNKczSd9lxR7uhzugH7pppq4k1Q8oaVN_WApxk4xDSU,1441
7
- autopub/plugins/git.py,sha256=Dge-AK8jQd0KXFWB60Y3iY7ffit7_9Qe--AQ8b82HLY,382
7
+ autopub/plugins/git.py,sha256=n8br5VTjcYPuMRFOOc0cwj8uFD6IVhbdpCQ5sVmrB4w,671
8
8
  autopub/plugins/pdm.py,sha256=Pczye06fKg8_HMJDkEfMXQyvao9rZ7sqzTHFd6lLEpU,532
9
9
  autopub/plugins/poetry.py,sha256=d2LvW9RI7ZB3reBOXbcp1mqWmzQ06Uyg_T-MxTvlSBg,517
10
10
  autopub/plugins/update_changelog.py,sha256=PVFww5CG9XsF8lNyIhSlOWA7CkjpmPCWiBxUOI90RIg,1525
11
11
  autopub/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  autopub/types.py,sha256=FcRH4l27nrkQFUQrbAKxNzPPJfzg_0DExZYsCu9Jdzk,249
13
- autopub-1.0.0a7.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
14
- autopub-1.0.0a7.dist-info/METADATA,sha256=LwOcmwOshRvDFxyVibSnecIT9rWcY-taOP3IW5HrjPo,3757
15
- autopub-1.0.0a7.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
16
- autopub-1.0.0a7.dist-info/entry_points.txt,sha256=oeTav5NgCxif6mcZ_HeVGgGv5LzS4DwdI01nr4bO1IM,43
17
- autopub-1.0.0a7.dist-info/RECORD,,
13
+ autopub-1.0.0a9.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
14
+ autopub-1.0.0a9.dist-info/METADATA,sha256=0e1btz5KA2GoRTYPwQI_ZvoFZrsjSbzY68uds9p3pXQ,3757
15
+ autopub-1.0.0a9.dist-info/WHEEL,sha256=d2fvjOD7sXsVzChCqf0Ty0JbHKBaLYwDbGQDwQTnJ50,88
16
+ autopub-1.0.0a9.dist-info/entry_points.txt,sha256=oeTav5NgCxif6mcZ_HeVGgGv5LzS4DwdI01nr4bO1IM,43
17
+ autopub-1.0.0a9.dist-info/RECORD,,