accli 0.5.1__tar.gz → 0.5.3__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: accli
3
- Version: 0.5.1
3
+ Version: 0.5.3
4
4
  Summary: IIASA Accelerator Client
5
5
  Author-email: Wrufesh S <wrufesh@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -83,5 +83,3 @@ Please follow [this link.](https://packaging.python.org/en/latest/tutorials/pack
83
83
  2. Run 'python scripts/tag.py'
84
84
  3. `python -m build`
85
85
  4. `twine upload -r pypi -u __token__ -p <password-or-token> ./dist/*`
86
-
87
-
@@ -48,5 +48,3 @@ Please follow [this link.](https://packaging.python.org/en/latest/tutorials/pack
48
48
  2. Run 'python scripts/tag.py'
49
49
  3. `python -m build`
50
50
  4. `twine upload -r pypi -u __token__ -p <password-or-token> ./dist/*`
51
-
52
-
@@ -9,6 +9,8 @@ import urllib3
9
9
  from pathlib import Path
10
10
  from typing import List, Tuple
11
11
 
12
+ from accli.common import todict
13
+
12
14
  class AccAPIError(Exception):
13
15
  pass
14
16
 
@@ -66,7 +68,7 @@ class AcceleratorJobProjectService:
66
68
  f"{self.cli_base_url}/file-stat/{bucket_object_id}",
67
69
  headers=self.common_request_headers
68
70
  )
69
- return res.json()
71
+ return todict(res.data)
70
72
 
71
73
  def get_file_url_from_repo(self, filename):
72
74
  project_slug = filename.split('/')[0]
@@ -76,7 +78,7 @@ class AcceleratorJobProjectService:
76
78
  headers=self.common_request_headers
77
79
  )
78
80
  if res.data:
79
- return res.json()
81
+ return todict(res.data)
80
82
 
81
83
  def get_dataset_type(self, *args, **kwargs):
82
84
  return self.get_bucket_object_validation_type(*args, **kwargs)
@@ -88,7 +90,7 @@ class AcceleratorJobProjectService:
88
90
  headers=self.common_request_headers
89
91
  )
90
92
  if res.data:
91
- return res.json()
93
+ return todict(res.data)
92
94
 
93
95
  def get_bucket_object_validation_details(self, bucket_object_id):
94
96
  res = self.http_client_request(
@@ -97,7 +99,7 @@ class AcceleratorJobProjectService:
97
99
  headers=self.common_request_headers
98
100
  )
99
101
  if res.data:
100
- return res.json()
102
+ return todict(res.data)
101
103
 
102
104
 
103
105
  def get_file_url(self, bucket_object_id):
@@ -108,7 +110,7 @@ class AcceleratorJobProjectService:
108
110
  )
109
111
 
110
112
  if res.data:
111
- return res.json()
113
+ return todict(res.data)
112
114
 
113
115
 
114
116
  def get_file_stream(self, bucket_object_id):
@@ -123,7 +125,9 @@ class AcceleratorJobProjectService:
123
125
  "GET",
124
126
  f"{self.cli_base_url}/is-healthy/",
125
127
  headers=self.common_request_headers
126
- ).json()
128
+ )
129
+ if res.data:
130
+ res = todict(res.data)
127
131
  except Exception as err:
128
132
  raise UnhealthyControlServerError(str(err))
129
133
 
@@ -136,7 +140,9 @@ class AcceleratorJobProjectService:
136
140
  "GET",
137
141
  f"{self.cli_base_url}/presigned-log-upload-url/?filename={filename}",
138
142
  headers=self.common_request_headers
139
- ).json()
143
+ )
144
+ if res.data:
145
+ res = todict(res.data)
140
146
  except Exception as err:
141
147
  raise UnhealthyControlServerError(str(err))
142
148
 
@@ -189,7 +195,7 @@ class AcceleratorJobProjectService:
189
195
  headers=self.common_request_headers
190
196
  )
191
197
 
192
- return res.json()
198
+ return todict(res.data)
193
199
 
194
200
  def get_multipart_put_update_signed_url(
195
201
  self,
@@ -208,7 +214,7 @@ class AcceleratorJobProjectService:
208
214
  headers=self.common_request_headers
209
215
  )
210
216
 
211
- return res.json()
217
+ return todict(res.data)
212
218
 
213
219
  def get_put_create_multipart_upload_id(self, filename):
214
220
  res = self.http_client_request(
@@ -217,7 +223,7 @@ class AcceleratorJobProjectService:
217
223
  headers=self.common_request_headers
218
224
  )
219
225
 
220
- data = res.json()
226
+ data = todict(res.data)
221
227
 
222
228
  return data['upload_id'], data['app_bucket_id'], data['uniqified_filename']
223
229
 
@@ -228,7 +234,7 @@ class AcceleratorJobProjectService:
228
234
  headers=self.common_request_headers
229
235
  )
230
236
 
231
- return res.json()
237
+ return todict(res.data)
232
238
 
233
239
  def complete_job_multipart_upload(
234
240
  self,
@@ -255,7 +261,7 @@ class AcceleratorJobProjectService:
255
261
  headers=headers
256
262
  )
257
263
 
258
- return res.json()
264
+ return todict(res.data)
259
265
 
