github-org-manager 0.5.1__tar.gz → 0.5.2__tar.gz

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: github-org-manager
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Manage a GitHub Organization, its teams, repository permissions, and more
5
5
  Home-page: https://github.com/OpenRailAssociation/github-org-manager
6
6
  License: Apache-2.0
@@ -17,6 +17,7 @@ Classifier: Programming Language :: Python :: 3
17
17
  Classifier: Programming Language :: Python :: 3.10
18
18
  Classifier: Programming Language :: Python :: 3.11
19
19
  Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
20
21
  Classifier: Topic :: Software Development :: Version Control :: Git
21
22
  Classifier: Topic :: Utilities
22
23
  Requires-Dist: pygithub (>=2.3.0,<3.0.0)
@@ -39,7 +39,22 @@ def run_graphql_query(query, variables, token):
39
39
  headers=headers,
40
40
  timeout=10,
41
41
  )
42
- if request.status_code == 200:
43
- return request.json()
44
42
 
45
- sys.exit(f"Query failed to run by returning code of {query}: {request.status_code}")
43
+ # Get JSON result
44
+ json_return = "No valid JSON return"
45
+ try:
46
+ json_return = request.json()
47
+ except requests.exceptions.JSONDecodeError:
48
+ pass
49
+
50
+ if request.status_code == 200:
51
+ return json_return
52
+
53
+ # Debug information in case of errors
54
+ print(
55
+ f"Query failed with HTTP error code '{request.status_code}' when running "
56
+ f"this query: {query}\n"
57
+ f"Return: {json_return}\n"
58
+ f"Headers: {request.headers}"
59
+ )
60
+ sys.exit(1)
@@ -4,7 +4,7 @@
4
4
 
5
5
  [tool.poetry]
6
6
  name = "github-org-manager"
7
- version = "0.5.1"
7
+ version = "0.5.2"
8
8
  description = "Manage a GitHub Organization, its teams, repository permissions, and more"
9
9
  authors = ["Max Mehl <max.mehl@deutschebahn.com>"]
10
10
  readme = "README.md"