-
Notifications
You must be signed in to change notification settings - Fork 65
/
setup.py
135 lines (106 loc) · 3.95 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
#!/usr/bin/env python
"""
Setup script for PyDSTool
This uses Distutils, the standard Python mechanism for installing packages.
For the easiest installation just type::
python setup.py install
(root privileges probably required). If you'd like to install only for local
user, type the following to install PyDSTool::
python setup.py install --user
In addition, there are some other commands::
python setup.py clean - Clean all trash (*.pyc, emacs backups, etc.)
python setup.py test - Run test suite
"""
from setuptools import setup, os, find_packages
from setuptools.command.test import test as TestCommand
from setuptools import Command
import sys
MAJOR = 0
MINOR = 91
MICRO = 0
__version__ = '%d.%d.%d' % (MAJOR, MINOR, MICRO)
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
if sys.version_info[0:2] < (3, 6):
raise RuntimeError("Python 3.6+ required.")
class clean(Command):
description = 'Remove build and trash files'
user_options = [("all", "a", "the same")]
def initialize_options(self):
self.all = None
def finalize_options(self):
pass
def run(self):
os.system(
"rm -fr ./*.pyc ./*~ ./*/*.pyc ./*/*~ ./*/*/*.pyc ./*/*/*~ "
"./*/*/*.so ./PyDSTool/tests/auto_temp "
"./PyDSTool/tests/dopri853_temp ./PyDSTool/tests/radau5_temp "
"./PyDSTool/tests/dop853* ./PyDSTool/tests/radau5* "
"./PyDSTool/tests/*.pkl ./PyDSTool/tests/fort.9")
os.system("rm -rf tests/radau5_temp tests/dopri853_temp radau5_temp "
"dopri853_temp")
os.system("rm -fr build")
os.system("rm -fr dist")
# os.system("rm -fr doc/_build")
class PyTest(TestCommand):
def finalize_options(self):
self.test_suite = 'tests'
TestCommand.finalize_options(self)
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
os.system("rm -rf dop853_temp radau5_temp auto_temp")
sys.exit(errno)
def get_datafiles():
source_dirs = ['examples', 'tests']
datafiles = []
for s in source_dirs:
for d, _, files in os.walk(s):
datafiles.append((d, [os.path.join(d, f) for f in files]))
return datafiles
needs_pytest = {'test', 'pytest', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
setup(
name="PyDSTool",
version=__version__,
packages=find_packages(),
setup_requires=pytest_runner,
install_requires=[
"scipy>=1.0,<2.0",
"numpy>=1.6"
],
tests_require=['pytest', 'pytest-mock', 'pytest-xdist'],
cmdclass={
'test': PyTest,
'clean': clean
},
author="Rob Clewley; W. Erik Sherwood; M. Drew Lamar; Vladimir Zakharov",
author_email="[email protected]",
maintainer="Rob Clewley",
maintainer_email="[email protected]",
description="Python dynamical systems simulation and modeling",
long_description=read('README.rst') + '\n\n' + read('WHATS_NEW.txt'),
license="BSD",
keywords="dynamical systems, bioinformatics, modeling, bifurcation analysis",
url="https://pydstool.github.io/PyDSTool/FrontPage.html",
download_url="https://github.com/robclewley/pydstool/tarball/v%s" % __version__,
include_package_data=True,
platforms=["any"],
package_data={
'': ['*.txt', '*.rst'],
},
data_files=get_datafiles(),
classifiers=[
"Development Status :: 4 - Beta",
"Topic :: Scientific/Engineering",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: BSD :: FreeBSD",
"Operating System :: POSIX :: Linux",
],
)