forked from devitocodes/devito
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
79 lines (69 loc) · 2.62 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
import versioneer
import os
from setuptools import setup, find_packages
with open('requirements.txt') as f:
required = f.read().splitlines()
with open('requirements-optional.txt') as f:
optionals = f.read().splitlines()
with open('requirements-testing.txt') as f:
testing = f.read().splitlines()
with open('requirements-mpi.txt') as f:
mpis = f.read().splitlines()
with open('requirements-nvidia.txt') as f:
nvidias = f.read().splitlines()
reqs = []
for ir in required:
if ir[0:3] == 'git':
name = ir.split('/')[-1]
reqs += ['%s @ %s@master' % (name, ir)]
else:
reqs += [ir]
extras_require = {}
for mreqs, mode in (zip([optionals, mpis, nvidias, testing],
['extras', 'mpi', 'nvidia', 'tests'])):
opt_reqs = []
for ir in mreqs:
# For conditionals like pytest=2.1; python == 3.6
if ';' in ir:
entries = ir.split(';')
extras_require[entries[1]] = entries[0]
# Git repos, install master
if ir[0:3] == 'git':
name = ir.split('/')[-1]
opt_reqs += ['%s @ %s@master' % (name, ir)]
else:
opt_reqs += [ir]
extras_require[mode] = opt_reqs
# If interested in benchmarking devito, we need the `examples` too
exclude = ['docs', 'tests']
try:
if not bool(int(os.environ.get('DEVITO_BENCHMARKS', 0))):
exclude += ['examples']
else:
required += testing
except (TypeError, ValueError):
exclude += ['examples']
setup(name='devito',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description="Finite Difference DSL for symbolic computation.",
long_description="""
Devito is a tool for performing optimised Finite Difference (FD)
computation from high-level symbolic problem definitions. Devito
performs automated code generation and Just-In-time (JIT) compilation
based on symbolic equations defined in SymPy to create and execute highly
optimised Finite Difference stencil kernels on multiple computer platforms.""",
project_urls={
'Documentation': 'https://www.devitoproject.org/devito/index.html',
'Source Code': 'https://github.com/devitocodes/devito',
'Issue Tracker': 'https://github.com/devitocodes/devito/issues',
},
url='http://www.devitoproject.org',
platforms=["Linux", "Mac OS-X", "Unix"],
test_suite='pytest',
author="Imperial College London",
author_email='[email protected]',
license='MIT',
packages=find_packages(exclude=exclude),
install_requires=reqs,
extras_require=extras_require)