-
Notifications
You must be signed in to change notification settings - Fork 0
/
builddist.py
53 lines (45 loc) · 1.6 KB
/
builddist.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
#!/usr/bin/python3 -O
from setuptools import setup
from Cython.Build import cythonize
import numpy as np
from distutils.extension import Extension
import os
_PACK_NAME_ = "MAB_algorithm"
_VERSION_ = "0.0.12"
def main():
with open('README.md', 'r', encoding='utf-8') as f:
long_description = f.read()
with open(f"{os.path.dirname(os.path.abspath(__file__))}/setup.py", 'r', encoding='utf-8') as f:
content = f.read()
content = content.split('\n')
content[0] = f"_PACK_NAME_ = \"{_PACK_NAME_}\""
content[1] = f"_VERSION_ = \"{_VERSION_}\""
with open(f"{os.path.dirname(os.path.abspath(__file__))}/setup.py", 'w', encoding='utf-8') as f:
f.write('\n'.join(content))
setup(
name=_PACK_NAME_,
version=_VERSION_,
author="Antares",
author_email="Antares0982@gmail.com",
license="MIT",
platforms=["Windows", "Linux"],
description="A modern multi-armed bandits library.",
long_description=long_description,
long_description_content_type='text/markdown',
url="https://github.com/Antares0982/MAB-algorithm-template",
ext_modules=cythonize([Extension("mabCutils", [
f"{_PACK_NAME_}/mabCutils.pyx"
], language="c++")]),
include_dirs=np.get_include(),
options={'build_ext': {"build_lib": _PACK_NAME_}},
install_requires=[
'numpy',
'scipy',
'pandas',
'matplotlib'
],
package_data={_PACK_NAME_: ["*.cpp", "*.h", "*.pyi"]},
packages=[_PACK_NAME_]
)
if __name__ == "__main__":
main()