aboutsummaryrefslogtreecommitdiffstats
path: root/setup.py
diff options
context:
space:
mode:
authorumarcor <unai.martinezcorral@ehu.eus>2021-07-03 13:55:14 +0200
committerumarcor <unai.martinezcorral@ehu.eus>2021-07-18 23:51:01 +0200
commit683fe8ba069f3ff8c21f068c1e3343547de1139d (patch)
tree65257b62648b49b3df8102f8a51cf5243a9a44e8 /setup.py
parent23f60a1edee93ad6e68391cf4d21963ac882b635 (diff)
downloadghdl-683fe8ba069f3ff8c21f068c1e3343547de1139d.tar.gz
ghdl-683fe8ba069f3ff8c21f068c1e3343547de1139d.tar.bz2
ghdl-683fe8ba069f3ff8c21f068c1e3343547de1139d.zip
setup.py cleanup
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/setup.py b/setup.py
index 458b5bfe7..f61a0f2a4 100644
--- a/setup.py
+++ b/setup.py
@@ -62,16 +62,17 @@ def get_description(file: Path) -> str:
def get_requirements(file: Path) -> List[str]:
requirements = []
with file.open("r") as fh:
- for line in fh.readlines():
- line = line.strip()
+ for line in fh.read().splitlines():
if line.startswith("#") or line == "":
continue
elif line.startswith("-r"):
- filename = line[3:].strip()
+ # Remove the first word/argument (-r)
+ filename = " ".join(line.split(" ")[1:])
requirements += get_requirements(file.parent / filename)
elif line.startswith("https"):
- _splitItems = line.split("#")
- requirements.append("{} @ {}".format(_splitItems[1], _splitItems[0]))
+ # Convert 'URL#NAME' to 'NAME @ URL'
+ splitItems = line.split("#")
+ requirements.append("{} @ {}".format(splitItems[1], splitItems[0]))
else:
requirements.append(line)
return requirements