Skip to content

Commit

Permalink
fix: handle path to local dir in requirements.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
shaninja committed Apr 8, 2019
1 parent c50838a commit 64d3a35
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plug/requirements/requirement.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ def parse_line(cls, line):
req.hash_name, req.hash = get_hash_info(fragment)
req.subdirectory = fragment.get('subdirectory')
req.path = groups['path']
elif line.startswith('./'):
setup_file = open(line + "/setup.py", "r")
setup_content = setup_file.read()
name_search = re.search('name="(\S+)"', setup_content)
if name_search:
req.name = name_search.group(1)
req.local_file = True
else:
# This is a requirement specifier.
# Delegate to pkg_resources and hope for the best
Expand Down

0 comments on commit 64d3a35

Please sign in to comment.