From 52117054201d001327b241e5f58ca68a488a0352 Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Mon, 24 Jun 2024 20:10:07 +0800 Subject: [PATCH 01/10] fix ci --- .github/workflows/build-wheel.yaml | 7 ++----- CI/requirements-wheel.txt | 22 ++++++++++++++-------- python/pyproject.toml | 1 + python/setup.cfg | 1 + python/setup.py | 8 ++++---- python/xoscar/entrypoints.py | 4 ++-- 6 files changed, 24 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build-wheel.yaml b/.github/workflows/build-wheel.yaml index 27020dd9..e9929cb8 100644 --- a/.github/workflows/build-wheel.yaml +++ b/.github/workflows/build-wheel.yaml @@ -36,11 +36,8 @@ jobs: arch: aarch64 requires-python: ">=3.11,<3.12" - os: macos-latest - arch: universal2 - requires-python: ">=3.8,<3.10" - - os: macos-latest - arch: universal2 - requires-python: ">=3.10,<3.12" + arch: arm64 + requires-python: ">=3.8,<3.12" steps: - uses: actions/checkout@v3 diff --git a/CI/requirements-wheel.txt b/CI/requirements-wheel.txt index ab14a7bc..444ecf62 100644 --- a/CI/requirements-wheel.txt +++ b/CI/requirements-wheel.txt @@ -1,16 +1,22 @@ oldest-supported-numpy -pandas==1.0.4; python_version<'3.9' and platform_machine!='aarch64' + +pandas==1.0.4; python_version<'3.9' and platform_machine!='aarch64' and platform_machine!='arm64' pandas==1.1.3; python_version<'3.9' and platform_machine=='aarch64' -pandas==1.2.2; python_version>='3.9' and python_version<'3.10' -pandas==1.3.4; python_version>='3.10' and python_version<'3.11' -pandas==1.5.0; python_version>='3.11' +pandas==1.4.0; python_version<'3.9' and platform_machine=='arm64' +pandas==1.2.2; python_version>='3.9' and python_version<'3.10' and platform_machine!='arm64' +pandas==1.4.0; python_version>='3.9' and python_version<'3.10' and platform_machine=='arm64' +pandas==1.3.4; python_version>='3.10' and python_version<'3.11' and platform_machine!='arm64' +pandas==1.4.0; python_version>='3.10' and python_version<'3.11' and platform_machine=='arm64' +pandas==1.5.1; python_version>='3.11' and python_version<'3.12' -scipy==1.4.1; python_version<'3.9' and platform_machine!='aarch64' +scipy==1.4.1; python_version<'3.9' and platform_machine!='aarch64' and platform_machine!='arm64' +scipy==1.7.3; python_version<'3.9' and platform_machine=='arm64' scipy==1.5.3; python_version<'3.9' and platform_machine=='aarch64' -scipy==1.5.4; python_version>='3.9' and python_version<'3.10' -scipy==1.7.2; python_version>='3.10' and python_version<'3.11' -scipy==1.9.2; python_version>='3.11' +scipy==1.5.4; python_version>='3.9' and python_version<'3.10' and platform_machine!='arm64' +scipy==1.7.2; python_version>='3.10' and python_version<'3.11' and platform_machine!='arm64' +scipy==1.7.3; python_version>='3.10' and python_version<'3.11' and platform_machine=='arm64' +scipy==1.9.2; python_version>='3.11' and python_version<'3.12' # see: https://github.com/cython/cython/commit/afc00fc3ba5d43c67151c0039847a526e7b627a5 cython==0.29.33 diff --git a/python/pyproject.toml b/python/pyproject.toml index 52099bcc..0e70702a 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -2,6 +2,7 @@ requires = [ "setuptools<64", "wheel", + "packaging", "oldest-supported-numpy", "pandas>=1.0.4", "scipy==1.4.1; python_version<'3.9' and platform_machine!='aarch64'", diff --git a/python/setup.cfg b/python/setup.cfg index 5b94b81f..0437cef6 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -33,6 +33,7 @@ install_requires = tblib>=1.7.0 pickle5; python_version<"3.8" uvloop>=0.14.0; sys_platform!="win32" + packaging [options.packages.find] exclude = diff --git a/python/setup.py b/python/setup.py index 74234e07..438dae23 100644 --- a/python/setup.py +++ b/python/setup.py @@ -25,7 +25,7 @@ import numpy as np from Cython.Build import cythonize -from pkg_resources import parse_version +from packaging.version import Version from setuptools import Extension, setup from setuptools.command.build_ext import build_ext from setuptools.extension import Library @@ -63,9 +63,9 @@ ) target_macos_version = "10.9" - parsed_python_target = parse_version(python_target) - parsed_current_system = parse_version(current_system) - parsed_macos_version = parse_version(target_macos_version) + parsed_python_target = Version(python_target) + parsed_current_system = Version(current_system) + parsed_macos_version = Version(target_macos_version) if parsed_python_target <= parsed_macos_version <= parsed_current_system: os.environ["MACOSX_DEPLOYMENT_TARGET"] = target_macos_version diff --git a/python/xoscar/entrypoints.py b/python/xoscar/entrypoints.py index 0c8349b4..e20317bf 100644 --- a/python/xoscar/entrypoints.py +++ b/python/xoscar/entrypoints.py @@ -26,9 +26,9 @@ def init_extension_entrypoints(): """Execute all `xoscar_extensions` entry points with the name `init` If extensions have already been initialized, this function does nothing. """ - from pkg_resources import iter_entry_points # type: ignore + from importlib.metadata import entry_points - for entry_point in iter_entry_points("xoscar_extensions", "init"): + for entry_point in entry_points(group="xoscar_extensions", name="init"): logger.info("Loading extension: %s", entry_point) try: func = entry_point.load() From 55394410f599f541eef983c2f97a3016e486f73e Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Mon, 24 Jun 2024 21:46:15 +0800 Subject: [PATCH 02/10] remove py38 --- .github/workflows/build-wheel.yaml | 7 ++----- .github/workflows/python.yaml | 2 +- CI/conda-environment.yml | 4 +--- doc/source/getting_started/installation.rst | 3 +-- python/setup.cfg | 3 +-- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-wheel.yaml b/.github/workflows/build-wheel.yaml index e9929cb8..b0b37cbf 100644 --- a/.github/workflows/build-wheel.yaml +++ b/.github/workflows/build-wheel.yaml @@ -21,11 +21,8 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] arch: [auto] - requires-python: [">=3.8,<3.10", ">=3.10,<3.12"] + requires-python: [">=3.9,<3.10", ">=3.10,<3.12"] include: - - os: ubuntu-latest - arch: aarch64 - requires-python: ">=3.8,<3.9" - os: ubuntu-latest arch: aarch64 requires-python: ">=3.9,<3.10" @@ -37,7 +34,7 @@ jobs: requires-python: ">=3.11,<3.12" - os: macos-latest arch: arm64 - requires-python: ">=3.8,<3.12" + requires-python: ">=3.9,<3.12" steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 3203be9c..6e2f9eba 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -77,7 +77,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.9", "3.10", "3.11"] module: ["xoscar"] exclude: - { os: macos-latest, python-version: 3.9} diff --git a/CI/conda-environment.yml b/CI/conda-environment.yml index 9e3ec7ec..335c4b0a 100644 --- a/CI/conda-environment.yml +++ b/CI/conda-environment.yml @@ -2,7 +2,7 @@ name: xoscar-test channels: - defaults dependencies: - - numpy + - numpy<2.0.0 - cloudpickle - coverage - cython @@ -33,6 +33,4 @@ dependencies: - pip - pip: - - pickle5; python_version<"3.8" - - shared-memory38>=0.1.1; python_version<"3.8" - uvloop>=0.14.0; sys.platform!="win32" diff --git a/doc/source/getting_started/installation.rst b/doc/source/getting_started/installation.rst index 14f78ed3..cf12c5ee 100644 --- a/doc/source/getting_started/installation.rst +++ b/doc/source/getting_started/installation.rst @@ -13,7 +13,7 @@ Xoscar can be installed via pip from `PyPI `__. Python version support ---------------------- -Officially Python 3.8, 3.9, 3.10, and 3.11. +Officially Python 3.9, 3.10, and 3.11. Dependencies @@ -28,7 +28,6 @@ Package Minimum support `scikit-learn `__ 0.20 cloudpickle 1.5.0 psutil 5.9.0 -pickle5 (for python version < 3.8) 0.0.1 uvloop (for systems other than win32) 0.14.0 ================================================================ ========================== diff --git a/python/setup.cfg b/python/setup.cfg index 0437cef6..d875f7c7 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -12,7 +12,6 @@ classifier = Operating System :: OS Independent Programming Language :: Python Programming Language :: Python :: 3 - Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 @@ -24,7 +23,7 @@ zip_safe = False include_package_data = True packages = find: install_requires = - numpy>=1.14.0 + numpy>=1.14.0,<2.0.0 pandas>=1.0.0 scipy>=1.0.0; sys_platform!="win32" or python_version>="3.10" scipy>=1.0.0,<=1.9.1; sys_platform=="win32" and python_version<"3.10" From db4530830bc2ba667622d2559b89446c9d72f043 Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Mon, 24 Jun 2024 22:15:31 +0800 Subject: [PATCH 03/10] entry_points --- .github/workflows/build-wheel.yaml | 5 +++- .github/workflows/python.yaml | 4 ++-- doc/source/getting_started/installation.rst | 2 +- python/setup.cfg | 1 + python/xoscar/entrypoints.py | 26 +++++++++++---------- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-wheel.yaml b/.github/workflows/build-wheel.yaml index b0b37cbf..5c568778 100644 --- a/.github/workflows/build-wheel.yaml +++ b/.github/workflows/build-wheel.yaml @@ -21,8 +21,11 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] arch: [auto] - requires-python: [">=3.9,<3.10", ">=3.10,<3.12"] + requires-python: [">=3.8,<3.10", ">=3.10,<3.12"] include: + - os: ubuntu-latest + arch: aarch64 + requires-python: ">=3.8,<3.9" - os: ubuntu-latest arch: aarch64 requires-python: ">=3.9,<3.10" diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index 6e2f9eba..a84b96ca 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -77,7 +77,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: ["3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11"] module: ["xoscar"] exclude: - { os: macos-latest, python-version: 3.9} @@ -97,7 +97,7 @@ jobs: if: ${{ matrix.os == 'windows-latest'}} uses: microsoft/setup-msbuild@v1.1 - name: Set up conda ${{ matrix.python-version }} - uses: conda-incubator/setup-miniconda@v2 + uses: conda-incubator/setup-miniconda@v3 if: ${{ matrix.module != 'gpu' }} with: python-version: ${{ matrix.python-version }} diff --git a/doc/source/getting_started/installation.rst b/doc/source/getting_started/installation.rst index cf12c5ee..0335027b 100644 --- a/doc/source/getting_started/installation.rst +++ b/doc/source/getting_started/installation.rst @@ -13,7 +13,7 @@ Xoscar can be installed via pip from `PyPI `__. Python version support ---------------------- -Officially Python 3.9, 3.10, and 3.11. +Officially Python 3.8, 3.9, 3.10, and 3.11. Dependencies diff --git a/python/setup.cfg b/python/setup.cfg index d875f7c7..d2cbed03 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -12,6 +12,7 @@ classifier = Operating System :: OS Independent Programming Language :: Python Programming Language :: Python :: 3 + Programming Language :: Python :: 3.8 Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: 3.11 diff --git a/python/xoscar/entrypoints.py b/python/xoscar/entrypoints.py index e20317bf..e4674dd3 100644 --- a/python/xoscar/entrypoints.py +++ b/python/xoscar/entrypoints.py @@ -28,15 +28,17 @@ def init_extension_entrypoints(): """ from importlib.metadata import entry_points - for entry_point in entry_points(group="xoscar_extensions", name="init"): - logger.info("Loading extension: %s", entry_point) - try: - func = entry_point.load() - func() - except Exception as e: - msg = "Xoscar extension module '{}' failed to load due to '{}({})'." - warnings.warn( - msg.format(entry_point.module_name, type(e).__name__, str(e)), - stacklevel=2, - ) - logger.info("Extension loading failed for: %s", entry_point) + xoscar_entry_points = entry_point()["xoscar_extensions"] + for entry_point in xoscar_entry_points: + if entry_point.name == "init": + logger.info("Loading extension: %s", entry_point) + try: + func = entry_point.load() + func() + except Exception as e: + msg = "Xoscar extension module '{}' failed to load due to '{}({})'." + warnings.warn( + msg.format(entry_point.module_name, type(e).__name__, str(e)), + stacklevel=2, + ) + logger.info("Extension loading failed for: %s", entry_point) From 5895176c23dca069fcea8406e2300ef28101aa17 Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Mon, 24 Jun 2024 22:18:18 +0800 Subject: [PATCH 04/10] entry_points --- python/xoscar/entrypoints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/xoscar/entrypoints.py b/python/xoscar/entrypoints.py index e4674dd3..57e7fb78 100644 --- a/python/xoscar/entrypoints.py +++ b/python/xoscar/entrypoints.py @@ -28,7 +28,7 @@ def init_extension_entrypoints(): """ from importlib.metadata import entry_points - xoscar_entry_points = entry_point()["xoscar_extensions"] + xoscar_entry_points = entry_points()["xoscar_extensions"] for entry_point in xoscar_entry_points: if entry_point.name == "init": logger.info("Loading extension: %s", entry_point) From 8b0debf322658f456ecbbb1e2db240c099d5f387 Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Wed, 26 Jun 2024 15:43:32 +0800 Subject: [PATCH 05/10] fix --- .github/workflows/python.yaml | 2 ++ python/pyproject.toml | 9 ++------- python/xoscar/entrypoints.py | 28 +++++++++++++--------------- 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index a84b96ca..bf58238e 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -80,8 +80,10 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11"] module: ["xoscar"] exclude: + - { os: macos-latest, python-version: 3.8} - { os: macos-latest, python-version: 3.9} - { os: macos-latest, python-version: 3.10} + - { os: windows-latest, python-version: 3.8} - { os: windows-latest, python-version: 3.9} - { os: windows-latest, python-version: 3.10} include: diff --git a/python/pyproject.toml b/python/pyproject.toml index 0e70702a..2b0ef5cb 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,15 +1,10 @@ [build-system] requires = [ - "setuptools<64", - "wheel", + "setuptools", "packaging", + "wheel", "oldest-supported-numpy", "pandas>=1.0.4", - "scipy==1.4.1; python_version<'3.9' and platform_machine!='aarch64'", - "scipy==1.5.3; python_version<'3.9' and platform_machine=='aarch64'", - "scipy==1.5.4; python_version>='3.9' and python_version<'3.10' and sys_platform=='win32'", - "scipy>=1.4.1; python_version>='3.9' and python_version<'3.10' and sys_platform!='win32'", - "scipy>=1.4.1; python_version>='3.10'", "cython>=0.29.33", "requests>=2.4.0", "cloudpickle>=2.2.1; python_version>='3.11'", diff --git a/python/xoscar/entrypoints.py b/python/xoscar/entrypoints.py index 57e7fb78..0c8349b4 100644 --- a/python/xoscar/entrypoints.py +++ b/python/xoscar/entrypoints.py @@ -26,19 +26,17 @@ def init_extension_entrypoints(): """Execute all `xoscar_extensions` entry points with the name `init` If extensions have already been initialized, this function does nothing. """ - from importlib.metadata import entry_points + from pkg_resources import iter_entry_points # type: ignore - xoscar_entry_points = entry_points()["xoscar_extensions"] - for entry_point in xoscar_entry_points: - if entry_point.name == "init": - logger.info("Loading extension: %s", entry_point) - try: - func = entry_point.load() - func() - except Exception as e: - msg = "Xoscar extension module '{}' failed to load due to '{}({})'." - warnings.warn( - msg.format(entry_point.module_name, type(e).__name__, str(e)), - stacklevel=2, - ) - logger.info("Extension loading failed for: %s", entry_point) + for entry_point in iter_entry_points("xoscar_extensions", "init"): + logger.info("Loading extension: %s", entry_point) + try: + func = entry_point.load() + func() + except Exception as e: + msg = "Xoscar extension module '{}' failed to load due to '{}({})'." + warnings.warn( + msg.format(entry_point.module_name, type(e).__name__, str(e)), + stacklevel=2, + ) + logger.info("Extension loading failed for: %s", entry_point) From 47ce2964c9fa3304a8ef23622630de6479d69373 Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Wed, 26 Jun 2024 15:46:36 +0800 Subject: [PATCH 06/10] fix --- python/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 2b0ef5cb..51c22f7d 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools", + "setuptools<64", "packaging", "wheel", "oldest-supported-numpy", From e7f95a8098ec144ad08803d6ca84e3256034673d Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Wed, 26 Jun 2024 15:47:34 +0800 Subject: [PATCH 07/10] fix --- python/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/python/pyproject.toml b/python/pyproject.toml index 51c22f7d..3adddf77 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,6 +4,7 @@ requires = [ "packaging", "wheel", "oldest-supported-numpy", + "scipy" "pandas>=1.0.4", "cython>=0.29.33", "requests>=2.4.0", From 941f3b971a23d4bb2fe4aa867a03ca44d85a7943 Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Wed, 26 Jun 2024 15:48:08 +0800 Subject: [PATCH 08/10] fix --- python/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/pyproject.toml b/python/pyproject.toml index 3adddf77..1f3c68d7 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,7 +4,7 @@ requires = [ "packaging", "wheel", "oldest-supported-numpy", - "scipy" + "scipy", "pandas>=1.0.4", "cython>=0.29.33", "requests>=2.4.0", From 3121c19cdf5ae7bfb67e34082ec14d5e9225259b Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Wed, 26 Jun 2024 19:21:58 +0800 Subject: [PATCH 09/10] fix --- .github/workflows/python.yaml | 2 -- CI/requirements-wheel.txt | 5 ++++ python/pyproject.toml | 20 ++++++++++++++-- python/xoscar/__init__.py | 1 - python/xoscar/backends/pool.py | 3 --- python/xoscar/entrypoints.py | 42 ---------------------------------- 6 files changed, 23 insertions(+), 50 deletions(-) delete mode 100644 python/xoscar/entrypoints.py diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index bf58238e..a84b96ca 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -80,10 +80,8 @@ jobs: python-version: ["3.8", "3.9", "3.10", "3.11"] module: ["xoscar"] exclude: - - { os: macos-latest, python-version: 3.8} - { os: macos-latest, python-version: 3.9} - { os: macos-latest, python-version: 3.10} - - { os: windows-latest, python-version: 3.8} - { os: windows-latest, python-version: 3.9} - { os: windows-latest, python-version: 3.10} include: diff --git a/CI/requirements-wheel.txt b/CI/requirements-wheel.txt index 444ecf62..1e7e7967 100644 --- a/CI/requirements-wheel.txt +++ b/CI/requirements-wheel.txt @@ -1,5 +1,8 @@ oldest-supported-numpy +numpy<2.0.0 +packaging +wheel pandas==1.0.4; python_version<'3.9' and platform_machine!='aarch64' and platform_machine!='arm64' pandas==1.1.3; python_version<'3.9' and platform_machine=='aarch64' @@ -9,6 +12,7 @@ pandas==1.4.0; python_version>='3.9' and python_version<'3.10' and platform_mach pandas==1.3.4; python_version>='3.10' and python_version<'3.11' and platform_machine!='arm64' pandas==1.4.0; python_version>='3.10' and python_version<'3.11' and platform_machine=='arm64' pandas==1.5.1; python_version>='3.11' and python_version<'3.12' +pandas>=2.1.1; python_version>'3.11' scipy==1.4.1; python_version<'3.9' and platform_machine!='aarch64' and platform_machine!='arm64' scipy==1.7.3; python_version<'3.9' and platform_machine=='arm64' @@ -17,6 +21,7 @@ scipy==1.5.4; python_version>='3.9' and python_version<'3.10' and platform_machi scipy==1.7.2; python_version>='3.10' and python_version<'3.11' and platform_machine!='arm64' scipy==1.7.3; python_version>='3.10' and python_version<'3.11' and platform_machine=='arm64' scipy==1.9.2; python_version>='3.11' and python_version<'3.12' +scipy>=1.11.2; python_version>'3.11' # see: https://github.com/cython/cython/commit/afc00fc3ba5d43c67151c0039847a526e7b627a5 cython==0.29.33 diff --git a/python/pyproject.toml b/python/pyproject.toml index 1f3c68d7..17ac3eec 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -4,8 +4,24 @@ requires = [ "packaging", "wheel", "oldest-supported-numpy", - "scipy", - "pandas>=1.0.4", + "scipy==1.4.1; python_version<'3.9' and platform_machine!='aarch64' and platform_machine!='arm64'", + "scipy==1.7.3; python_version<'3.9' and platform_machine=='arm64'", + "scipy==1.5.3; python_version<'3.9' and platform_machine=='aarch64'", + "scipy==1.5.4; python_version>='3.9' and python_version<'3.10' and platform_machine!='arm64'", + "scipy==1.7.2; python_version>='3.10' and python_version<'3.11' and platform_machine!='arm64'", + "scipy==1.7.3; python_version>='3.10' and python_version<'3.11' and platform_machine=='arm64'", + "scipy==1.9.2; python_version>='3.11' and python_version<'3.12'", + "scipy>=1.11.2; python_version>'3.11'", + "pandas==1.0.4; python_version<'3.9' and platform_machine!='aarch64' and platform_machine!='arm64'", + "pandas==1.1.3; python_version<'3.9' and platform_machine=='aarch64'", + "pandas==1.4.0; python_version<'3.9' and platform_machine=='arm64'", + "pandas==1.2.2; python_version>='3.9' and python_version<'3.10' and platform_machine!='arm64'", + "pandas==1.4.0; python_version>='3.9' and python_version<'3.10' and platform_machine=='arm64'", + "pandas==1.3.4; python_version>='3.10' and python_version<'3.11' and platform_machine!='arm64'", + "pandas==1.4.0; python_version>='3.10' and python_version<'3.11' and platform_machine=='arm64'", + "pandas==1.5.1; python_version>='3.11' and python_version<'3.12'", + "pandas>=2.1.1; python_version>'3.11'", + "numpy<2.0.0", "cython>=0.29.33", "requests>=2.4.0", "cloudpickle>=2.2.1; python_version>='3.11'", diff --git a/python/xoscar/__init__.py b/python/xoscar/__init__.py index d9cbf686..5e5621c1 100644 --- a/python/xoscar/__init__.py +++ b/python/xoscar/__init__.py @@ -50,7 +50,6 @@ # make sure methods are registered from .backends import indigen, test -from .entrypoints import init_extension_entrypoints from . import _version del indigen, test diff --git a/python/xoscar/backends/pool.py b/python/xoscar/backends/pool.py index 16d27c6f..6e3859d8 100644 --- a/python/xoscar/backends/pool.py +++ b/python/xoscar/backends/pool.py @@ -33,7 +33,6 @@ from ..api import Actor from ..core import ActorRef, BufferRef, FileObjectRef, register_local_pool from ..debug import debug_async_timeout, record_message_trace -from ..entrypoints import init_extension_entrypoints from ..errors import ( ActorAlreadyExist, ActorNotExist, @@ -188,8 +187,6 @@ def __init__( self._asyncio_task_timeout_detector_task = ( register_asyncio_task_timeout_detector() ) - # load third party extensions. - init_extension_entrypoints() # init metrics metric_configs = self._config.get_metric_configs() metric_backend = metric_configs.get("backend") diff --git a/python/xoscar/entrypoints.py b/python/xoscar/entrypoints.py deleted file mode 100644 index 0c8349b4..00000000 --- a/python/xoscar/entrypoints.py +++ /dev/null @@ -1,42 +0,0 @@ -# Copyright 2022-2023 XProbe Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import functools -import logging -import warnings - -logger = logging.getLogger(__name__) - - -# from https://github.com/numba/numba/blob/master/numba/core/entrypoints.py -# Must put this here to avoid extensions re-triggering initialization -@functools.lru_cache(maxsize=None) -def init_extension_entrypoints(): - """Execute all `xoscar_extensions` entry points with the name `init` - If extensions have already been initialized, this function does nothing. - """ - from pkg_resources import iter_entry_points # type: ignore - - for entry_point in iter_entry_points("xoscar_extensions", "init"): - logger.info("Loading extension: %s", entry_point) - try: - func = entry_point.load() - func() - except Exception as e: - msg = "Xoscar extension module '{}' failed to load due to '{}({})'." - warnings.warn( - msg.format(entry_point.module_name, type(e).__name__, str(e)), - stacklevel=2, - ) - logger.info("Extension loading failed for: %s", entry_point) From 2de5e9ea12e9d3044b47db3f46b67cae843ab08d Mon Sep 17 00:00:00 2001 From: Weizheng Lu Date: Wed, 26 Jun 2024 19:23:31 +0800 Subject: [PATCH 10/10] fix --- python/xoscar/__init__.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/python/xoscar/__init__.py b/python/xoscar/__init__.py index 5e5621c1..ea812a92 100644 --- a/python/xoscar/__init__.py +++ b/python/xoscar/__init__.py @@ -58,6 +58,3 @@ ActorRefType = Union[ActorRef, _T] __version__ = _version.get_versions()["version"] - -init_extension_entrypoints() -del init_extension_entrypoints