Skip to content

Commit

Permalink
fix: find-links options in requirements.txt (#3810)
Browse files Browse the repository at this point in the history
  • Loading branch information
numb3r3 authored Oct 28, 2021
1 parent ae1833c commit 451cb17
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
21 changes: 16 additions & 5 deletions jina/hubble/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,11 +351,21 @@ def install_requirements(
import pkg_resources

with requirements_file.open() as requirements:
install_reqs = [
str(req)
for req in pkg_resources.parse_requirements(requirements)
if req.project_name not in excludes or len(req.extras) > 0
]
install_options = []
install_reqs = []
for req in requirements:
req = req.strip()
if (not req) or req.startswith('#'):
continue
elif req.startswith('-'):
install_options.extend(req.split(' '))
else:
for req_spec in pkg_resources.parse_requirements(req):
if (
req_spec.project_name not in excludes
or len(req_spec.extras) > 0
):
install_reqs.append(req)

if len(install_reqs) == 0:
return
Expand All @@ -373,4 +383,5 @@ def install_requirements(
f'--default-timeout={timeout}',
]
+ install_reqs
+ install_options
)
1 change: 1 addition & 0 deletions tests/unit/hubble/dummy_executor/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
-f https://download.pytorch.org/whl/torch_stable.html
pytest

0 comments on commit 451cb17

Please sign in to comment.