|
| 1 | +import platform |
1 | 2 | import sys
|
2 |
| -from io import open |
3 | 3 |
|
4 | 4 | from Cython.Build import cythonize
|
5 |
| -import platform |
6 | 5 | from setuptools import Extension, setup
|
7 | 6 |
|
8 | 7 | EXT_SOURCES = [
|
9 |
| - "MetroHash/src/metrohash64.cpp", |
10 |
| - "MetroHash/src/metrohash128.cpp", |
| 8 | + "MetroHash/src/metrohash64.cpp", |
| 9 | + "MetroHash/src/metrohash128.cpp", |
11 | 10 | ]
|
12 | 11 |
|
13 |
| -INT_SOURCES = [ |
14 |
| - "metrohash.pyx" |
15 |
| -] |
| 12 | +INT_SOURCES = ["metrohash.pyx"] |
16 | 13 |
|
17 | 14 | if sys.platform == "win32":
|
18 |
| - cflags = ["/O2", "/arch:AVX2"] |
| 15 | + cflags = ["/O2", "/arch:AVX2"] |
19 | 16 | else:
|
20 |
| - if platform.machine().lower() in ("x86_64", "amd64"): |
21 |
| - cflags = ["-O3", "-msse4.2"] |
22 |
| - else: |
23 |
| - cflags = ["-O3", "-march=native"] |
24 |
| - |
25 |
| -extensions = [Extension( |
26 |
| - "metrohash", |
27 |
| - sources=EXT_SOURCES + INT_SOURCES, |
28 |
| - extra_compile_args=cflags, |
29 |
| - include_dirs=["MetroHash/src"], |
30 |
| - language="c++" |
31 |
| -)] |
| 17 | + if platform.machine().lower() in ("x86_64", "amd64"): |
| 18 | + cflags = ["-O3", "-msse4.2"] |
| 19 | + else: |
| 20 | + cflags = ["-O3", "-march=native"] |
| 21 | + |
| 22 | +extensions = [ |
| 23 | + Extension( |
| 24 | + "metrohash", |
| 25 | + sources=EXT_SOURCES + INT_SOURCES, |
| 26 | + extra_compile_args=cflags, |
| 27 | + include_dirs=["MetroHash/src"], |
| 28 | + language="c++", |
| 29 | + ) |
| 30 | +] |
32 | 31 |
|
33 |
| -with open("README.md", "r", encoding="utf-8") as fr: |
34 |
| - long_description = fr.read() |
| 32 | +with open("README.md", encoding="utf-8") as fr: |
| 33 | + long_description = fr.read() |
35 | 34 |
|
36 | 35 | setup(
|
37 |
| - author="Dobatymo", |
38 |
| - name="metrohash-python", |
39 |
| - version="1.1.3.3", |
40 |
| - url="https://github.com/Dobatymo/metrohash-python", |
41 |
| - description="Python bindings for MetroHash", |
42 |
| - long_description=long_description, |
43 |
| - long_description_content_type="text/markdown", |
44 |
| - classifiers=[ |
45 |
| - "Development Status :: 4 - Beta", |
46 |
| - "Intended Audience :: Developers", |
47 |
| - "Intended Audience :: Science/Research", |
48 |
| - "License :: OSI Approved :: ISC License (ISCL)", |
49 |
| - "Operating System :: OS Independent", |
50 |
| - "Programming Language :: C++", |
51 |
| - "Programming Language :: Cython", |
52 |
| - "Programming Language :: Python :: 2", |
53 |
| - "Programming Language :: Python :: 3", |
54 |
| - "Topic :: Internet", |
55 |
| - "Topic :: Scientific/Engineering", |
56 |
| - "Topic :: Utilities" |
57 |
| - ], |
58 |
| - |
59 |
| - ext_modules=cythonize(extensions), |
60 |
| - python_requires=">=2.7", |
61 |
| - use_2to3=False, |
62 |
| - zip_safe=False, |
| 36 | + author="Dobatymo", |
| 37 | + name="metrohash-python", |
| 38 | + version="1.1.3.3", |
| 39 | + url="https://github.com/Dobatymo/metrohash-python", |
| 40 | + description="Python bindings for MetroHash", |
| 41 | + long_description=long_description, |
| 42 | + long_description_content_type="text/markdown", |
| 43 | + classifiers=[ |
| 44 | + "Development Status :: 4 - Beta", |
| 45 | + "Intended Audience :: Developers", |
| 46 | + "Intended Audience :: Science/Research", |
| 47 | + "License :: OSI Approved :: ISC License (ISCL)", |
| 48 | + "Operating System :: OS Independent", |
| 49 | + "Programming Language :: C++", |
| 50 | + "Programming Language :: Cython", |
| 51 | + "Programming Language :: Python :: 3", |
| 52 | + "Topic :: Internet", |
| 53 | + "Topic :: Scientific/Engineering", |
| 54 | + "Topic :: Utilities", |
| 55 | + ], |
| 56 | + ext_modules=cythonize(extensions), |
| 57 | + python_requires=">=3.6", |
| 58 | + use_2to3=False, |
| 59 | + zip_safe=False, |
63 | 60 | )
|
0 commit comments