Skip to content
Snippets Groups Projects
Commit d36de43b authored by Fawwaz Anugrah Wiradhika Dharmasatya's avatar Fawwaz Anugrah Wiradhika Dharmasatya
Browse files

feat: add handler if requirements.txt not found

parent d19e401c
No related merge requests found
......@@ -26,10 +26,11 @@ class FileReader:
return project_information
def read_project_dependency(self):
with open(f"{self.project_path}{PATH_SEPARATOR}requirements.txt") as req_file:
lines = req_file.readlines()
i = 0
while i < len(lines):
try:
with open(f"{self.project_path}{PATH_SEPARATOR}requirements.txt") as req_file:
lines = req_file.readlines()
i = 0
while i < len(lines):
annotation_list = self.have_annotation(lines[i])
annotation = None if len(annotation_list)==0 else annotation_list[0]
if(annotation):
......@@ -51,6 +52,8 @@ class FileReader:
module_name = additional_context[0].split(":")[1].strip()
self.dependency_names.append({"name":module_name,"ctx":additional_context})
i+=1
except FileNotFoundError:
format_log("requirements.txt not found. Skipping dependency reading...")
def search_annotation(self,files:list[str]):
project_info:ProjectInfo = ProjectInfo()
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment