-
Notifications
You must be signed in to change notification settings - Fork 14
/
setup.py
79 lines (64 loc) · 2.79 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
# -*- coding: utf-8 -*-
#
from setuptools import setup
import os
import re
import sys
if sys.version_info < (3, 4):
sys.exit('Python < 3.4 is not supported')
# get abs path from this folder name
here = os.path.dirname(os.path.abspath(__file__))
# open __init__.py, where version is specified
with open(os.path.join(here, 'inferpy', '__init__.py')) as f:
txt = f.read()
# try to read it from source code
try:
version = re.findall(r"^__version__ = '([^']+)'\r?$",
txt, re.M)[0]
except IndexError:
raise RuntimeError('Unable to determine version.')
# get long description from file in docs folder
with open(os.path.join(here, 'docs/project_description.md')) as f:
long_description = f.read()
# function to read requirements, and include them as package dependencies
def get_requirements(*files):
# read requirements.txt file and return them as a list of strings
reqs = []
for file in files:
with open(file) as f:
req = f.readlines()
reqs += [r.strip() for r in req]
return reqs # clean lines from blank spaces and line breaks
setup(
name='inferpy',
version=version,
description='Deep Probabilistic modeling with Tensorflow made easy',
long_description=long_description,
long_description_content_type="text/markdown",
author='Andrés R. Masegosa, Rafael Cabañas, Javier Cózar',
author_email="andresma@ual.es, rcabanas@ual.es, jcozar87@ual.es",
url='http://inferpy.readthedocs.io',
download_url='https://github.com/PGMLabSpain/InferPy/archive/{}.tar.gz'.format(version),
keywords='machine learning statistics probabilistic programming tensorflow edward2',
license='Apache License 2.0',
classifiers=['Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX :: Linux',
'Operating System :: MacOS :: MacOS X',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python :: 3.4'],
packages=['inferpy'],
python_requires='>=3.5',
install_requires=get_requirements('requirements/prod.txt'),
extras_require={
'gpu': get_requirements('requirements/gpu.txt'),
'visualization': get_requirements('requirements/visualization.txt'),
'datasets': get_requirements('requirements/datasets.txt'),
'all': get_requirements('requirements/visualization.txt', 'requirements/datasets.txt'),
'all-gpu': get_requirements('requirements/gpu.txt', 'requirements/visualization.txt', 'requirements/datasets.txt'),
},
tests_require=get_requirements('requirements/test.txt'),
include_package_data=True,
)