mirror of https://github.com/pypa/pip
Relax installable dir check to allow cfg-only
This commit is contained in:
parent
06d65a0327
commit
f1bea48b5d
|
@ -269,18 +269,14 @@ 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):
|
||||
|
|
Loading…
Reference in New Issue