forked from pyxem/kikuchipy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
178 lines (171 loc) · 6 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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# Copyright 2019-2023 The kikuchipy developers
#
# This file is part of kikuchipy.
#
# kikuchipy is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# kikuchipy is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with kikuchipy. If not, see <http://www.gnu.org/licenses/>.
from itertools import chain
from setuptools import setup, find_packages
# Get release information without importing anything from the project
with open("kikuchipy/release.py") as fid:
for line in fid:
if line.startswith("author"):
AUTHOR = line.strip().split(" = ")[-1][1:-1]
elif line.startswith("maintainer_email"): # Must be before 'maintainer'
MAINTAINER_EMAIL = line.strip(" = ").split()[-1][1:-1]
elif line.startswith("maintainer"):
MAINTAINER = line.strip().split(" = ")[-1][1:-1]
elif line.startswith("name"):
NAME = line.strip().split()[-1][1:-1]
elif line.startswith("version"):
VERSION = line.strip().split(" = ")[-1][1:-1]
elif line.startswith("license"):
LICENSE = line.strip().split(" = ")[-1][1:-1]
elif line.startswith("platforms"):
PLATFORMS = line.strip().split(" = ")[-1][1:-1]
# Projects with optional features for building the documentation and running
# tests. From setuptools:
# https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies
# fmt: off
extra_feature_requirements = {
"doc": [
"memory_profiler",
"nbsphinx >= 0.7",
"numpydoc",
"nlopt",
"panel", # Used in the docs by PyVista
"pydata-sphinx-theme",
"pyebsdindex >= 0.1.1",
"pyvista",
"sphinx >= 3.0.2",
"sphinx-codeautolink[ipython] < 0.14",
"sphinx-copybutton >= 0.2.5",
"sphinx-design",
"sphinx-gallery",
"sphinxcontrib-bibtex >= 1.0",
],
"tests": [
"coverage >= 5.0",
"numpydoc",
"pytest >= 5.4",
"pytest-benchmark",
"pytest-cov >= 2.8.1",
"pytest-xdist",
],
"all": [
"matplotlib >= 3.5",
"nlopt",
"pyebsdindex ~= 0.1",
"pyvista",
],
# TODO: Remove this option in release 0.9
"viz": [
"matplotlib >= 3.5",
"pyvista",
],
}
# fmt: on
# Create a development project including all extra dependencies
extra_feature_requirements["dev"] = [
"black[jupyter] >= 23.1",
"manifix",
"outdated",
"pre-commit >= 1.16",
] + list(chain(*list(extra_feature_requirements.values())))
setup(
# Package description
name=NAME,
version=VERSION,
license=LICENSE,
url="https://kikuchipy.org",
python_requires=">=3.7",
description=(
"Processing and analysis of electron backscatter diffraction (EBSD) "
"patterns."
),
long_description=open("README.md", encoding="utf-8").read(),
long_description_content_type="text/markdown",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
(
"License :: OSI Approved :: GNU General Public License v3 or later "
"(GPLv3+)"
),
"Natural Language :: English",
"Operating System :: OS Independent",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Physics",
],
platforms=PLATFORMS,
keywords=[
"EBSD",
"electron backscatter diffraction",
"EBSP",
"electron backscatter pattern",
"BKD",
"backscatter kikuchi diffraction",
"SEM",
"scanning electron microscopy",
"kikuchi pattern",
"dictionary indexing",
],
zip_safe=True,
# Contact
author=AUTHOR,
author_email=MAINTAINER_EMAIL,
download_url="https://pypi.python.org/pypi/kikuchipy",
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
project_urls={
"Bug Tracker": "https://github.com/pyxem/kikuchipy/issues",
"Documentation": "https://kikuchipy.org",
"Source Code": "https://github.com/pyxem/kikuchipy",
},
# Dependencies
extras_require=extra_feature_requirements,
# fmt: off
install_requires=[
"dask[array] >= 2021.8.1",
"diffpy.structure >= 3",
"diffsims >= 0.5",
"hyperspy >= 1.7.3",
"h5py >= 2.10",
"imageio",
"matplotlib >= 3.3",
"numba >= 0.55",
"numpy >= 1.19",
"orix >= 0.11.1",
"pooch >= 0.13",
"pyyaml",
"tqdm >= 0.5.2",
"scikit-image >= 0.16.2",
"scikit-learn",
"scipy >= 1.7",
],
# fmt: on
entry_points={"hyperspy.extensions": "kikuchipy = kikuchipy"},
# Files to include when distributing package
packages=find_packages(),
package_dir={"kikuchipy": "kikuchipy"},
include_package_data=True,
package_data={
"": ["LICENSE", "README.md"],
"kikuchipy": ["*.py", "hyperspy_extension.yaml", "data/*"],
},
)