diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c8082b..b787abb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,13 +21,12 @@ jobs: - uses: actions/setup-python@v3 with: python-version: "3.x" - - - name: Apply patch - run: cd faiss && git apply ../patch/faiss-rename-swigfaiss.patch && cd .. - + - name: Apply patches + run: (cd faiss && git apply ../patch/faiss-rename-swigfaiss.patch && git apply ../patch/py312-use-packaging.patch) + - name: install build + run: pip install build - name: Build sdist - run: python setup.py sdist - + run: python -m build . --sdist - uses: actions/upload-artifact@v3 with: path: ./dist/*.tar.gz @@ -37,23 +36,23 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] #, macos-latest] arch: [auto64] gpu: [OFF] opt_level: [avx2] - include: - - os: windows-latest - arch: auto64 - gpu: OFF - opt_level: generic - - os: ubuntu-latest - arch: aarch64 - gpu: OFF - opt_level: generic - - os: macos-latest - arch: arm64 - gpu: OFF - opt_level: generic +# include: +# - os: windows-latest +# arch: auto64 +# gpu: OFF +# opt_level: generic +# - os: ubuntu-latest +# arch: aarch64 +# gpu: OFF +# opt_level: generic +# - os: macos-latest +# arch: arm64 +# gpu: OFF +# opt_level: generic steps: - uses: actions/checkout@v3 @@ -67,7 +66,7 @@ jobs: platforms: arm64 - name: Build wheels - uses: pypa/cibuildwheel@v2.11.2 + uses: pypa/cibuildwheel@v2.16.2 env: CIBW_ARCHS: ${{ matrix.arch }} CIBW_ENVIRONMENT_LINUX: > diff --git a/patch/py312-use-packaging.patch b/patch/py312-use-packaging.patch new file mode 100644 index 0000000..ba4b93b --- /dev/null +++ b/patch/py312-use-packaging.patch @@ -0,0 +1,21 @@ +diff --git a/faiss/python/loader.py b/faiss/python/loader.py +--- a/faiss/python/loader.py ++++ b/faiss/python/loader.py +@@ -3,7 +3,7 @@ + # This source code is licensed under the MIT license found in the + # LICENSE file in the root directory of this source tree. + +-from distutils.version import LooseVersion ++from packaging.version import Version + import platform + import subprocess + import logging +@@ -25,7 +25,7 @@ + {"NEON", "ASIMD", ...} + """ + import numpy +- if LooseVersion(numpy.__version__) >= "1.19": ++ if Version(numpy.__version__) >= "1.19": + # use private API as next-best thing until numpy/numpy#18058 is solved + from numpy.core._multiarray_umath import __cpu_features__ + # __cpu_features__ is a dictionary with CPU features