Skip to content

Commit 9f28003

Browse files
committed
Relax installable dir check to allow cfg-only
1 parent 1983ef0 commit 9f28003

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/pip/_internal/utils/misc.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,18 +269,15 @@ def tabulate(rows):
269269
return table, sizes
270270

271271

272-
def is_installable_dir(path):
273-
# type: (str) -> bool
274-
"""Is path is a directory containing setup.py or pyproject.toml?"""
272+
def is_installable_dir(path: str) -> bool:
273+
"""Is path is a directory containing pyproject.toml, setup.cfg or setup.py?
274+
"""
275275
if not os.path.isdir(path):
276276
return False
277-
setup_py = os.path.join(path, "setup.py")
278-
if os.path.isfile(setup_py):
279-
return True
280-
pyproject_toml = os.path.join(path, "pyproject.toml")
281-
if os.path.isfile(pyproject_toml):
282-
return True
283-
return False
277+
return any(
278+
os.path.isfile(os.path.join(path, signifier))
279+
for signifier in ("pyproject.toml", "setup.cfg", "setup.py")
280+
)
284281

285282

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

0 commit comments

Comments
 (0)