-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
109 lines (100 loc) · 3.2 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
import platform
from setuptools import setup, Extension, find_packages
import os
try:
from Cython.Build import cythonize, build_ext
except ImportError:
# No Cython but we may have pre-converted the files
maybe_cythonize = lambda x: x
cython_cpp_ext = 'cpp'
else:
maybe_cythonize = cythonize
cython_cpp_ext = 'pyx'
here = os.path.abspath(os.path.dirname(__file__))
requirements = [
"bitarray>=2.5",
"numpy>=1.19",
"mypy-extensions>=0.4",
"Cython>=0.29"
]
test_requirements = [
"pytest",
"pytest-timeout",
"pytest-cov",
"codecov",
"hypothesis",
"clkhash>=0.16.1",
]
current_os = platform.system()
if current_os == "Windows":
extra_compile_args = ['/std:c++17', '/O2']
extra_link_args = []
else:
extra_compile_args = ['-O3', '-std=c++11']
extra_link_args = []
extensions = [
Extension(
name="solving._multiparty_solving",
sources=["anonlink/solving/_multiparty_solving." + cython_cpp_ext,
"anonlink/solving/_multiparty_solving_inner.cpp"],
include_dirs=["anonlink/solving"],
language="c++",
extra_compile_args=extra_compile_args,
extra_link_args=extra_compile_args,
define_macros=[('NDEBUG', None)]
),
Extension(
name="similarities._dice",
sources=[
"anonlink/similarities/_dice." + cython_cpp_ext
],
include_dirs=["anonlink/similarities"],
language="c++",
extra_compile_args=extra_compile_args,
extra_link_args=extra_link_args,
define_macros=[('NDEBUG', None)]
)
]
with open('README.rst', 'r', encoding='utf-8') as f:
readme = f.read()
setup(
name="anonlink",
version='0.15.3',
description='Anonymous linkage using cryptographic hashes and bloom filters',
long_description=readme,
long_description_content_type='text/x-rst',
url='https://github.com/data61/anonlink',
license='Apache',
setup_requires=["pytest-runner"],
install_requires=requirements,
tests_require=test_requirements,
extras_require={
"test": test_requirements
},
packages=find_packages(exclude=[
'tests'
]),
package_data={'anonlink': []},
ext_modules=maybe_cythonize(extensions),
ext_package="anonlink",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3",
"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",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Security :: Cryptography",
],
zip_safe=False,
)