-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
115 lines (93 loc) · 3.31 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
import os
import inspect
import subprocess
from setuptools import setup, find_packages
is_released = True
version = '2024.2'
def git_version():
def _minimal_ext_cmd(cmd):
# construct minimal environment
env = {}
for k in ['SYSTEMROOT', 'PATH']:
v = os.environ.get(k)
if v is not None:
env[k] = v
# LANGUAGE is used on win32
env['LANGUAGE'] = 'C'
env['LANG'] = 'C'
env['LC_ALL'] = 'C'
out = subprocess.Popen(cmd, stdout=subprocess.PIPE, env=env).communicate()[0]
return out
try:
out = _minimal_ext_cmd(['git', 'rev-parse', 'HEAD'])
git_revision = out.strip().decode('ascii')
except OSError:
git_revision = "Unknown"
return git_revision
def get_version_info(version, is_released):
fullversion = version
if not is_released:
git_revision = git_version()
fullversion += '.dev0+' + git_revision[:7]
return fullversion
def write_version_py(version, is_released, filename='tudaesasII/version.py'):
fullversion = get_version_info(version, is_released)
with open("./tudaesasII/version.py", "wb") as f:
f.write(b'__version__ = "%s"\n' % fullversion.encode())
return fullversion
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
setupdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
return open(os.path.join(setupdir, fname)).read()
#_____________________________________________________________________________
install_requires = [
"numpy",
"scipy",
"structsolve",
"composites >= 0.5.4",
]
#Trove classifiers
CLASSIFIERS = """\
Development Status :: 6 - Mature
Intended Audience :: Education
Intended Audience :: Science/Research
Intended Audience :: Developers
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Mathematics
Topic :: Education
Topic :: Software Development
Topic :: Software Development :: Libraries :: Python Modules
Operating System :: Microsoft :: Windows
Operating System :: Unix
Operating System :: POSIX :: BSD
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: 3.11
Programming Language :: Python :: 3.12
License :: OSI Approved :: BSD License
"""
fullversion = write_version_py(version, is_released)
data_files = [('', [
'README.md',
'LICENSE',
])]
s = setup(
name = "tudaesasII",
version = fullversion,
author = "Saullo G. P. Castro, Jurij Sodja",
author_email = "[email protected], [email protected]",
description = ("Python module related to the Master's course SASII at the faculty of Aeropsace Engineering, TU Delft"),
license = "3-Clause BSD",
keywords = "structural analysis vibration dynamics finite elements",
url = "https://github.com/saullocastro/tudaesasII",
packages=find_packages(),
data_files=data_files,
long_description=read('README.md'),
classifiers=[_f for _f in CLASSIFIERS.split('\n') if _f],
install_requires=install_requires,
include_package_data=True,
)