From 62931276d8748f8f4a0018d98cce3c18fff22659 Mon Sep 17 00:00:00 2001 From: brosoul Date: Wed, 25 Sep 2024 14:50:16 +0800 Subject: [PATCH] [CI]: Add python test on different python version (#219) * ci: add test on different python versions * fix: use List replace list in type hint --- .github/workflows/python-tests.yml | 2 +- python/aibrix/aibrix/envs.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml index 7a0953d4..f48b2a57 100644 --- a/.github/workflows/python-tests.yml +++ b/.github/workflows/python-tests.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] name: Lint steps: - name: Check out source repository diff --git a/python/aibrix/aibrix/envs.py b/python/aibrix/aibrix/envs.py index 419d527e..eb918ca9 100644 --- a/python/aibrix/aibrix/envs.py +++ b/python/aibrix/aibrix/envs.py @@ -13,7 +13,7 @@ # limitations under the License. import os -from typing import Optional +from typing import List, Optional ENV_VARS_TRUE_VALUES = {"1", "ON", "YES", "TRUE"} @@ -24,7 +24,7 @@ def _is_true(value: Optional[str]) -> bool: return value.upper() in ENV_VARS_TRUE_VALUES -def _parse_list_str(value: Optional[str], sep: str = ",") -> Optional[list[str]]: +def _parse_list_str(value: Optional[str], sep: str = ",") -> Optional[List[str]]: if value is None: return None return [str(item).strip() for item in value.split(sep)]