Skip to content

Commit

Permalink
Don't setup.py develop if there is no setup.{py,cfg}
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Oct 13, 2021
1 parent 3493e00 commit f0d0045
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,18 @@ def install(

global_options = global_options if global_options is not None else []
if self.editable and not self.is_wheel:
if not os.path.isfile(self.setup_py_path) and not os.path.isfile(
self.setup_cfg_path
):
# We may reach this point if there is a pyproject.toml using the
# __legacy__ build backend and no setup.py nor setup.cfg. Since
# the legacy build backend accepts to generate metadata in such
# a situation we can't fail earlier.
raise InstallationError(
f"Refusing to do a legacy editable install of {self.source_dir} "
f"which has no 'setup.py' nor 'setup.cfg'. Consider using a build "
f"backend that supports PEP 660."
)
install_editable_legacy(
install_options,
global_options,
Expand Down

0 comments on commit f0d0045

Please sign in to comment.