simplify requirements file (#76)

This commit is contained in:
Sebastian Raschka
2024-03-18 08:00:49 -05:00
committed by GitHub
parent 3e122fa656
commit 329d046b5d
6 changed files with 28 additions and 49 deletions

View File

@@ -42,11 +42,18 @@ def get_packages(pkgs):
def get_requirements_dict():
PROJECT_ROOT = dirname(realpath(__file__))
REQUIREMENTS_FILE = join(PROJECT_ROOT, "requirements.txt")
PROJECT_ROOT_UP_TWO = dirname(dirname(PROJECT_ROOT))
REQUIREMENTS_FILE = join(PROJECT_ROOT_UP_TWO, "requirements.txt")
d = {}
with open(REQUIREMENTS_FILE) as f:
for line in f:
if not line.strip():
continue
line = line.split("#")[0]
print(line)
line = line.split(" ")
if not line[0].strip() or not line[-1].strip():
continue
d[line[0]] = line[-1]
return d