Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
onuratakan committed May 24, 2024
1 parent d03f678 commit 15ed263
Showing 1 changed file with 25 additions and 32 deletions.
57 changes: 25 additions & 32 deletions upsonic/remote/on_prem.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ def load_module(self, module_name, version=None):
module_name = sub_module_name

the_threads = []


the_all_imports = {}
dict_lock = threading.Lock()

for i in the_all:
original_i = i
if "_upsonic_" in i:
Expand All @@ -452,62 +452,55 @@ def load_module(self, module_name, version=None):
self._log(f"key_version {key_version}")
self._log(f"currenly_version {currenly_version}")
if key_version[0] == currenly_version[0] and key_version[0] == "3":
if self.tester:
if self.ttester:
self._log(f"Versions are same and 3")
if key_version[1] != currenly_version[1]:
if self.tester:
self._log("Minor versions are different")

self._log(
f"[bold orange]Warning: The versions are different, are you sure to continue")
the_input = input("Yes or no (y/n)").lower()
if the_input == "n":
key_version = f"{key_version[0]}.{key_version[1]}"
currenly_version = f"{currenly_version[0]}.{currenly_version[1]}"
return "Python versions is different (Key == " + key_version + " This runtime == " + currenly_version + ")"
if the_input == "y":
version_check_pass = True
if self.tester:
self._log("Minor versions are different")

self._log(f"[bold orange]Warning: The versions are different, are you sure to continue")
the_input = input("Yes or no (y/n)").lower()
if the_input == "n":
key_version = f"{key_version[0]}.{key_version[1]}"
currenly_version = f"{currenly_version[0]}.{currenly_version[1]}"
return "Python versions is different (Key == " + key_version + " This runtime == " + currenly_version + ")"
if the_input == "y":
version_check_pass = True
except:
if self.tester:
traceback.print_exc()
def gather(the_all_imports):

def gather():
if version != None:
version_list_response = self.get_version_history(original_i)
version_list = []
for each_v in version_list_response:
version_list.append(each_v.replace(original_i+":", ""))

version_list.append(each_v.replace(original_i + ":", ""))

if version in version_list:
try:
the_all_imports[i] = self.get(
original_i,
version,
pass_python_version_control=True
)
with dict_lock:
the_all_imports[i] = self.get(original_i, version, pass_python_version_control=True)
except:
the_all_imports[i] = self.get(original_i, pass_python_version_control=True)
with dict_lock:
the_all_imports[i] = self.get(original_i, pass_python_version_control=True)
else:
the_all_imports[i] = self.get(original_i, pass_python_version_control=True)
with dict_lock:
the_all_imports[i] = self.get(original_i, pass_python_version_control=True)

while len(the_threads) >= self.thread_number:
for each in the_threads:
if not each.is_alive():
the_threads.remove(each)
time.sleep(0.1)
the_thread = threading.Thread(target=gather, args=(the_all_imports,))

the_thread = threading.Thread(target=gather)
the_thread.start()
the_threads.append(the_thread)


for each in the_threads:
each.join()



import types

def create_module_obj(dictionary):
result = {}
for key, value in dictionary.items():
Expand Down

0 comments on commit 15ed263

Please sign in to comment.