-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
59 lines (49 loc) · 1.6 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
from distutils.util import convert_path
from distutils.extension import Extension
from setuptools import setup, find_packages
import numpy
# https://stackoverflow.com/questions/4505747/how-should-i-structure-a-python-package-that-contains-cython-code
try:
from Cython.Build import build_ext
except ImportError:
use_cython = False
else:
use_cython = True
cmdclass = {}
ext_modules = []
if use_cython:
ext_modules += [
Extension("rec.io.entropy_coding", ["rec/io/entropy_coding.pyx"]),
]
cmdclass.update({"build_ext": build_ext})
else:
ext_modules += [
Extension("rec.io.entropy_coding", ["rec/io/entropy_coding.c"]),
]
def readme() -> str:
with open("README.md") as f:
return f.read()
version_dict = {}
with open(convert_path("rec/version.py")) as f:
exec(f.read(), version_dict)
setup(name="relative-entropy-coding",
version=version_dict['__version__'],
description="Relative Entropy coding implementations",
long_description=readme(),
long_description_content_type="text/markdown",
classifiers=["Programming Language :: Python :: 3.6",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent"],
author="Gergely Flamich",
author_email="[email protected]",
python_requires=">=3.6",
packages=find_packages(),
include_package_data=True,
install_requires=[
"tensorflow-gpu",
"tensorflow-probability",
],
ext_modules=ext_modules,
cmdclass=cmdclass,
include_dirs=[numpy.get_include()],
)