python-semantic-release 8.0.6__py3-none-any.whl → 8.0.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-semantic-release
3
- Version: 8.0.6
3
+ Version: 8.0.8
4
4
  Summary: Automatic Semantic Versioning for Python projects
5
5
  Author-email: Rolf Erik Lekang <me@rolflekang.com>
6
6
  License: MIT
@@ -32,7 +32,7 @@ Provides-Extra: dev
32
32
  Requires-Dist: pre-commit ; extra == 'dev'
33
33
  Requires-Dist: tox ; extra == 'dev'
34
34
  Requires-Dist: black ; extra == 'dev'
35
- Requires-Dist: ruff >=0.0.282 ; extra == 'dev'
35
+ Requires-Dist: ruff ==0.0.286 ; extra == 'dev'
36
36
  Provides-Extra: docs
37
37
  Requires-Dist: Sphinx <=6.0.0 ; extra == 'docs'
38
38
  Requires-Dist: sphinxcontrib-apidoc ==0.3.0 ; extra == 'docs'
@@ -48,6 +48,7 @@ Requires-Dist: pytest-xdist <4,>=2 ; extra == 'test'
48
48
  Requires-Dist: pytest-mock <4,>=3 ; extra == 'test'
49
49
  Requires-Dist: pytest-lazy-fixture ~=0.6.3 ; extra == 'test'
50
50
  Requires-Dist: pytest-cov <5,>=4 ; extra == 'test'
51
+ Requires-Dist: pytest-pretty <2,>=1.2.0 ; extra == 'test'
51
52
  Requires-Dist: responses ==0.23.3 ; extra == 'test'
52
53
  Requires-Dist: requests-mock <2,>=1.10.0 ; extra == 'test'
53
54
  Requires-Dist: types-pytest-lazy-fixture >=0.6.3.3 ; extra == 'test'
@@ -1,16 +1,16 @@
1
- semantic_release/__init__.py,sha256=SU8z8uI1gaGWc7F06zo5YW8mojBUom5LCIsXHYOeLQE,869
1
+ semantic_release/__init__.py,sha256=_i6S3Wbvbt8RlefTI7DMzt8-cKWg87AfGkdqTcbjJvo,869
2
2
  semantic_release/__main__.py,sha256=vXOARLV7KHeVXgpOMU0Q-8wovpdsOrtTsycxulI5xIE,106
3
3
  semantic_release/const.py,sha256=Z1o2QNh60wSLeF-_1TemMBjU3ZXbV0XghnUFsbTVfOs,831
4
4
  semantic_release/enums.py,sha256=D5B_reQGGKQQT22HO5PUtvn2Bok3fkht6TfJtXkmAUg,1020
5
5
  semantic_release/errors.py,sha256=KKKCV45vvE9tla0sxYDGHkHWvqDn1gEfGIpzujcDbeI,809
6
- semantic_release/helpers.py,sha256=Ux1aamRNjLARRjz_AjKFDJc3vBu3Takv9oiaGLfZpL8,3946
6
+ semantic_release/helpers.py,sha256=xv0C1cc_oKLQPrvBppAU31JPOuWe_S2wSPznAuVbDAs,3943
7
7
  semantic_release/changelog/__init__.py,sha256=Bg6Xe5Vt32rWoMscW-hd4sUwiZqzWmsg4CD1EhMesMY,262
8
8
  semantic_release/changelog/context.py,sha256=ItSz5Bon2mcJkLxyQZzBTukN0zEdcaVQ4iXvz3jGCLc,986
9
9
  semantic_release/changelog/release_history.py,sha256=lphD64zgbE7IBhWoNsXP4uHOXBTuANvo27MLIMdIJOY,6594
10
10
  semantic_release/changelog/template.py,sha256=VkR9Yes8G2vS3mXhyra1F_OWK6iPqEPIuntyj73kahU,4340
11
11
  semantic_release/cli/__init__.py,sha256=gwAYhZO-4TR0tKCkQ4GqutWsL--0CII2_dcbrElI4M4,419
12
12
  semantic_release/cli/common.py,sha256=xANZHYUhlFsff4DVt_Tm860hK7o06-269RHIp5m6i04,929
13
- semantic_release/cli/config.py,sha256=wUDjo_sMuRQBxmeyLOb0JjgRvp8zvjily4U-VHL__wA,13099
13
+ semantic_release/cli/config.py,sha256=A4tBrlGD1zGk0xXrkU3cdK5yC4eQfvWOh9J2MwZ_naI,13104
14
14
  semantic_release/cli/const.py,sha256=S8oNNpSaKdZxcAs7PAKEjQHic0czoJBGd7XHo57FOzw,39
