-
Notifications
You must be signed in to change notification settings - Fork 24
/
extras.py
57 lines (46 loc) · 1.76 KB
/
extras.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
"""
This file defines the ``extras_require`` argument used in setup.py -- i.e., the
set of available Bionic subpackages (like bionic[standard] or bionic[gcp]).
It's in its own file because Bionic uses the information here when importing
optional dependencies.
"""
from collections import OrderedDict
def combine(*dep_lists):
"""Combines multiple lists into a single sorted list of distinct items."""
return list(sorted(set(dep for dep_list in dep_lists for dep in dep_list)))
# Construct the mapping from "extra name" to package descriptor.
# We use an OrderedDict because the optdep module will want to know which
# extras were added first.
extras = OrderedDict()
extras["image"] = ["Pillow"]
# We don't support versions of matplotlib below 3.1 because the default backend has
# problems on OS X; and we don't support 3.2.x because of this bug:
# https://github.com/matplotlib/matplotlib/issues/15410
extras["matplotlib"] = combine(["matplotlib>=3.1,!=3.2.*"], extras["image"])
extras["viz"] = combine(["hsluv", "networkx", "pydot"], extras["image"])
extras["standard"] = combine(extras["matplotlib"], extras["viz"])
extras["dill"] = ["dill"]
extras["dask"] = ["dask[dataframe]"]
extras["gcp"] = ["google-cloud-storage"]
extras["parallel"] = ["cloudpickle", "loky"]
extras["geopandas"] = ["geopandas"]
extras["examples"] = combine(extras["standard"], ["scikit-learn"])
extras["full"] = combine(*extras.values())
extras["dev"] = combine(
[
"pytest",
"black",
"flake8",
"flake8-print",
"flake8-fixme",
"sphinx!=3.2.0",
"sphinx_rtd_theme",
"sphinx-autobuild",
"nbsphinx",
"jupyter",
"bumpversion",
],
*extras.values()
)
# This will be imported by setup.py.
extras_require = extras