Skip to content

Commit 22aa1d7

Browse files
committed
Defer papermill import in order not to add it to base requirements
Signed-off-by: Pedro Algarvio <[email protected]>
1 parent f740d6b commit 22aa1d7

File tree

5 files changed

+6
-4
lines changed

5 files changed

+6
-4
lines changed

changelog/68.improvement.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Several improvements to the project
22

33
* The `salt-analytics.examples` package now uses the same version as `salt-analytics-framework`
4-
* Defer imports of uncommon usage libraries to reduce base requirements
4+
* Defer imports of uncommon usage libraries to reduce base requirements(for example, keras, numpy, papermill)

requirements/jupyter.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
papermill

requirements/tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
-r base.txt
2+
-r jupyter.txt
23
pytest>=6.0.0
34
pytest-salt-factories==1.0.0rc21
45
pytest-asyncio
5-
papermill

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ extras_require =
7474
docsauto = requirements/docs-auto.txt
7575
changelog = requirements/changelog.txt
7676
build = requirements/build.txt
77+
jupyter = requirements/jupyter.txt
7778

7879

7980
[bdist_wheel]

src/saf/process/jupyter_notebook.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
from typing import Optional
1515
from typing import Type
1616

17-
import papermill
18-
1917
from saf.models import CollectedEvent
2018
from saf.models import PipelineRunContext
2119
from saf.models import ProcessConfigBase
@@ -51,6 +49,8 @@ async def process(
5149
"""
5250
Run the jupyter notebook, doing papermill parameterizing using the event data given.
5351
"""
52+
import papermill
53+
5454
output = ctx.config.output_notebook or ctx.config.notebook
5555
params = ctx.config.params.copy()
5656
for key in ctx.config.input_keys:

0 commit comments

Comments
 (0)