Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cibuildwheel to 2.16.2 for Python 3.12 support #1

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 20 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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: >
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
Loading