Skip to content

Commit

Permalink
revert change to setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
mengdilin committed Sep 20, 2024
1 parent 8a0c80a commit 40f06f8
Showing 1 changed file with 20 additions and 27 deletions.
47 changes: 20 additions & 27 deletions faiss/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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}"
Expand All @@ -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}")
Expand All @@ -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
Expand All @@ -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,
)

0 comments on commit 40f06f8

Please sign in to comment.