-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
65 lines (57 loc) · 1.64 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
56
57
58
59
60
61
62
63
64
65
import platform
import sys
from Cython.Build import cythonize
from setuptools import Extension, setup
EXT_SOURCES = [
"MetroHash/src/metrohash64.cpp",
"MetroHash/src/metrohash128.cpp",
]
INT_SOURCES = ["metrohash.pyx"]
machine = platform.machine().lower()
x86 = ("x86_64", "amd64", "i386", "x86", "i686")
if sys.platform == "win32":
if machine in x86:
cflags = ["/O2", "/arch:AVX"]
else:
cflags = ["/O2"]
else:
if machine in x86:
cflags = ["-O2", "-mavx"]
else:
cflags = ["-O2"]
extensions = [
Extension(
"metrohash",
sources=EXT_SOURCES + INT_SOURCES,
extra_compile_args=cflags,
include_dirs=["MetroHash/src"],
language="c++",
)
]
with open("README.md", encoding="utf-8") as fr:
long_description = fr.read()
setup(
author="Dobatymo",
name="metrohash-python",
version="1.1.3.3",
url="https://github.com/Dobatymo/metrohash-python",
description="Python bindings for MetroHash",
long_description=long_description,
long_description_content_type="text/markdown",
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: ISC License (ISCL)",
"Operating System :: OS Independent",
"Programming Language :: C++",
"Programming Language :: Cython",
"Programming Language :: Python :: 3",
"Topic :: Internet",
"Topic :: Scientific/Engineering",
"Topic :: Utilities",
],
ext_modules=cythonize(extensions),
python_requires=">=3.7",
zip_safe=False,
)