forked from henrystoldt/MAPLEAF
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
80 lines (66 loc) · 2.79 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
import setuptools
from Cython.Build import cythonize
from pkg_resources import parse_requirements
from setuptools import Extension, setup
import MAPLEAF
#### Get/Set info to be passed into setup() ####
with open("README.md", "r") as fh:
long_description = fh.read()
with open("requirements.txt") as reqFile:
lines = reqFile.readlines()
install_reqs = list([ str(x) for x in parse_requirements(lines)])
#### Create list of setuptools.Extension objects for Cython to compile ####
# Add Cython files here, together with ".c" if it compiles to Cython-Generated C code, or ".cpp" if it compiles to Cython-Generated C++ code
CythonFiles = [ [ "MAPLEAF/Motion/CythonVector.pyx", ".c" ],
[ "MAPLEAF/Motion/CythonQuaternion.pyx", ".c" ],
[ "MAPLEAF/Motion/CythonAngularVelocity.pyx", ".c" ],
[ "MAPLEAF/Rocket/CythonFinFunctions.pyx", ".cpp" ],
["MAPLEAF/IO/CythonLog.pyx", ".c" ]
]
def buildExtensionObjectsForCythonCode(CythonFilesList):
extensions = []
for cyModule in CythonFiles:
pyxPath = cyModule[0]
pythonImportPath = pyxPath.replace("/", ".")
pythonImportPath = pythonImportPath.replace(".pyx", "")
extensions.append( Extension(name=pythonImportPath, sources=[pyxPath]) )
return extensions
extensions = buildExtensionObjectsForCythonCode(CythonFiles)
setup(
name='MAPLEAF',
version=MAPLEAF.__version__,
author="Henry Stoldt",
author_email="hhstoldt@ucalgary.ca",
description="A compact, extensible rocket flight simulation framework for researchers and rocket designers",
install_requires=install_reqs,
license='MIT',
long_description = long_description,
long_description_content_type="text/markdown",
url="https://github.com/henrystoldt/MAPLEAF",
packages=setuptools.find_packages(exclude=[ "test", "test.*", ]),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Natural Language :: English",
"Topic :: Scientific/Engineering :: Physics",
],
include_package_data=True,
test_suite='nose.collector',
tests_require=['nose'],
python_requires='>=3.6',
ext_modules=cythonize(extensions, language_level="3" ),
zip_safe=False,
entry_points={
'console_scripts': [
'mapleaf = MAPLEAF.Main:main',
'mapleaf-batch = MAPLEAF.SimulationRunners.Batch:main' ]
}
)