forked from SteveDoyle2/pyNastran
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
228 lines (202 loc) · 7.38 KB
/
setup.py
File metadata and controls
228 lines (202 loc) · 7.38 KB
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
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#!/usr/bin/env python
import os
import sys
from setuptools import setup, find_packages
PY2 = False
if sys.version_info < (3, 0):
PY2 = True
if sys.version_info < (2, 7, 7):
imajor, minor1, minor2 = sys.version_info[:3]
# makes sure we don't get the following bug:
# Issue #19099: The struct module now supports Unicode format strings.
sys.exit('Upgrade your Python to >= 2.7.7; version=(%s.%s.%s)' % (imajor, minor1, minor2))
import pyNastran
packages = find_packages()+['gui/icons/*.*']
#print "packages = ",packages
#sys.exit()
#extra = {}
#if sys.version_info >= (3,):
#extra['use_2to3'] = True
#extra['convert_2to3_doctests'] = ['src/your/module/README.txt'] # what does this do?
#extra['use_2to3_fixers'] = ['your.fixers']
py2_gui_scripts = []
py2_packages = []
py3_gui_scripts = []
py3_packages = []
if sys.version_info <= (3,):
try:
import vtk
vtk_version = '.'.join(vtk.VTK_VERSION.split('.'))
if vtk_version < '5.10.1':
print("vtk.VTK_VERSION = %r < '5.10.1'" % vtk.VTK_VERSION)
py2_packages.append('vtk >= 5.10.1')
except ImportError:
py2_packages.append('vtk >= 5.10.1')
#try:
#import PIL
#if PIL.VERSION < '2.7.0':
##print("PIL.version = %r < '2.7.0'" % PIL.VERSION)
#py2_packages.append('pillow >= 2.7.0')
#except ImportError:
#py2_packages.append('pillow >= 2.7.0')
py2_packages += [
#'vtk >= 5.10.1',
#'pillow >= 2.7.0',
##'dill'
##'wx >= 2.8.12.0',
]
# try:
# import vtk
# vtk_version = '.'.join(vtk.VTK_VERSION.split('.'))
# if vtk_version < '7.0.0':
# print("vtk.VTK_VERSION = %r < '7.0.0'" % vtk.VTK_VERSION)
# py3_packages.append('vtk >= 7.0.0')
# except ImportError:
# py3_packages.append('vtk >= 7.0.0')
#try: # is this still required?
#import PIL
#if PIL.VERSION < '2.7.0':
#print("PIL.version = %r < '2.7.0'" % PIL.VERSION)
#py3_packages.append('pillow >= 2.7.0')
#except ImportError:
#py3_packages.append('pillow >= 2.7.0')
py3_packages += [
#'vtk >= 5.10.0',
#'pillow >= 2.7.0',
##'dill'
##'wx >= 2.8.12.0',
]
py_packages = []
try:
import numpy as np
ver = np.lib.NumpyVersion(np.__version__)
if ver < '1.11.0':
print("np.__version__ = %r < '1.11.0'" % np.__version__)
py_packages.append('numpy >= 1.11.0')
except ImportError:
py_packages.append('numpy >= 1.11.0')
try:
import scipy
ver = scipy.version.short_version
if ver < '0.17.0':
print("scipy.version.short_version = %r < '0.17.0'" % scipy.version.short_version)
py_packages.append('scipy >= 0.17.0')
except ImportError:
py_packages.append('scipy >= 0.17.0')
try:
import six
sver = [int(val) for val in six.__version__.split('-')[0].split('.')]
if sver < [1, 9, 0]:
print("six.__version__ = %r < '1.9.0'" % six.__version__)
py_packages.append('six >= 1.9.0')
except ImportError:
py_packages.append('six >= 1.9.0')
try:
import matplotlib
sver = [int(val) for val in matplotlib.__version__.split('-')[0].split('.')]
if sver < [1, 5, 1]:
print("matplotlib.__version__ = %r < '1.5.1'" % six.__version__)
py_packages.append('matplotlib >= 1.5.1, <2')
except ImportError:
py_packages.append('matplotlib >= 1.5.1, <2')
try:
import docopt
sver = [int(val) for val in docopt.__version__.split('-')[0].split('.')]
if sver != [0, 6, 2]:
#if docopt.__version__ != '0.6.2':
print("docopt.__version__ = %r != '0.6.2'" % docopt.__version__)
py_packages.append('docopt == 0.6.2')
except ImportError:
py_packages.append('docopt == 0.6.2')
try:
import imageio
if imageio.__version__ < '2.1.2':
#print("imageio.version = %r < '2.1.2'" % imageio.__version__)
py_packages.append('imageio >= 2.1.2')
except ImportError:
py_packages.append('imageio >= 2.1.2')
#py_packages = [
# 'numpy >= 1.9.2',
# 'scipy >= 0.16.0, scipy < 0.18.0',
#]
is_windows = 'nt' in os.name
if 'dev' in pyNastran.__version__ and not is_windows:
py_packages.append('python-coveralls')
#py_packages.append('coverage')
install_requires = py_packages + [
# -*- Extra requirements: -*-
#'docopt == 0.6.2',
##'matplotlib >= 1.3.0',
#'six >= 1.9.0',
##'cython',
] + py2_packages + py3_packages,
# set up all icons
icon_path = os.path.join('pyNastran', 'gui', 'icons')
icon_files = os.listdir(icon_path)
icon_files2 = []
for icon_file in icon_files:
if icon_file.endswith('.png'):
icon_files2.append(os.path.join(icon_path, icon_file))
exclude_words = [
'pyNastran.bdf.dev_vectorized', 'pyNastran.f06.dev',
'pyNastran.op2.dev', 'pyNastran.op2.dev.original',
'pyNastran.converters.dev', 'pyNastran.xdb',]
packages = find_packages(exclude=['ez_setup', 'examples', 'tests'] + exclude_words)
for exclude_word in exclude_words:
packages = [package for package in packages if exclude_word not in package]
#print(packages, len(packages)) # 83
setup(
name='pyNastran',
version=pyNastran.__version__,
description=pyNastran.__desc__,
long_description="""\
""",
classifiers=[
'Natural Language :: English',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
], # Get strings from http://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords='',
author=pyNastran.__author__,
author_email=pyNastran.__email__,
url=pyNastran.__website__,
license=pyNastran.__license__,
packages=packages,
include_package_data=True,
zip_safe=False,
install_requires=install_requires,
#{'': ['license.txt']}
#package_data={'': ['*.png']},
#data_files=[(icon_path, icon_files2)],
package_data={
# https://pythonhosted.org/setuptools/setuptools.html#including-data-files
# If any package contains *.png files, include them:
'': ['*.png'],
#'mypkg': ['data/*.dat'],
},
entry_points={
'console_scripts': [
'run_nastran_double_precision = pyNastran.bdf.test.run_nastran_double_precision:cmd_line',
'test_bdf = pyNastran.bdf.test.test_bdf:main',
'test_op2 = pyNastran.op2.test.test_op2:main',
'test_op4 = pyNastran.op4.test.test_op4:main',
'test_abaqus = pyNastran.converters.abaqus.test_abaqus:main',
'test_pynastrangui = pyNastran.gui.test.test_gui:main',
#'test_f06 = pyNastran.f06.test.test_f06:main',
'format_converter = pyNastran.converters.type_converter:main',
'pyNastranGUI = pyNastran.gui.gui:cmd_line',
'bdf = pyNastran.bdf.mesh_utils.utils:cmd_line',
'f06 = pyNastran.f06.utils:cmd_line',
'pyNastranv = pyNastran.bdf.dev_vectorized.solver.solver:main',
'test_bdfv = pyNastran.bdf.dev_vectorized.test.test_bdf_vectorized2:main',
#'nastranToCodeAster = pyNastran.converters.toCodeAster:main',
]
},
test_suite='pyNastran.all_tests',
)