diff options
author | umarcor <unai.martinezcorral@ehu.eus> | 2021-07-03 13:55:14 +0200 |
---|---|---|
committer | umarcor <unai.martinezcorral@ehu.eus> | 2021-07-18 23:51:01 +0200 |
commit | 683fe8ba069f3ff8c21f068c1e3343547de1139d (patch) | |
tree | 65257b62648b49b3df8102f8a51cf5243a9a44e8 | |
parent | 23f60a1edee93ad6e68391cf4d21963ac882b635 (diff) | |
download | ghdl-683fe8ba069f3ff8c21f068c1e3343547de1139d.tar.gz ghdl-683fe8ba069f3ff8c21f068c1e3343547de1139d.tar.bz2 ghdl-683fe8ba069f3ff8c21f068c1e3343547de1139d.zip |
setup.py cleanup
-rw-r--r-- | setup.py | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 |