From fed8502a22a6648e3eac9c830d158ae85391beab Mon Sep 17 00:00:00 2001 From: Wei Li Date: Fri, 5 May 2023 16:32:13 -0700 Subject: [PATCH] Update setup.py according to dependences upgrades (#215) * Update setup.py `setuptools` updated module `setuptools.Distribution` in PEP 517 backend patch to be `distutils.core.Distribution`, and the original is deprecated. Modify `setup.py` usage accordingly. * Pin amazonlinux unittest image to 2 instead of latest 2023 * Add torch version requirement --- .github/workflows/pytest.yml | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index 2aa1c14..ba54bd5 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -41,7 +41,7 @@ jobs: python-version: ["3.7", "3.8", "3.9", "3.10"] runs-on: ubuntu-latest - container: amazonlinux:latest + container: amazonlinux:2 steps: - uses: actions/checkout@v1 diff --git a/setup.py b/setup.py index 8343989..2e9ae26 100644 --- a/setup.py +++ b/setup.py @@ -115,14 +115,14 @@ def get_blas_lib_dir(cls): install_requires = numpy_requires + [ 'scipy>=1.4.1', 'scikit-learn>=0.24.1', - 'torch>=1.8.0', + 'torch>=1.8.0,<2.0.0', 'sentencepiece>=0.1.86,!=0.1.92', # 0.1.92 results in error for transformers 'transformers>=4.1.1; python_version<"3.9"', 'transformers>=4.4.2; python_version>="3.9"' ] # Fetch Numpy before building Numpy-dependent extension, if Numpy required version was not installed -setuptools.dist.Distribution().fetch_build_eggs(numpy_requires) +setuptools.distutils.core.Distribution().fetch_build_eggs(numpy_requires) blas_lib, blas_dir = BlasHelper.get_blas_lib_dir() # Get extra manual compile args if any