-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
109 lines (87 loc) · 2.55 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
# F2x installation script (setup.py)
#
# Copyright 2018 German Aerospace Center (DLR)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
import setuptools
from distutils.core import setup
package_data = {
'F2x.parser.plyplus.grammar': ["*.g"],
}
cmdclass = {}
command_options = {}
sys.path.append(os.path.abspath('src'))
try:
# Try to extract program information from sources.
import F2x
from F2x.template import collect_template_data
name = F2x.program_name
version = F2x.get_version_string()
release = F2x.get_version_string(full=True)
for package, data_files in collect_template_data():
package_data[package.__name__] = package_data.get(package.__name__, []) + data_files
except ImportError:
# Fallback: set them manual :(
name = 'F2x'
version = '0.0.0'
release = '0.0'
try:
from F2x.distutils.command import build_sphinx
cmdclass['build_sphinx'] = build_sphinx.build_sphinx
command_options['build_sphinx'] = {
'project': ('setup.py', name),
'version': ('setup.py', version),
'release': ('setup.py', release),
'source_dir': ('setup.py', 'doc/src'),
'build_dir': ('setup.py', 'doc'),
}
except ImportError:
pass
setup(
name=name,
version=version,
description='Template-based Fortran wrapper.',
author='Michael Meinel',
author_email='[email protected]',
url='http://www.dlr.de/sc',
cmdclass=cmdclass,
command_options=command_options,
packages=setuptools.find_packages('src'),
package_dir={ '': 'src' },
package_data=package_data,
install_requires=[
'plyplus',
'jinja2',
'numpy',
],
extras_require={
'cython': ['Cython', ],
'docs': [
'six',
'sphinx',
'sphinx-argparse',
],
'tests': [
'pytest-runner',
'pytest',
],
},
entry_points={
'console_scripts': [
'F2x=F2x.runtime.main:main',
'F2x-d=F2x.runtime.daemon:main',
],
},
)