From 40f06f89da291dc7eea8400dbab795c546f89f5e Mon Sep 17 00:00:00 2001 From: mengdilin Date: Fri, 20 Sep 2024 16:04:38 -0700 Subject: [PATCH] revert change to setup.py --- faiss/python/setup.py | 47 ++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/faiss/python/setup.py b/faiss/python/setup.py index aaa8621a6b..b1ae4b1be2 100644 --- a/faiss/python/setup.py +++ b/faiss/python/setup.py @@ -4,12 +4,10 @@ # LICENSE file in the root directory of this source tree. from __future__ import print_function - +from setuptools import setup, find_packages import os -import platform import shutil - -from setuptools import find_packages, setup +import platform # make the faiss python package dir shutil.rmtree("faiss", ignore_errors=True) @@ -22,8 +20,8 @@ shutil.copyfile("extra_wrappers.py", "faiss/extra_wrappers.py") shutil.copyfile("array_conversions.py", "faiss/array_conversions.py") -ext = ".pyd" if platform.system() == "Windows" else ".so" -prefix = "Release/" * (platform.system() == "Windows") +ext = ".pyd" if platform.system() == 'Windows' else ".so" +prefix = "Release/" * (platform.system() == 'Windows') swigfaiss_generic_lib = f"{prefix}_swigfaiss{ext}" swigfaiss_avx2_lib = f"{prefix}_swigfaiss_avx2{ext}" @@ -37,16 +35,10 @@ found_callbacks = os.path.exists(callbacks_lib) found_swigfaiss_sve = os.path.exists(swigfaiss_sve_lib) -assert ( - found_swigfaiss_generic - or found_swigfaiss_avx2 - or found_swigfaiss_avx512 - or found_swigfaiss_sve -), ( - f"Could not find {swigfaiss_generic_lib} or " - f"{swigfaiss_avx2_lib} or {swigfaiss_avx512_lib} or {swigfaiss_sve_lib}. " +assert (found_swigfaiss_generic or found_swigfaiss_avx2 or found_swigfaiss_avx512 or found_swigfaiss_sve), \ + f"Could not find {swigfaiss_generic_lib} or " \ + f"{swigfaiss_avx2_lib} or {swigfaiss_avx512_lib} or {swigfaiss_sve_lib}. " \ f"Faiss may not be compiled yet." -) if found_swigfaiss_generic: print(f"Copying {swigfaiss_generic_lib}") @@ -72,7 +64,7 @@ shutil.copyfile("swigfaiss_sve.py", "faiss/swigfaiss_sve.py") shutil.copyfile(swigfaiss_sve_lib, f"faiss/_swigfaiss_sve{ext}") -long_description = """ +long_description=""" Faiss is a library for efficient similarity search and clustering of dense vectors. It contains algorithms that search in sets of vectors of any size, up to ones that possibly do not fit in RAM. It also contains supporting @@ -81,19 +73,20 @@ are implemented on the GPU. It is developed by Facebook AI Research. """ setup( - name="faiss", - version="1.8.0", - description="A library for efficient similarity search and clustering of dense vectors", + name='faiss', + version='1.8.0', + description='A library for efficient similarity search and clustering of dense vectors', long_description=long_description, - url="https://github.com/facebookresearch/faiss", - author="Matthijs Douze, Jeff Johnson, Herve Jegou, Lucas Hosseini", - author_email="matthijs@meta.com", - license="MIT", - keywords="search nearest neighbors", - install_requires=["numpy", "packaging"], - packages=["faiss", "faiss.contrib", "faiss.contrib.torch"], + url='https://github.com/facebookresearch/faiss', + author='Matthijs Douze, Jeff Johnson, Herve Jegou, Lucas Hosseini', + author_email='matthijs@meta.com', + license='MIT', + keywords='search nearest neighbors', + + install_requires=['numpy', 'packaging'], + packages=['faiss', 'faiss.contrib', 'faiss.contrib.torch'], package_data={ - "faiss": ["*.so", "*.pyd"], + 'faiss': ['*.so', '*.pyd'], }, zip_safe=False, )