Skip to content

Commit 77a52e3

Browse files
mengdilinfacebook-github-bot
authored andcommitted
fix open source CI
Differential Revision: D63145404
1 parent 838612c commit 77a52e3

File tree

1 file changed

+27
-21
lines changed

1 file changed

+27
-21
lines changed

faiss/python/setup.py

+27-21
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,26 @@
44
# LICENSE file in the root directory of this source tree.
55

66
from __future__ import print_function
7-
from setuptools import setup, find_packages
7+
88
import os
9-
import shutil
109
import platform
10+
import shutil
11+
12+
from setuptools import find_packages, setup
1113

1214
# make the faiss python package dir
1315
shutil.rmtree("faiss", ignore_errors=True)
1416
os.mkdir("faiss")
1517
shutil.copytree("contrib", "faiss/contrib")
16-
shutil.copytree("contrib/torch", "faiss/contrib/torch")
1718
shutil.copyfile("__init__.py", "faiss/__init__.py")
1819
shutil.copyfile("loader.py", "faiss/loader.py")
1920
shutil.copyfile("class_wrappers.py", "faiss/class_wrappers.py")
2021
shutil.copyfile("gpu_wrappers.py", "faiss/gpu_wrappers.py")
2122
shutil.copyfile("extra_wrappers.py", "faiss/extra_wrappers.py")
2223
shutil.copyfile("array_conversions.py", "faiss/array_conversions.py")
2324

24-
ext = ".pyd" if platform.system() == 'Windows' else ".so"
25-
prefix = "Release/" * (platform.system() == 'Windows')
25+
ext = ".pyd" if platform.system() == "Windows" else ".so"
26+
prefix = "Release/" * (platform.system() == "Windows")
2627

2728
swigfaiss_generic_lib = f"{prefix}_swigfaiss{ext}"
2829
swigfaiss_avx2_lib = f"{prefix}_swigfaiss_avx2{ext}"
@@ -36,10 +37,16 @@
3637
found_callbacks = os.path.exists(callbacks_lib)
3738
found_swigfaiss_sve = os.path.exists(swigfaiss_sve_lib)
3839

39-
assert (found_swigfaiss_generic or found_swigfaiss_avx2 or found_swigfaiss_avx512 or found_swigfaiss_sve), \
40-
f"Could not find {swigfaiss_generic_lib} or " \
41-
f"{swigfaiss_avx2_lib} or {swigfaiss_avx512_lib} or {swigfaiss_sve_lib}. " \
40+
assert (
41+
found_swigfaiss_generic
42+
or found_swigfaiss_avx2
43+
or found_swigfaiss_avx512
44+
or found_swigfaiss_sve
45+
), (
46+
f"Could not find {swigfaiss_generic_lib} or "
47+
f"{swigfaiss_avx2_lib} or {swigfaiss_avx512_lib} or {swigfaiss_sve_lib}. "
4248
f"Faiss may not be compiled yet."
49+
)
4350

4451
if found_swigfaiss_generic:
4552
print(f"Copying {swigfaiss_generic_lib}")
@@ -65,7 +72,7 @@
6572
shutil.copyfile("swigfaiss_sve.py", "faiss/swigfaiss_sve.py")
6673
shutil.copyfile(swigfaiss_sve_lib, f"faiss/_swigfaiss_sve{ext}")
6774

68-
long_description="""
75+
long_description = """
6976
Faiss is a library for efficient similarity search and clustering of dense
7077
vectors. It contains algorithms that search in sets of vectors of any size,
7178
up to ones that possibly do not fit in RAM. It also contains supporting
@@ -74,20 +81,19 @@
7481
are implemented on the GPU. It is developed by Facebook AI Research.
7582
"""
7683
setup(
77-
name='faiss',
78-
version='1.8.0',
79-
description='A library for efficient similarity search and clustering of dense vectors',
84+
name="faiss",
85+
version="1.8.0",
86+
description="A library for efficient similarity search and clustering of dense vectors",
8087
long_description=long_description,
81-
url='https://github.com/facebookresearch/faiss',
82-
author='Matthijs Douze, Jeff Johnson, Herve Jegou, Lucas Hosseini',
83-
author_email='matthijs@meta.com',
84-
license='MIT',
85-
keywords='search nearest neighbors',
86-
87-
install_requires=['numpy', 'packaging'],
88-
packages=['faiss', 'faiss.contrib', 'faiss.contrib.torch'],
88+
url="https://github.com/facebookresearch/faiss",
89+
author="Matthijs Douze, Jeff Johnson, Herve Jegou, Lucas Hosseini",
90+
author_email="matthijs@meta.com",
91+
license="MIT",
92+
keywords="search nearest neighbors",
93+
install_requires=["numpy", "packaging"],
94+
packages=["faiss", "faiss.contrib", "faiss.contrib.torch"],
8995
package_data={
90-
'faiss': ['*.so', '*.pyd'],
96+
"faiss": ["*.so", "*.pyd"],
9197
},
9298
zip_safe=False,
9399
)

0 commit comments

Comments
 (0)