-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
147 lines (129 loc) · 4.35 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
137
138
139
140
141
142
143
144
145
146
147
# MagellanMapper setup script
# Author: David Young, 2017, 2023
import setuptools
# optional dependencies to import files via BioFormats, which req Java 8+
_EXTRAS_IMPORT = [
# Javabridge pre-built on Java 8
"javabridge==1.0.19.post4+gbebed64 ; python_version < '3.8'",
"javabridge==1.0.19.post9+gc8c12b4 ; python_version >= '3.8'",
# Python-Bioformats built to depend on the vanilla (non-forked) Javabridge
"python-bioformats==4.0.5.post2+g51eb88a ; python_version < '3.8'",
"python-bioformats==4.0.7.post5+g52309d1 ; python_version >= '3.8'",
]
# optional dependencies for Pandas
_EXTRAS_PANDAS = [
"openpyxl", # export to Excel files
"jinja2", # style output
]
# optional dependencies for AWS interaction
_EXTRAS_AWS = ["boto3", "awscli"]
# optional dependencies to build API documentation
_EXTRAS_DOCS = [
"sphinx",
"sphinx-autodoc-typehints",
"myst-parser",
"furo", # theme
]
# optional dependencies for Jupyter notebooks
_EXTRAS_JUPYTER = ["jupyterlab", "bash_kernel"]
# optional dependencies for classification
_EXTRAS_CLASSIFER = ["tensorflow"]
# optional dependencies for main GUI; note that this group is not necessary
# for the Matplotlib-based viewers (eg ROI Editor, Atlas Editor)
_EXTRAS_GUI = [
# backend error with 5.15.8
"PyQt5 != 5.15.8",
"pyface",
"traitsui",
]
#: Optional dependencies for the 3D viewer.
_EXTRAS_3D = [
"mayavi",
# WORKAROUND: error in VTK 9.3.0 with Mayavi 4.8.1
"vtk < 9.3.0",
]
#: Optional pre-built SimpleITK with Elastix for image I/O and registration.
_EXTRAS_SIMPLEITK = [
"simpleitk==2.0.2rc2.dev785+g8ac4f ; python_version < '3.8'",
"simpleitk==2.3.0.dev117+g0640d ; python_version >= '3.8'",
]
#: Optional ITK and Elastix for image I/O and registration.
#: `itk` not included since it does not load properly when installed with rest
#: of dependencies. `itk-elastix` also installs a later `itk` version.
_EXTRAS_ITK = [
"itk-elastix",
]
# installation configuration
config = {
"name": "magellanmapper",
"description": "3D atlas analysis and annotation",
"long_description": open("README.md").read(),
"long_description_content_type": "text/markdown",
"author": "David Young",
"url": "https://github.com/sanderslab/magellanmapper",
"author_email": "[email protected]",
"license": "BSD-3",
"version": "1.6b5",
"packages": setuptools.find_packages(),
"scripts": [],
"python_requires": ">=3.6",
"entry_points": {
# gui_scripts doesn't load because of TraitsUI issue #1032
"console_scripts": ["mm = magmap.io.load_env:launch_magmap"],
},
"install_requires": [
"scikit-image",
# PlotEditor performance regression with 3.3.0-3.3.1
"matplotlib != 3.3.0, != 3.3.1",
"pandas",
"PyYAML",
"appdirs",
# part of stdlib in Python >= 3.8
"importlib-metadata >= 1.0 ; python_version < '3.8'",
"tifffile",
# required with tifffile >= 2022.7.28
"imagecodecs",
# part of stdlib in Python >= 3.7
"dataclasses ; python_version < '3.7'",
"brainglobe-atlasapi ; python_version >= '3.9'",
"bg-atlasapi ; python_version < '3.9'",
"typing_extensions",
],
"extras_require": {
"import": _EXTRAS_IMPORT,
"aws": _EXTRAS_AWS,
"pandas_plus": _EXTRAS_PANDAS,
"docs": _EXTRAS_DOCS,
"jupyter": _EXTRAS_JUPYTER,
"classifier": _EXTRAS_CLASSIFER,
"gui": _EXTRAS_GUI,
"3d": _EXTRAS_3D,
"itk": _EXTRAS_ITK,
"simplitk": _EXTRAS_SIMPLEITK,
# dependencies for most common tasks
"most": [
"matplotlib_scalebar",
"pyamg", # for Random-Walker segmentation "cg_mg" mode
*_EXTRAS_GUI,
*_EXTRAS_ITK,
*_EXTRAS_IMPORT,
],
# (almost) all optional dependencies
"all": [
"matplotlib_scalebar",
"pyamg", # for Random-Walker segmentation "cg_mg" mode
"seaborn", # for Seaborn-based plots
"scikit-learn",
*_EXTRAS_GUI,
*_EXTRAS_PANDAS,
*_EXTRAS_ITK,
*_EXTRAS_IMPORT,
*_EXTRAS_AWS,
*_EXTRAS_JUPYTER,
*_EXTRAS_3D,
]
},
}
if __name__ == "__main__":
# perform setup
setuptools.setup(**config)