Skip to content

Commit 3ee6875

Browse files
committed
remove support for setup.cfg only projects
Per the discussion in pypa#9945. Signed-off-by: Filipe Laíns <[email protected]>
1 parent 8fe0011 commit 3ee6875

File tree

2 files changed

+5
-16
lines changed

2 files changed

+5
-16
lines changed

news/10031.bugfix

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Remove support for ``setup.cfg``-only projects.
2+
3+
See the discussion in https://github.com/pypa/pip/pull/9945.

src/pip/_internal/req/req_install.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -509,30 +509,16 @@ def load_pyproject_toml(self):
509509
self.unpacked_source_directory, backend, backend_path=backend_path,
510510
)
511511

512-
def _check_setup_py_or_cfg_exists(self) -> bool:
513-
"""Check if the requirement actually has a setuptools build file.
514-
515-
If setup.py does not exist, we also check setup.cfg in the same
516-
directory and allow the directory if that exists.
517-
"""
518-
if os.path.exists(self.setup_py_path):
519-
return True
520-
stem, ext = os.path.splitext(self.setup_py_path)
521-
if ext == ".py" and os.path.exists(f"{stem}.cfg"):
522-
return True
523-
return False
524-
525512
def _generate_metadata(self):
526513
# type: () -> str
527514
"""Invokes metadata generator functions, with the required arguments.
528515
"""
529516
if not self.use_pep517:
530517
assert self.unpacked_source_directory
531518

532-
if not self._check_setup_py_or_cfg_exists():
519+
if not os.path.exists(self.setup_py_path):
533520
raise InstallationError(
534-
f'File "setup.py" or "setup.cfg" not found for legacy '
535-
f'project {self}.'
521+
f'File "setup.py" not found for legacy project {self}.'
536522
)
537523

538524
return generate_metadata_legacy(

0 commit comments

Comments
 (0)