Skip to content

Commit 054c798

Browse files
authored
fix: fix join for local path (#256)
1 parent cb55cae commit 054c798

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pysrc/requirements/requirement.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,13 +202,13 @@ def parse_line(cls, line):
202202
req.hash_name, req.hash = get_hash_info(fragment)
203203
req.subdirectory = fragment.get('subdirectory')
204204
req.path = groups['path']
205-
elif line.startswith('./'):
206-
if os.path.exists(line) and os.path.isfile(line) and line.lower().endswith(".whl"):
205+
elif os.path.exists(line):
206+
if os.path.isfile(line) and line.lower().endswith(".whl"):
207207
match = re.match(WHL_FILE_REGEX, os.path.basename(line))
208208
if match:
209209
req.name = match.group("name")
210-
elif os.path.exists(line) and os.path.isdir(line):
211-
setup_file = open(line + "/setup.py", "r")
210+
elif os.path.isdir(line):
211+
setup_file = open(os.path.join(line, "setup.py"), "r")
212212
setup_content = setup_file.read()
213213
name_search = NAME_EQ_REGEX.search(setup_content)
214214
if name_search:

0 commit comments

Comments
 (0)