15
15
  semantic_release/cli/github_actions_output.py,sha256=stGWcuMtelY0qM2E_-IfofP6UvsQ6czsO7qpMfnRJI4,2102
16
16
  semantic_release/cli/masking_filter.py,sha256=Z_dAy1-BHdkzE6DPQ7pTCMqV9W_Q2QcS4-zTbsQbV3g,2886
@@ -34,7 +34,7 @@ semantic_release/data/templates/release_notes.md.j2,sha256=27uIHgG6iYmqdMaoWFP5L
34
34
  semantic_release/hvcs/__init__.py,sha256=ToRcDwm3cPyAhVkC_ZFJfZXG-VW0tWvAOmjQV6y4FSw,246
35
35
  semantic_release/hvcs/_base.py,sha256=zzixi_wyTWGMyUXZ--OG5ZSEGGk-9Ggs1D8A4uD4a-M,5570
36
36
  semantic_release/hvcs/gitea.py,sha256=RSejGbzCKNi8Q05pezRvHxMqXKsddVPHgQJml6GZ8MQ,8376
37
- semantic_release/hvcs/github.py,sha256=ZFaaEhkuy5_XP5rRr13uM3x9C92StQ-Iv8Q7_jCwAPE,10108
37
+ semantic_release/hvcs/github.py,sha256=WfZWYPFa_87A48WfwTTDSUynEBEmaY8jmP5P3wFA0Ag,10654
38
38
  semantic_release/hvcs/gitlab.py,sha256=S6HuFNOw06qT_sWOKeR9aN13uHyKNocN9iHDb6rZUj8,5886
39
39
  semantic_release/hvcs/token_auth.py,sha256=ZjT56-NIPB4OKIt1qwHCu1TavXnrWFIBl9ARlg56hgU,663
40
40
  semantic_release/hvcs/util.py,sha256=zxv_rphmzmKaxqIwgrjF2xrwIIUNvJB3n3MfEfTgxCc,2868
@@ -43,10 +43,10 @@ semantic_release/version/algorithm.py,sha256=qnBAOgp97SDKqRUpVF3oWqd9nhjNPnnGbV3
43
43
  semantic_release/version/declaration.py,sha256=zJ9zXBTe0NDvQQ_cJIoXxpCw9y0TXtPLf59relDwSpw,7235
44
44
  semantic_release/version/translator.py,sha256=VrY3H-opPCcWnUSrYJy-Ur7rQoj62Wd0E0k3-PSZkuM,3033
45
45
  semantic_release/version/version.py,sha256=Ki-aHHEYsIecstLaF2XQD139veLfeBRRrKp3Jx_iETE,14178
