-
Notifications
You must be signed in to change notification settings - Fork 74
/
setup.py
55 lines (47 loc) · 1.97 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python3
"""Setup script"""
from pathlib import Path
import re
import os
import setuptools
if __name__ == "__main__":
# Read metadata from version.py
with Path("autofaiss/version.py").open(encoding="utf-8") as file:
metadata = dict(re.findall(r'__([a-z]+)__\s*=\s*"([^"]+)"', file.read()))
# Read description from README
with Path(Path(__file__).parent, "README.md").open(encoding="utf-8") as file:
long_description = file.read()
def _read_reqs(relpath):
fullpath = os.path.join(os.path.dirname(__file__), relpath)
with open(fullpath) as f:
return [s.strip() for s in f.readlines() if (s.strip() and not s.startswith("#"))]
_INSTALL_REQUIRES = _read_reqs("requirements.txt")
_TEST_REQUIRE = ["pytest"]
# Run setup
setuptools.setup(
name="autofaiss",
version=metadata["version"],
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Intended Audience :: Developers",
],
long_description=long_description,
long_description_content_type="text/markdown",
description=long_description.split("\n")[0],
author=metadata["author"],
install_requires=_INSTALL_REQUIRES,
tests_require=_TEST_REQUIRE,
dependency_links=[],
entry_points={"console_scripts": ["autofaiss = autofaiss.external.quantize:main"]},
data_files=[(".", ["requirements.txt", "README.md"])],
packages=setuptools.find_packages(),
url="https://github.com/criteo/autofaiss",
)