-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
134 lines (106 loc) · 3.88 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : setup.py
# License: GNU v3.0
# Author : Andrei Leonard Nicusan <[email protected]>
# Date : 03.09.2020
import os
import sys
import shutil
import setuptools
with open("README.md", "r") as f:
long_description = f.read()
def requirements(filename):
# The dependencies are the same as the contents of requirements.txt
with open(filename) as f:
return [line.strip() for line in f if line.strip()]
# What packages are required for this module to be executed?
required = requirements("requirements.txt")
extras = {
"docs": requirements("requirements_extra.txt")
}
# Load the package's __version__.py module as a dictionary.
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(os.path.join(here, "medeq", "__version__.py")) as f:
exec(f.read(), about)
class UploadCommand(setuptools.Command):
"""Support setup.py upload."""
description = 'Build and publish the package.'
user_options = []
@staticmethod
def status(s):
"""Prints things in bold."""
print(f'\033[1m{s}\033[0m')
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
try:
self.status('Removing previous builds…')
shutil.rmtree(os.path.join(here, 'dist'))
except OSError:
pass
self.status('Building Source and Wheel (universal) distribution…')
os.system(f'{sys.executable} setup.py sdist bdist_wheel --universal')
self.status('Uploading the package to PyPI via Twine…')
os.system('twine upload dist/*')
self.status('Pushing git tags…')
os.system(f'git tag v{about["__version__"]}')
os.system('git push --tags')
sys.exit()
setuptools.setup(
name = "medeq",
version = about["__version__"],
author = (
"Andrei Leonard Nicusan <[email protected]>"
),
keywords = (
"equation model discovery symbolic regression monte-carlo simulation "
"experiment sampling physics-simulation computational-fluid-dynamics "
"granular DEM discrete-element-method medical-imaging"
),
description = (
"Autonomously driving equation discovery, from the micro to the "
"macro, from laptops to supercomputers."
),
long_description = long_description,
long_description_content_type = "text/markdown",
url = "https://github.com/uob-positron-imaging-centre/MED",
install_requires = required,
extras_require = extras,
include_package_data = True,
packages = setuptools.find_packages(),
license = 'GNU',
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Intended Audience :: Healthcare Industry",
"Intended Audience :: Manufacturing",
"License :: OSI Approved :: GNU General Public License v3 or later " +
"(GPLv3+)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Education",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Artificial Life",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: System :: Distributed Computing",
"Topic :: System :: Clustering",
],
python_requires = '>=3.6',
# $ setup.py publish support.
cmdclass = {
'upload': UploadCommand,
},
)