Skip to content

Commit

Permalink
updated pip install for freebsd
Browse files Browse the repository at this point in the history
  • Loading branch information
r-dailey committed Mar 14, 2024
1 parent 5a8b8ed commit ca722a4
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lisa/tools/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the MIT license.
import re
from pathlib import PurePath
from typing import TYPE_CHECKING, List, Type
from typing import TYPE_CHECKING, List, Type, cast

from assertpy import assert_that

Expand All @@ -11,7 +11,7 @@
if TYPE_CHECKING:
from lisa.node import Node

from lisa.operating_system import Posix
from lisa.operating_system import Posix, BSD
from lisa.tools.mkdir import Mkdir
from lisa.util import UnsupportedDistroException, get_matched_str

Expand Down Expand Up @@ -52,8 +52,12 @@ def dependencies(self) -> List[Type[Tool]]:

def _install(self) -> bool:
package_name = "python3-pip"
posix_os: Posix = cast(Posix, self.node.os)
assert isinstance(self.node.os, Posix)
self.node.os.install_packages(package_name)
if isinstance(posix_os, BSD):
posix_os.install_packages("py38-pip")
else:
self.node.os.install_packages(package_name)
return self._check_exists()

def install_packages(self, packages_name: str, install_path: str = "") -> None:
Expand Down

0 comments on commit ca722a4

Please sign in to comment.