Skip to content

Commit

Permalink
Relax installable dir check to allow cfg-only
Browse files Browse the repository at this point in the history
  • Loading branch information
uranusjr committed May 11, 2021
1 parent 1983ef0 commit 9f28003
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/pip/_internal/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,18 +269,15 @@ def tabulate(rows):
return table, sizes


def is_installable_dir(path):
# type: (str) -> bool
"""Is path is a directory containing setup.py or pyproject.toml?"""
def is_installable_dir(path: str) -> bool:
"""Is path is a directory containing pyproject.toml, setup.cfg or setup.py?
"""
if not os.path.isdir(path):
return False
setup_py = os.path.join(path, "setup.py")
if os.path.isfile(setup_py):
return True
pyproject_toml = os.path.join(path, "pyproject.toml")
if os.path.isfile(pyproject_toml):
return True
return False
return any(
os.path.isfile(os.path.join(path, signifier))
for signifier in ("pyproject.toml", "setup.cfg", "setup.py")
)


def read_chunks(file, size=io.DEFAULT_BUFFER_SIZE):
Expand Down

0 comments on commit 9f28003

Please sign in to comment.