Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
adamh-oai committed Dec 7, 2023
1 parent 16c82ea commit 969de69
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ../py312-use-packaging.patch)
- name: install build
run: pip install build
- name: Build sdist
Expand Down
21 changes: 21 additions & 0 deletions patch/py312-use-packaging.patch
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 969de69

Please sign in to comment.