From 7d170f7d30561a94aa1b9c5ea7897f2150dd2486 Mon Sep 17 00:00:00 2001 From: hucorz Date: Sun, 3 Nov 2024 16:58:54 +0800 Subject: [PATCH 1/4] fix pkgutil.find_loader deprecation warning --- .github/workflows/python.yaml | 2 +- python/xoscar/utils.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index e9eb8d43..e988346f 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -65,7 +65,7 @@ jobs: find . -name "CMakeLists.txt" -not -path "*third_party/*" | xargs cmake-format -c .cmake-format.yaml --check build_test_job: - if: github.repository == 'xorbitsai/xoscar' + # if: github.repository == 'xorbitsai/xoscar' runs-on: ${{ matrix.os }} needs: lint env: diff --git a/python/xoscar/utils.py b/python/xoscar/utils.py index 5c6cb851..67f67c1e 100644 --- a/python/xoscar/utils.py +++ b/python/xoscar/utils.py @@ -267,7 +267,7 @@ def add_load_handler(self, func: Callable): self._on_loads.append(func) return func - if pkgutil.find_loader(prefix_name) is not None: + if importlib.util.find_spec(prefix_name) is not None: return LazyModule() elif placeholder: return ModulePlaceholder(prefix_name) From 9975bbd704225757a9fbcb0652256d92e8910ed0 Mon Sep 17 00:00:00 2001 From: hucorz Date: Sun, 3 Nov 2024 17:14:29 +0800 Subject: [PATCH 2/4] update --- python/xoscar/utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/python/xoscar/utils.py b/python/xoscar/utils.py index 67f67c1e..b225dd1d 100644 --- a/python/xoscar/utils.py +++ b/python/xoscar/utils.py @@ -23,7 +23,6 @@ import io import logging import os -import pkgutil import random import socket import sys From 3b02f8b463a60807f6d25e48eefa0cf45b755808 Mon Sep 17 00:00:00 2001 From: hucorz Date: Mon, 4 Nov 2024 11:31:49 +0800 Subject: [PATCH 3/4] update import --- python/xoscar/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/python/xoscar/utils.py b/python/xoscar/utils.py index b225dd1d..4d44c57e 100644 --- a/python/xoscar/utils.py +++ b/python/xoscar/utils.py @@ -19,6 +19,7 @@ import dataclasses import functools import importlib +import importlib.util as importlib_utils import inspect import io import logging @@ -266,7 +267,7 @@ def add_load_handler(self, func: Callable): self._on_loads.append(func) return func - if importlib.util.find_spec(prefix_name) is not None: + if importlib_utils.find_spec(prefix_name) is not None: return LazyModule() elif placeholder: return ModulePlaceholder(prefix_name) From d7cd8d3d500dc64a904c823db734d49ec1b48078 Mon Sep 17 00:00:00 2001 From: hucorz Date: Mon, 4 Nov 2024 14:12:34 +0800 Subject: [PATCH 4/4] restore yaml --- .github/workflows/python.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index e988346f..e9eb8d43 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -65,7 +65,7 @@ jobs: find . -name "CMakeLists.txt" -not -path "*third_party/*" | xargs cmake-format -c .cmake-format.yaml --check build_test_job: - # if: github.repository == 'xorbitsai/xoscar' + if: github.repository == 'xorbitsai/xoscar' runs-on: ${{ matrix.os }} needs: lint env: