forked from vinci1it2000/schedula
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·152 lines (135 loc) · 5.32 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
#
# Copyright 2015-2019, Vincenzo Arcidiacono;
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl
import io
import os
import collections
import os.path as osp
name = 'schedula'
mydir = osp.dirname(__file__)
# Version-trick to have version-info in a single place,
# taken from: http://stackoverflow.com/questions/2058802/how-can-i-get-the-
# version-defined-in-setup-py-setuptools-in-my-package
##
def read_project_version():
fglobals = {}
with io.open(osp.join(
mydir, name, '_version.py'), encoding='UTF-8') as fd:
exec(fd.read(), fglobals) # To read __version__
return fglobals['__version__']
def get_long_description(cleanup=True):
from sphinx.application import Sphinx
from sphinx.util.osutil import abspath
import tempfile
import shutil
from doc.conf import extensions
from sphinxcontrib.writers.rst import RstTranslator
from sphinx.ext.graphviz import text_visit_graphviz
RstTranslator.visit_dsp = text_visit_graphviz
outdir = tempfile.mkdtemp(prefix='setup-', dir='.')
exclude_patterns = os.listdir(mydir or '.')
exclude_patterns.remove('pypi.rst')
app = Sphinx(abspath(mydir), osp.join(mydir, 'doc/'), outdir,
outdir + '/.doctree', 'rst',
confoverrides={
'exclude_patterns': exclude_patterns,
'master_doc': 'pypi',
'dispatchers_out_dir': abspath(outdir + '/_dispatchers'),
'extensions': extensions + ['sphinxcontrib.restbuilder']
}, status=None, warning=None)
app.build(filenames=[osp.join(app.srcdir, 'pypi.rst')])
with open(outdir + '/pypi.rst') as file:
res = file.read()
if cleanup:
shutil.rmtree(outdir)
return res
proj_ver = read_project_version()
url = 'https://github.com/vinci1it2000/%s' % name
download_url = '%s/tarball/v%s' % (url, proj_ver)
project_urls = collections.OrderedDict((
('Documentation', 'http://%s.readthedocs.io' % name),
('Issue tracker', '%s/issues' % url),
))
if __name__ == '__main__':
import functools
from setuptools import setup, find_packages
try:
long_description = get_long_description()
except Exception as ex:
import logging
logging.getLogger(__name__).warning('%r', ex)
long_description = ''
extras = {
'web': ['regex', 'flask'],
'plot': ['graphviz', 'regex', 'flask', 'Pygments', 'lxml', 'bs4',
'jinja2', 'docutils'],
'parallel': ['multiprocess'],
}
extras['sphinx'] = ['sphinx'] + extras['plot']
extras['all'] = sorted(functools.reduce(set.union, extras.values(), set()))
extras['dev'] = extras['all'] + [
'wheel', 'sphinx', 'gitchangelog', 'mako', 'sphinx_rtd_theme',
'setuptools>=36.0.1', 'sphinxcontrib-restbuilder', 'nose', 'coveralls',
'requests'
]
setup(
name=name,
version=proj_ver,
packages=find_packages(exclude=[
'test', 'test.*',
'doc', 'doc.*',
'appveyor', 'requirements'
]),
url=url,
project_urls=project_urls,
download_url=download_url,
license='EUPL 1.1+',
author='Vincenzo Arcidiacono',
author_email='[email protected]',
description='Produce a plan that dispatches calls based on a graph of '
'functions, satisfying data dependencies.',
long_description=long_description,
keywords=[
"dataflow", "concurrent", "concurrency", "scheduling", "dispatch",
"processflow", "flow",
"functional programming", "dataflow programming", "framework",
"data", "processing",
"calculation", "dependencies", "resolution", "scientific",
"engineering", "parallel", "asynchronous", "async",
],
classifiers=[
"Programming Language :: Python",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: Implementation :: CPython",
"Development Status :: 5 - Production/Stable",
'Natural Language :: English',
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: European Union Public Licence 1.1 "
"(EUPL 1.1)",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
],
install_requires=['networkx>=2.0.0', 'dill!=0.2.7'],
extras_require=extras,
test_suite='nose.collector',
setup_requires=['nose>=1.0'],
package_data={
'schedula.utils.drw': [
'templates/*'
]
},
)