Skip to content

Commit e97d5c9

Browse files
authored
Merge pull request #1367 from JosepSampe/lithops-dev
[Setup] Move matplotlib, seaborn and pandas to 'plotting' extra
2 parents 874e8d6 + 76f65de commit e97d5c9

2 files changed

Lines changed: 34 additions & 23 deletions

File tree

lithops/executors.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,13 @@ def plot(
543543
logger.debug(f'ExecutorID {self.executor_id} - No futures ready to plot')
544544
return
545545

546-
logging.getLogger('matplotlib').setLevel(logging.WARNING)
547-
from lithops.plots import create_timeline, create_histogram
546+
try:
547+
logging.getLogger('matplotlib').setLevel(logging.WARNING)
548+
from lithops.plots import create_timeline, create_histogram
549+
except ImportError:
550+
raise ModuleNotFoundError(
551+
"Please install 'pip3 install lithops[plotting]' for "
552+
"making use of the plot() method")
548553

549554
logger.info(f'ExecutorID {self.executor_id} - Creating execution plots')
550555

@@ -628,8 +633,13 @@ def job_summary(self, cloud_objects_n: Optional[int] = 0):
628633
629634
:param cloud_objects_n: number of cloud object used in COS, declared by user.
630635
"""
631-
import pandas as pd
632-
import numpy as np
636+
try:
637+
import pandas as pd
638+
import numpy as np
639+
except ImportError:
640+
raise ModuleNotFoundError(
641+
"Please install 'pip3 install lithops[plotting]' for "
642+
"making use of the job_summary() method")
633643

634644
def init():
635645
headers = ['Job_ID', 'Function', 'Invocations', 'Memory(MB)', 'AvgRuntime', 'Cost', 'CloudObjects']

setup.py

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@
66
install_requires = [
77
'Click',
88
'tabulate',
9-
'pandas',
9+
'six',
1010
'PyYAML',
1111
'pika',
1212
'tqdm',
1313
'tblib',
1414
'requests',
15-
'seaborn',
1615
'paramiko',
17-
'matplotlib',
1816
'cloudpickle',
1917
'tblib',
2018
'ps-mem',
@@ -23,20 +21,22 @@
2321

2422

2523
extras_require = {
24+
'ibm': [
25+
'ibm-cos-sdk',
26+
'ibm-code-engine-sdk',
27+
'ibm-vpc',
28+
'kubernetes',
29+
],
30+
'aws': [
31+
'boto3'
32+
],
2633
'gcp': [
2734
'httplib2',
2835
'google-cloud-storage',
2936
'google-cloud-pubsub',
3037
'google-api-python-client',
3138
'google-auth'
3239
],
33-
'aliyun': [
34-
'aliyun-fc2',
35-
'oss2'
36-
],
37-
'aws': [
38-
'boto3'
39-
],
4040
'azure': [
4141
'azure-mgmt-resource',
4242
'azure-mgmt-compute',
@@ -45,15 +45,13 @@
4545
'azure-storage-blob',
4646
'azure-storage-queue'
4747
],
48+
'aliyun': [
49+
'aliyun-fc2',
50+
'oss2'
51+
],
4852
'ceph': [
4953
'boto3'
5054
],
51-
'ibm': [
52-
'ibm-cos-sdk',
53-
'ibm-code-engine-sdk',
54-
'ibm-vpc',
55-
'kubernetes',
56-
],
5755
'knative': [
5856
'kubernetes',
5957
],
@@ -75,6 +73,12 @@
7573
'diskcache',
7674
'numpy'
7775
],
76+
'plotting': [
77+
'pandas',
78+
'matplotlib',
79+
'seaborn',
80+
'numpy'
81+
],
7882
'oracle': [
7983
'oci',
8084
],
@@ -110,9 +114,6 @@
110114
'Operating System :: OS Independent',
111115
'Natural Language :: English',
112116
'License :: OSI Approved :: Apache Software License',
113-
'Programming Language :: Python :: 3',
114-
'Programming Language :: Python :: 3.6',
115-
'Programming Language :: Python :: 3.7',
116117
'Programming Language :: Python :: 3.8',
117118
'Programming Language :: Python :: 3.9',
118119
'Programming Language :: Python :: 3.10',

0 commit comments

Comments
 (0)