Skip to content

Commit

Permalink
Fix bindep
Browse files Browse the repository at this point in the history
  • Loading branch information
cidrblock committed Aug 16, 2023
1 parent 070f4ae commit 4e8e80c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions src/pip4a/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = "0.1.dev18"
__version_tuple__ = version_tuple = (0, 1, "dev18")
__version__ = version = '0.1.dev24'
__version_tuple__ = version_tuple = (0, 1, 'dev24')
19 changes: 10 additions & 9 deletions src/pip4a/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,16 +173,16 @@ def _check_bindep(self: Installer) -> None:
"""Check the bindep file."""
bindep = Path("./bindep.txt").resolve()
if not bindep.exists():
msg = f"bindep file {bindep} does not exist, skipping"
msg = f"System package requirements file {bindep} does not exist, skipping"
logger.info(msg)
return
msg = f"bindep file found: {bindep}"
logging.debug(msg)
logger.debug(msg)

bindep_found = bool(shutil.which("bindep"))
if not bindep_found:
msg = "Installing bindep for: {bindep}"
logging.debug(msg)
logger.debug(msg)
command = f"{sys.executable} -m pip install bindep"
try:
subprocess.run(
Expand All @@ -193,11 +193,11 @@ def _check_bindep(self: Installer) -> None:
)
except subprocess.CalledProcessError as exc:
err = f"Failed to install bindep: {exc}"
logging.critical(err)
logger.critical(err)

command = f"bindep -b -f {bindep}"
msg = f"Running command: {command}"
logging.debug(msg)
logger.debug(msg)
proc = subprocess.run(
command,
check=False,
Expand All @@ -210,9 +210,10 @@ def _check_bindep(self: Installer) -> None:

lines = proc.stdout.splitlines()
msg = (
"Required system packages are missing"
" please use the system package manager to install them."
"Required system packages are missing."
" Please use the system package manager to install them."
)
for line in lines[1:]:
logger.warning(msg)
for line in lines:
msg = f"Missing: {line}"
logging.warning(msg)
logger.warning(msg)

0 comments on commit 4e8e80c

Please sign in to comment.