Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 13 additions & 8 deletions komodo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,13 +270,10 @@ def install_previously_downloaded_pip_packages(
pip_executable: str,
release_root: Path,
) -> None:
for pkg, ver in release_file_content.items():
current = repository_file_content[pkg][ver]
if current["make"] != "pip":
continue

package_name = current.get("pypi_package_name", pkg)
shell_input = [
def pip_shell_command(
package_name: str, ver: str, makeopts: Optional[str]
) -> List[Optional[str]]:
return [
pip_executable,
f"install {package_name}=={strip_version(ver)}",
"--prefix",
Expand All @@ -288,9 +285,17 @@ def install_previously_downloaded_pip_packages(
# assuming fetch.py has done "pip download" to this directory:
f"--cache-dir {downloads_directory}",
f"--find-links {downloads_directory}",
makeopts,
]
shell_input.append(current.get("makeopts"))

for pkg, ver in release_file_content.items():
pkg_data = repository_file_content[pkg][ver]
if pkg_data["make"] != "pip":
continue

shell_input = pip_shell_command(
pkg_data.get("pypi_package_name", pkg), ver, pkg_data.get("makeopts")
)
print(shell(shell_input))


Expand Down
3 changes: 2 additions & 1 deletion komodo/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import os
import subprocess
import sys
from typing import List, Optional, Union


@contextlib.contextmanager
Expand All @@ -15,7 +16,7 @@ def pushd(path):
os.chdir(prev)


def shell(cmd: str, allow_failure=False) -> bytes:
def shell(cmd: Union[str, List[Optional[str]]], allow_failure: bool = False) -> bytes:
try:
cmdlist = cmd.split(" ")
except AttributeError:
Expand Down