|
a |
|
b/setup.py |
|
|
1 |
#!/usr/bin/env python |
|
|
2 |
|
|
|
3 |
"""The setup script.""" |
|
|
4 |
|
|
|
5 |
from setuptools import find_packages, setup |
|
|
6 |
|
|
|
7 |
with open("README.md") as readme_file: |
|
|
8 |
readme = readme_file.read() |
|
|
9 |
|
|
|
10 |
with open("HISTORY.md") as history_file: |
|
|
11 |
history = history_file.read() |
|
|
12 |
|
|
|
13 |
requirements = [ |
|
|
14 |
"numpy", |
|
|
15 |
"zarr", # Includes numcodecs as a dependency |
|
|
16 |
] |
|
|
17 |
|
|
|
18 |
# Requirements which improve performance |
|
|
19 |
performance_requirements = ["opencv-python"] |
|
|
20 |
|
|
|
21 |
# Extra format support |
|
|
22 |
format_support = [ |
|
|
23 |
"tifffile", # For reading, writing and repackaging TIFF files |
|
|
24 |
"dask", # Reading and writing TIFF/Zarr with non-standard axis order |
|
|
25 |
"glymur", # For reading and writing JP2 files |
|
|
26 |
"xarray", |
|
|
27 |
] |
|
|
28 |
|
|
|
29 |
# Extra codecs support |
|
|
30 |
codec_requirements = ["imagecodecs", "qoi"] |
|
|
31 |
|
|
|
32 |
test_requirements = [ |
|
|
33 |
"pytest>=3", |
|
|
34 |
"opencv-python", |
|
|
35 |
"scipy", |
|
|
36 |
"scikit-image", |
|
|
37 |
] |
|
|
38 |
test_requirements += performance_requirements |
|
|
39 |
test_requirements += codec_requirements |
|
|
40 |
|
|
|
41 |
docs_requirements = [ |
|
|
42 |
"sphinx", |
|
|
43 |
"sphinx-autoapi", |
|
|
44 |
] |
|
|
45 |
|
|
|
46 |
alternative_requirements = [ |
|
|
47 |
"scipy", # Alternative to scikit-image, is a dependency of scikit-image |
|
|
48 |
"scikit-image", # Alternative to opencv-python for some operations |
|
|
49 |
] |
|
|
50 |
|
|
|
51 |
# Command-line interface requirements |
|
|
52 |
cli_requirements = ["Click>=7.0"] |
|
|
53 |
|
|
|
54 |
# User experience improving requirements |
|
|
55 |
ux_requirements = ["tqdm"] |
|
|
56 |
|
|
|
57 |
# All extra requirements |
|
|
58 |
all_extra_requirements = ( |
|
|
59 |
test_requirements |
|
|
60 |
+ docs_requirements |
|
|
61 |
+ format_support |
|
|
62 |
+ codec_requirements |
|
|
63 |
+ alternative_requirements |
|
|
64 |
+ cli_requirements |
|
|
65 |
+ ux_requirements |
|
|
66 |
) |
|
|
67 |
|
|
|
68 |
# Optional dependencies |
|
|
69 |
extra_requirements = { |
|
|
70 |
"all": all_extra_requirements, |
|
|
71 |
"test": test_requirements, |
|
|
72 |
"docs": docs_requirements, |
|
|
73 |
"cli": cli_requirements, |
|
|
74 |
"ux": ux_requirements, |
|
|
75 |
"performance": performance_requirements, |
|
|
76 |
"formats": format_support, |
|
|
77 |
"codecs": codec_requirements, |
|
|
78 |
"jpeg2000": ["glymur"], |
|
|
79 |
} |
|
|
80 |
|
|
|
81 |
setup( |
|
|
82 |
author="John Pocock", |
|
|
83 |
author_email="j.c.pocock@warwick.ac.uk", |
|
|
84 |
python_requires=">=3.8", |
|
|
85 |
classifiers=[ |
|
|
86 |
"Development Status :: 2 - Pre-Alpha", |
|
|
87 |
"Intended Audience :: Developers", |
|
|
88 |
"Natural Language :: English", |
|
|
89 |
"Programming Language :: Python :: 3", |
|
|
90 |
"Programming Language :: Python :: 3.8", |
|
|
91 |
"Programming Language :: Python :: 3.9", |
|
|
92 |
"Programming Language :: Python :: 3.10", |
|
|
93 |
], |
|
|
94 |
description="Whole Slide Image (WSI) conversion for brightfield histology images", |
|
|
95 |
entry_points={ |
|
|
96 |
"console_scripts": [ |
|
|
97 |
"wsic=wsic.cli:main", |
|
|
98 |
], |
|
|
99 |
}, |
|
|
100 |
install_requires=requirements, |
|
|
101 |
long_description=readme + "\n\n" + history, |
|
|
102 |
long_description_content_type="text/markdown", |
|
|
103 |
include_package_data=True, |
|
|
104 |
keywords="wsic", |
|
|
105 |
name="wsic", |
|
|
106 |
packages=find_packages(include=["wsic", "wsic.*"]), |
|
|
107 |
test_suite="tests", |
|
|
108 |
tests_require=test_requirements, |
|
|
109 |
extras_require=extra_requirements, |
|
|
110 |
url="https://github.com/john-p/wsic", |
|
|
111 |
version="0.9.0", |
|
|
112 |
zip_safe=False, |
|
|
113 |
) |