Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed install.py script #2

Merged
merged 1 commit into from
Mar 9, 2024
Merged
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
11 changes: 6 additions & 5 deletions install.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
import subprocess

from pathlib import Path
from typing import List

PARENT_DIR = Path(__file__).parent


def pip_install(package: str) -> None:
def pip_install(args: List[str]) -> None:
subprocess.check_call(
[sys.executable, "-m", "pip", "install", package], cwd=PARENT_DIR
[sys.executable, "-m", "pip", "install", ] + args, cwd=PARENT_DIR
)


Expand All @@ -25,12 +26,12 @@ def main() -> None:
cuda_version = try_get_cuda_version()
if cuda_version is not None:
if cuda_version.startswith("12."):
pip_install("-e .[cuda-12]")
pip_install(["-e", ".[cuda-12]"])
else:
pip_install("-e .[cuda]")
pip_install(["-e", ".[cuda]"])
else:
# Default install
pip_install("-e .[cpu]")
pip_install(["-e", ".[cpu]"])


if __name__ == "__main__":
Expand Down