accli 0.7.8__tar.gz → 0.7.10__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.7.8
3
+ Version: 0.7.10
4
4
  Summary: IIASA Accelerator Client
5
5
  Author-email: Wrufesh S <wrufesh@gmail.com>
6
6
  License: The MIT License (MIT)
@@ -5,6 +5,7 @@ import hashlib
5
5
  import shutil
6
6
  import tempfile
7
7
  import requests
8
+ from functools import lru_cache
8
9
  from typing import Optional, List, Dict
9
10
  from pydantic.v1 import BaseModel, root_validator
10
11
  from accli.AcceleratorTerminalCliProjectService import AcceleratorTerminalCliProjectService
@@ -60,6 +61,7 @@ def copy_tree(src, dst):
60
61
  else:
61
62
  shutil.copy2(src_path, dst_path)
62
63
 
64
+ @lru_cache(maxsize=None)
63
65
  def push_folder_job(dir):
64
66
 
65
67
  access_token = get_token()
@@ -204,7 +206,9 @@ class WKubeTaskKwargs(BaseModel):
204
206
  job_folder = values.get('job_folder', './')
205
207
 
206
208
  if not (values.get('repo_url') and values.get('repo_branch')):
207
- remote_url, branch_name = push_folder_job(job_folder)
209
+ remote_url, branch_name = push_folder_job(
210
+ os.path.abspath(job_folder)
211
+ )
208
212
  values['repo_url'] = remote_url
209
213
  values['repo_branch'] = branch_name
210
214
  else:
@@ -112,15 +112,20 @@ class AcceleratorTerminalCliProjectService:
112
112
  return todict(res.data)
113
113
 
114
114
  def get_jobstore_push_url(self, project_slug, filename):
115
+ try:
115
116
 
116
- res = self.http_client_request(
117
- "GET",
118
- f"{self.cli_base_url}/{project_slug}/jobstore-push-url/?filename={filename}",
119
- headers=self.common_request_headers
120
- )
117
+ res = self.http_client_request(
118
+ "GET",
119
+ f"{self.cli_base_url}/{project_slug}/jobstore-push-url/?filename={filename}",
120
+ headers=self.common_request_headers
121
+ )
122
+
123
+ except AccAPIError as err:
124
+ if err.status_code == 409 or err.status_code == '409':
125
+ return None
126
+ else:
127
+ raise err
121
128
 
122
- if res.status == 409 or res.status == '409':
123
- return None
124
129
 
125
130
  return todict(res.data)
126
131
 
@@ -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.7.8"
3
+ VERSION = "v0.7.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: accli
3
- Version: 0.7.8
3
+ Version: 0.7.10
4
4
  Summary: IIASA Accelerator Client
5
5
  Author-email: Wrufesh S <wrufesh@gmail.com>
6
6
  License: The MIT License (MIT)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes