Skip to content

Commit

Permalink
Add a spinner when preparing setup.py metadata
Browse files Browse the repository at this point in the history
For symmetry with pyproject.toml metadata preparation.
  • Loading branch information
sbidoul committed Sep 28, 2021
1 parent 74999cc commit 826d566
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/pip/_internal/operations/build/metadata_legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os

from pip._internal.build_env import BuildEnvironment
from pip._internal.cli.spinners import open_spinner
from pip._internal.exceptions import InstallationError
from pip._internal.utils.setuptools_build import make_setuptools_egg_info_args
from pip._internal.utils.subprocess import call_subprocess
Expand Down Expand Up @@ -54,11 +55,13 @@ def generate_metadata(
)

with build_env:
call_subprocess(
args,
cwd=source_dir,
command_desc="python setup.py egg_info",
)
with open_spinner("Preparing metadata (setup.py)") as spinner:
call_subprocess(
args,
cwd=source_dir,
command_desc="python setup.py egg_info",
spinner=spinner,
)

# Return the .egg-info directory.
return _find_egg_info(egg_info_dir)
4 changes: 4 additions & 0 deletions src/pip/_internal/req/req_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,10 @@ def _generate_editable_metadata(self) -> str:
# At this point we have determined that the build_editable hook
# is missing, and there is a setup.py or setup.cfg
# so we fallback to the legacy metadata generation
logger.info(
"Build backend does not support editables, "
"falling back to setup.py egg_info."
)
else:
self.supports_pyproject_editable = True
return metadata_directory
Expand Down

0 comments on commit 826d566

Please sign in to comment.