allow requirements to point to urls

This commit is contained in:
black-sliver 2021-11-07 14:00:13 +01:00
parent f10163e7d2
commit 5d0d9c2890
1 changed files with 19 additions and 12 deletions

View File

@ -35,7 +35,14 @@ def update(yes = False, force = False):
if not os.path.exists(path):
path = os.path.join(os.path.dirname(__file__), req_file)
with open(path) as requirementsfile:
requirements = pkg_resources.parse_requirements(requirementsfile)
for line in requirementsfile:
if line.startswith('https://'):
# extract name and version from url
url = line.split(';')[0]
wheel = line.split('/')[-1]
name, version, _ = wheel.split('-',2)
line = f'{name}=={version}'
requirements = pkg_resources.parse_requirements(line)
for requirement in requirements:
requirement = str(requirement)
try: