-
Notifications
You must be signed in to change notification settings - Fork 7
/
setup.py
136 lines (120 loc) · 5.75 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
136
from itertools import chain
from pathlib import Path
import setuptools
from pymchelper.version import git_version
def write_version_py():
"""
Generate a file with a version number obtained from git (i.e. name of last tag + additional info)
It uses a dedicated function called `git_version` which sits in the `version` module.
This autogenerated file will be later included in the package (which will be uploaded to pip server).
"""
cnt = """%(version)s
"""
GIT_REVISION = git_version()
with open(Path('pymchelper', 'VERSION'), 'w') as f:
f.write(cnt % {'version': GIT_REVISION})
# automatically generate VERSION file upon import or execution of this (setup.py) script
write_version_py()
# extract readme text from the markdown file
with open('README.md') as readme_file:
readme = readme_file.read()
# extras_require will be used in two scenarios:
# - installation of pymchelper with all feature via pip using `pip install "pymchelper[full]"`
# - installation of requirements.txt when working with cloned source code: `pip install -r requirements.txt`
EXTRAS_REQUIRE = {
'image': ['matplotlib'],
'excel': ['xlwt'],
'hdf': ['h5py'],
'dicom': ["pydicom"],
'pytrip': [
'scipy',
"pytrip98>=3.8.0,<3.9.0 ; platform_system == 'Darwin' and python_version >= '3.11'",
"pytrip98>=3.6.1,<3.9.0 ; platform_system == 'Darwin' and (python_version >= '3.10' and python_version < '3.11')", # noqa: E501
"pytrip98<3.9.0 ; platform_system == 'Darwin' and (python_version >= '3.5' and python_version < '3.10')",
"pytrip98>=3.9.1 ; python_version >= '3.12'",
"pytrip98>=3.8.0 ; python_version >= '3.11' and python_version < '3.12'",
"pytrip98>=3.6.1 ; python_version >= '3.10' and python_version < '3.11'",
"pytrip98 ; python_version >= '3.5' and python_version < '3.10'"
]
}
# inspired by https://github.com/pyimgui/pyimgui/blob/master/setup.py
# construct special 'full' extra that adds requirements for all built-in
# backend integrations and additional extra features.
EXTRAS_REQUIRE['full'] = list(set(chain(*EXTRAS_REQUIRE.values())))
EXTRAS_REQUIRE['full'].extend(["hipsterplot", "bashplotlib"]) # these are needed by verbose inspect tool
# here is table with corresponding numpy versions, and supported python and OS versions
# it is based on inspection of https://pypi.org/project/numpy/
# |---------------------------------------------------|
# | numpy version | python versions | OS support |
# |---------------------------------------------------|
# | 1.26 | 3.9 - 3.12 | linux, mac, win |
# | 1.25 | 3.9 - 3.11 | linux, mac, win |
# | 1.24 | 3.8 - 3.11 | linux, mac, win |
# | 1.23.3 | 3.8 - 3.11 | linux, mac, win |
# | 1.22 - 1.23.2 | 3.8 - 3.10 | linux, mac, win |
# | 1.21 | 3.7 - 3.10 | linux, mac, win |
# | 1.20 | 3.7 - 3.9 | linux, mac, win |
# | 1.19 | 3.6 - 3.8 | linux, mac, win |
# | 1.18 | 3.5 - 3.8 | linux, mac, win |
# | 1.17 | 3.5 - 3.7 | linux, mac, win |
# | 1.16 | 2.7, 3.5 - 3.7 | linux, mac, win |
# | 1.15 | 2.7, 3.4 - 3.7 | linux, mac, win |
# | 1.14 | 2.7, 3.4 - 3.6 | linux, mac, win |
# | 1.13 | 2.7, 3.4 - 3.6 | linux, mac, win |
# | 1.12 | 2.7, 3.4 - 3.6 | linux, mac, win |
# | 1.11 | 2.7, 3.4 - 3.5 | linux, mac, win |
# | 1.10 | 2.7, 3.3 - 3.5 | linux |
# | 1.9 | 2.7, 3.3 - 3.5 | linux |
# |---------------------------------------------------|
# see https://www.python.org/dev/peps/pep-0508/ for language specification
install_requires = [
"numpy>=1.26 ; python_version == '3.12'",
"numpy>=1.23.3 ; python_version == '3.11'",
"numpy>=1.21 ; python_version == '3.10'",
"numpy>=1.20,<1.27.0 ; python_version == '3.9'"
]
setuptools.setup(
name='pymchelper',
version=git_version(),
packages=setuptools.find_packages(where='.', exclude=("tests", "tests.*", "examples")),
url='https://github.com/DataMedSci/pymchelper',
license='MIT',
author='pymchelper team',
author_email='leszek.grzanka@gmail.com',
description='Python toolkit for SHIELD-HIT12A and FLUKA',
long_description=readme + '\n',
long_description_content_type='text/markdown',
classifiers=[
# How mature is this project? Common values are
'Development Status :: 5 - Production/Stable',
# Indicate who your project is intended for
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Scientific/Engineering :: Physics',
# OS and env
'Environment :: Console',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows',
# Pick your license as you wish (should match "license" above)
'License :: OSI Approved :: MIT License',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
],
entry_points={
'console_scripts': [
'convertmc=pymchelper.run:main',
'runmc=pymchelper.utils.runmc:main',
'mcscripter=pymchelper.utils.mcscripter:main',
'plan2sobp=pymchelper.utils.radiotherapy.plan:main',
],
},
package_data={'pymchelper': ['flair/db/*', 'VERSION']},
install_requires=install_requires,
extras_require=EXTRAS_REQUIRE,
python_requires='>=3.9',
)