forked from pyxem/kikuchipy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
132 lines (127 loc) · 4.42 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
# -*- coding: utf-8 -*-
# Copyright 2019-2020 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
extra_feature_requirements = {
"doc": [
"sphinx >= 2.3.1",
"sphinx-rtd-theme >= 0.4.3",
"sphinx-copybutton >= 0.2.5",
],
"tests": [
"pytest >= 5.3.2",
"pytest-cov >= 2.8.1",
"coverage == 4.5.4", # 5.0 have some issues with reporting to Coveralls
],
}
# Create a development project, including both the doc and tests projects
extra_feature_requirements["dev"] = [
"black >= 19.3b0",
"pre-commit >= 1.16",
] + list(chain(*list(extra_feature_requirements.values())))
setup(
# Package description
name=NAME,
version=VERSION,
license=LICENSE,
url="https://kikuchipy.readthedocs.io",
python_requires=">=3.7",
description=(
"Processing of electron backscatter diffraction (EBSD) patterns"
),
long_description=open("README.rst").read(),
long_description_content_type="text/x-rst",
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (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",
],
zip_safe=True,
# Contact
author=AUTHOR,
author_email=MAINTAINER_EMAIL,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
# Dependencies
extras_require=extra_feature_requirements,
install_requires=[
"dask[array]",
"hyperspy >= 1.5.2",
"h5py",
"matplotlib",
"numpy >= 1.17",
"pyxem >= 0.10",
"scikit-image",
"scikit-learn",
"scipy",
],
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.rst",
"pyproject.toml",
"pytest.ini",
"readthedocs.yml",
"setup.py",
],
"kikuchipy": ["*.py", "hyperspy_extension.yaml", "data/*"],
},
)