46
- python_semantic_release-8.0.6.dist-info/AUTHORS.rst,sha256=XOReVvpymEFUPsS2QPH97jlfJBVrxwS2eu8-jVAe4gk,230
47
- python_semantic_release-8.0.6.dist-info/LICENSE,sha256=NE85nszX252sdQdu0xgS9qwfYES0k8qS6gW3uO4jRGE,1083
48
- python_semantic_release-8.0.6.dist-info/METADATA,sha256=uZpiAcDgBQPCBlrK5Sl4Hz8Vln3vBCiTaxGZtoNfDPA,5055
49
- python_semantic_release-8.0.6.dist-info/WHEEL,sha256=5sUXSg9e4bi7lTLOHcm6QEYwO5TIF1TNbTSVFVjcJcc,92
50
- python_semantic_release-8.0.6.dist-info/entry_points.txt,sha256=qojUBx_Ywf4u7KgP6NWlDaBDymZVUGQ7m5wF2duC2F0,95
51
- python_semantic_release-8.0.6.dist-info/top_level.txt,sha256=qYA24nyg3eP-ti5UW7Vuj2aXVmM0wqVHx4mREdRZNAA,17
52
- python_semantic_release-8.0.6.dist-info/RECORD,,
46
+ python_semantic_release-8.0.8.dist-info/AUTHORS.rst,sha256=XOReVvpymEFUPsS2QPH97jlfJBVrxwS2eu8-jVAe4gk,230
47
+ python_semantic_release-8.0.8.dist-info/LICENSE,sha256=NE85nszX252sdQdu0xgS9qwfYES0k8qS6gW3uO4jRGE,1083
48
+ python_semantic_release-8.0.8.dist-info/METADATA,sha256=CiTScUvrOVxra6UVHOSWnTdUn1ysF5CiWp4Ig7m3XwI,5113
49
+ python_semantic_release-8.0.8.dist-info/WHEEL,sha256=yQN5g4mg4AybRjkgi-9yy4iQEFibGQmlz78Pik5Or-A,92
50
+ python_semantic_release-8.0.8.dist-info/entry_points.txt,sha256=qojUBx_Ywf4u7KgP6NWlDaBDymZVUGQ7m5wF2duC2F0,95
51
+ python_semantic_release-8.0.8.dist-info/top_level.txt,sha256=qYA24nyg3eP-ti5UW7Vuj2aXVmM0wqVHx4mREdRZNAA,17
52
+ python_semantic_release-8.0.8.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.41.1)
2
+ Generator: bdist_wheel (0.41.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -23,7 +23,7 @@ from semantic_release.version import (
23
23
  tags_and_versions,
24
24
  )
25
25
 
26
- __version__ = "8.0.6"
26
+ __version__ = "8.0.8"
27
27
 
28
28
 
29
29
  def setup_hook(argv: list[str]) -> None:
@@ -84,7 +84,7 @@ class ChangelogConfig(BaseModel):
84
84
 
85
85
  class BranchConfig(BaseModel):
86
86
  match: str = "(main|master)"
87
- prerelease_token = "rc" # noqa: S105
87
+ prerelease_token: str = "rc" # noqa: S105
88
88
  prerelease: bool = False
89
89
 
90
90
 
@@ -67,7 +67,7 @@ def dynamic_import(import_path: str) -> Any:
67
67
  string
68
68
  """
69
69
  log.debug("Trying to import %s", import_path)
70
- module_name, _, attr = import_path.split(":", maxsplit=1)
70
+ module_name, attr = import_path.split(":", maxsplit=1)
71
71
  module = importlib.import_module(module_name)
72
72
  return getattr(module, attr)
73
73
 
@@ -36,6 +36,7 @@ class Github(HvcsBase):
36
36
 
37
37
  DEFAULT_DOMAIN = "github.com"
38
38
  DEFAULT_API_DOMAIN = "api.github.com"
39
+ DEFAULT_UPLOAD_DOMAIN = "uploads.github.com"
39
40
 
40
41
  def __init__(
41
42
  self,
@@ -59,6 +60,7 @@ class Github(HvcsBase):
59
60
  ).replace("https://", "")
60
61
 
61
62
  self.api_url = f"https://{self.hvcs_api_domain}"
63
+ self.upload_url = f"https://{self.DEFAULT_UPLOAD_DOMAIN}"
62
64
 
63
65
  self.token = token
64
66
  auth = None if not self.token else TokenAuth(self.token)
@@ -179,15 +181,19 @@ class Github(HvcsBase):
179
181
  return self.edit_release_notes(release_id, release_notes)
180
182
 
181
183
  @logged_function(log)
182
- def asset_upload_url(self, release_id: str) -> str:
184
+ @suppress_not_found
185
+ def asset_upload_url(self, release_id: str) -> str | None:
183
186
  """
184
187
  Get the correct upload url for a release
185
188
  https://docs.github.com/en/enterprise-server@3.5/rest/releases/releases#get-a-release
186
189
  :param release_id: ID of the release to upload to
187
- :return: URL found to upload for a release
190
+ :return: URL to upload for a release if found, else None
188
191
  """
189
192
  # https://docs.github.com/en/enterprise-server@3.5/rest/releases/assets#upload-a-release-asset
190
- return f"{self.api_url}/repos/{self.owner}/{self.repo_name}/releases/{release_id}/assets" # noqa: E501
193
+ response = self.session.get(
194
+ f"{self.api_url}/repos/{self.owner}/{self.repo_name}/releases/{release_id}",
195
+ )
196
+ return response.json().get("upload_url").replace("{?name,label}", "")
191
197
 
192
198
  @logged_function(log)
193
199
  def upload_asset(
@@ -202,6 +208,12 @@ class Github(HvcsBase):
202
208
  :return: The status of the request
203
209
  """
204
210
  url = self.asset_upload_url(release_id)
211
+ if url is None:
212
+ raise HTTPError(
213
+ "There is no associated url for uploading asset for release "
214
+ f"{release_id}. Release url: "
215
+ f"{self.api_url}/repos/{self.owner}/{self.repo_name}/releases/{release_id}"
216
+ )
205
217
  content_type = (
206
218
  mimetypes.guess_type(file, strict=False)[0] or "application/octet-stream"
207
219
  )