260
266
  def complete_update_multipart_upload(
261
267
  self, bucket_object_id, upload_id, parts: List[Tuple[str, str]]
@@ -365,7 +371,7 @@ class AcceleratorJobProjectService:
365
371
  headers=headers
366
372
  )
367
373
 
368
- return res.json()
374
+ return todict(res.data)
369
375
 
370
376
 
371
377
 
@@ -7,7 +7,7 @@ import concurrent.futures
7
7
  from typing import List, Tuple
8
8
  from rich.progress import Progress
9
9
 
10
-
10
+ from accli.common import todict
11
11
 
12
12
  class AccAPIError(Exception):
13
13
 
@@ -76,7 +76,7 @@ class AcceleratorTerminalCliProjectService:
76
76
  else:
77
77
  raise err
78
78
 
79
- return res.json()
79
+ return todict(res.data)
80
80
 
81
81
  def get_file_url_from_repo(self, filename):
82
82
  project_slug = filename.split('/')[0]
@@ -86,7 +86,7 @@ class AcceleratorTerminalCliProjectService:
86
86
  headers=self.common_request_headers
87
87
  )
88
88
  if res.data:
89
- return res.json()
89
+ return todict(res.data)
90
90
 
91
91
  def get_github_app_token(self, project_slug):
92
92
 
@@ -96,7 +96,7 @@ class AcceleratorTerminalCliProjectService:
96
96
  headers=self.common_request_headers
97
97
  )
98
98
 
99
- return res.json()
99
+ return todict(res.data)
100
100
 
101
101
  def get_jobstore_push_url(self, project_slug, filename):
102
102
 
@@ -109,7 +109,7 @@ class AcceleratorTerminalCliProjectService:
109
109
  if res.status == 409 or res.status == '409':
110
110
  return None
111
111
 
112
- return res.json()
112
+ return todict(res.data)
113
113
 
114
114
  def dispatch(self, project_slug, job_description):
115
115
 
@@ -123,7 +123,7 @@ class AcceleratorTerminalCliProjectService:
123
123
  except AccAPIError as err:
124
124
  raise err
125
125
 
126
- return res.json()['job_id']
126
+ return todict(res.data)['job_id']
127
127
 
128
128
  def get_dataset_template_details(self, project_slug, template_slug):
129
129
 
@@ -138,7 +138,7 @@ class AcceleratorTerminalCliProjectService:
138
138
  else:
139
139
  raise err
140
140
 
141
- return res.json()
141
+ return todict(res.data)
142
142
 
143
143
 
144
144
  def get_multipart_put_create_signed_url(
@@ -161,7 +161,7 @@ class AcceleratorTerminalCliProjectService:
161
161
  headers=self.common_request_headers
162
162
  )
163
163
 
164
- return res.json()
164
+ return todict(res.data)
165
165
 
166
166
 
167
167
 
@@ -175,7 +175,7 @@ class AcceleratorTerminalCliProjectService:
175
175
  headers=self.common_request_headers
176
176
  )
177
177
 
178
- data = res.json()
178
+ data = todict(res.data)
179
179
 
180
180
  return data['upload_id'], data['app_bucket_id'], data['uniqified_filename']
181
181
 
@@ -204,7 +204,7 @@ class AcceleratorTerminalCliProjectService:
204
204
  headers=headers
205
205
  )
206
206
 
207
- return res.json()
207
+ return todict(res.data)
208
208
 
209
209
 
210
210
  def abort_create_multipart_upload(self, project_slug, app_bucket_id, filename, upload_id):
@@ -1,3 +1,3 @@
1
1
  # Please strictly put double quote to use this info for git tag
2
2
  # Read developer guide for git tag command with regex
3
- VERSION = "v0.5.1"
3
+ VERSION = "v0.5.3"
@@ -192,10 +192,6 @@ def dispatch(
192
192
  verify_cert=False
193
193
  )
194
194
 
195
- github_app_token = term_cli_project_service.get_github_app_token(project_slug)
196
- set_github_app_token(github_app_token)
197
-
198
-
199
195
  spec = importlib.util.spec_from_file_location("workflow", workflow_file)
200
196
 
201
197
  module = importlib.util.module_from_spec(spec)
@@ -0,0 +1,6 @@
1
+ import json
2
+
3
+ def todict(bytestring: bytes):
4
+ return json.loads(
5
+ bytestring.decode("utf-8")
6
+ )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: accli
3
- Version: 0.5.1
3
+ Version: 0.5.3
4
4
  Summary: IIASA Accelerator Client
5
5
  Author-email: Wrufesh S <wrufesh@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -83,5 +83,3 @@ Please follow [this link.](https://packaging.python.org/en/latest/tutorials/pack
83
83
  2. Run 'python scripts/tag.py'
84
84
  3. `python -m build`
85
85
  4. `twine upload -r pypi -u __token__ -p <password-or-token> ./dist/*`
86
-
87
-
@@ -9,6 +9,7 @@ accli/__init__.py
9
9
  accli/__main__.py
10
10
  accli/_version.py
11
11
  accli/cli.py
12
+ accli/common.py
12
13
  accli/token.py
13
14
  accli.egg-info/PKG-INFO
14
15
  accli.egg-info/SOURCES.txt
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes