Skip to content

Commit

Permalink
📝 add "Pypi lookup failed" error message output. (#1268)
Browse files Browse the repository at this point in the history
* 📝 add "Pypi lookup failed" error message output.

* 🔧 update log output for clarity.

---------

Co-authored-by: shane <[email protected]>
  • Loading branch information
monkut and storkwrangler authored Nov 10, 2023
1 parent 7ab491e commit 68cfb33
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions zappa/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
Zappa core library. You may also want to look at `cli.py` and `util.py`.
"""

##
# Imports
##
import getpass
import glob
import hashlib
Expand Down Expand Up @@ -504,10 +501,15 @@ def create_handler_venv(self, use_zappa_release: Optional[str] = None):
# https://github.com/pypa/pip/issues/5240#issuecomment-381662679
pip_process = subprocess.Popen(command, stdout=subprocess.PIPE)
# Using communicate() to avoid deadlocks
pip_process.communicate()
stdout_result, stderror_result = pip_process.communicate()
pip_return_code = pip_process.returncode

if pip_return_code:
logger.info("command: %s", " ".join(command))
if stdout_result.strip():
logger.info("stdout: %s", stdout_result.strip())
if stderror_result.strip():
logger.error("stderr: %s", stderror_result)
raise EnvironmentError("Pypi lookup failed")

return ve_path
Expand Down

0 comments on commit 68cfb33

Please sign in to comment.