From cc34db3df0bc46770b658bcc1a3809910969f05f Mon Sep 17 00:00:00 2001 From: Adam Hupp <142939708+adamh-oai@users.noreply.github.com> Date: Wed, 6 Dec 2023 08:21:44 -0800 Subject: [PATCH 1/4] Update cibuildwheel to 2.16.2 for Python 3.12 support As title. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c8082b..f7513fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -67,7 +67,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: > From 5494671fadb10934b46aee68b68317cadf57c976 Mon Sep 17 00:00:00 2001 From: Adam Hupp <142939708+adamh-oai@users.noreply.github.com> Date: Wed, 6 Dec 2023 14:34:01 -0800 Subject: [PATCH 2/4] Update build.yml --- .github/workflows/build.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f7513fe..9ad9bb1 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: 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 From 16c82ea544ded7233587d724a3698fe7dd51bac9 Mon Sep 17 00:00:00 2001 From: Adam Hupp <142939708+adamh-oai@users.noreply.github.com> Date: Wed, 6 Dec 2023 15:03:53 -0800 Subject: [PATCH 3/4] disable most targets --- .github/workflows/build.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ad9bb1..4777eb6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,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 From 5d1cbf5eff892d1215be76e21d24846b5e948856 Mon Sep 17 00:00:00 2001 From: Adam Hupp Date: Thu, 7 Dec 2023 14:49:11 -0800 Subject: [PATCH 4/4] wip --- .github/workflows/build.yml | 4 ++-- patch/py312-use-packaging.patch | 21 +++++++++++++++++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 patch/py312-use-packaging.patch diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4777eb6..b787abb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,8 +21,8 @@ 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 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