diff --git a/src/oebuild/bblayers.py b/src/oebuild/bblayers.py index cb4ca736dea794500064d2a18b4aeb6396b3846e..021f7cc0901223524ac1a9a7825bce72c90a3064 100644 --- a/src/oebuild/bblayers.py +++ b/src/oebuild/bblayers.py @@ -40,7 +40,7 @@ class BBLayers: ''' return self._bblayers_dir - def add_layer(self, pre_dir: str, layers: str | list): + def add_layer(self, pre_dir: str, layers): ''' Add a layer layer to bblayers.conf, but our layer layer verification is done on the host, @@ -64,7 +64,7 @@ class BBLayers: bb_utils.edit_bblayers_conf(self.bblayers_dir, add=bblayers, remove=None) - def check_layer_exist(self, layers: str | list): + def check_layer_exist(self, layers): ''' To check if it is legitimate to add a layer, the main thing is to verify the existence of layer.conf diff --git a/src/oebuild/docker_proxy.py b/src/oebuild/docker_proxy.py index ddd7f1e5867170a4fa11e3320a9972b5f93a4df4..175f8a5bfd195cc8e638314320b18bd6c0602adf 100644 --- a/src/oebuild/docker_proxy.py +++ b/src/oebuild/docker_proxy.py @@ -15,6 +15,7 @@ from io import BytesIO import tarfile import subprocess import sys +from typing import List import docker from docker.errors import ImageNotFound, NotFound @@ -184,7 +185,7 @@ class DockerProxy: return res is None def container_exec_command(self, container: Container, - command: str | list, + command, user: str = '', params=None): ''' @@ -209,7 +210,7 @@ class DockerProxy: def create_container(self, image: str, parameters: str, - volumes: list[str], + volumes: List[str], command: str) -> Container: ''' create a new container diff --git a/src/oebuild/parse_compile.py b/src/oebuild/parse_compile.py index ede03d23bd60c85869ff03b1bb7d76c7977f7cbf..44f7cd5dd15ff4902eb96ec13fbf355af10b4dfc 100644 --- a/src/oebuild/parse_compile.py +++ b/src/oebuild/parse_compile.py @@ -13,7 +13,7 @@ See the Mulan PSL v2 for more details. import os from dataclasses import dataclass import pathlib -from typing import Optional +from typing import Optional, List import sys import oebuild.util as oebuild_util @@ -33,7 +33,7 @@ class DockerParam: # point out the parameter for create container parameters: str # point out the volumns for create container - volumns: list[str] + volumns: List[str] # point out the command for create container command: str