-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
91 lines (79 loc) · 2.59 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
# Copyright (C) Cyprien Hoelzl
#
# This file is part of railFE.
#
# railFE is free software: you can redistribute it and/or modify
# it under the terms of the MIT License.
#
# railFE is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the MIT License along with railFE.
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup
from distutils.extension import Extension
import glob
import os
import pathlib
import re
import subprocess
import shutil
import sys
# Importing _version__.py before building can cause issues.
with open('railFE/_version.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
# Parse package name from init file.
with open('railFE/__init__.py', 'r') as fd:
packagename = re.search(r'^__name__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
packages = [packagename, 'examples']
# Parse long_description from README.md file.
with open('README.md','r') as fd:
long_description = fd.read()
# Python version
if sys.version_info[:2] < (3, 7):
sys.exit('\nExited: Requires Python 3.7 or newer!\n')
extensions = []
print(packages)
if sys.version_info[:2]< (3, 8):
scipyversion = "scipy==1.7.3"
numpyversion = "numpy==1.21.6"
else:
scipyversion = "scipy"
numpyversion = "numpy"
setup(name=packagename,
version=version,
author='Cyprien Hoelzl',
url='https://github.com/CyprienHoelzl/railFE',
description='Dynamic simulation of a simplified rail vehicle rolling on a railway track',
long_description=long_description,
long_description_content_type="text/x-rst",
license='MIT',
classifiers=[
'Environment :: Console',
'License :: OSI Approved :: MIT',
'Operating System :: MacOS',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering'
],
#requirements
python_requires=">=3.7",
install_requires=[
"h5py",
"matplotlib",
numpyversion,
scipyversion,
"control",
"numpydoc"
],
ext_modules=extensions,
packages=packages,
include_package_data=True,
zip_safe=False)