Relax installable dir check to allow cfg-only

This commit is contained in:
Tzu-ping Chung 2021-05-11 21:48:22 +08:00 committed by Stéphane Bidoul
parent 06d65a0327
commit f1bea48b5d
No known key found for this signature in database
GPG Key ID: BCAB2555446B5B92
1 changed files with 6 additions and 10 deletions

View File

@ -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):