-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove inkscape package from the minimal-notebook (#1765)
* Removing inkscape * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Adding Rprofile to add plot_mimetypes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update datascience-notebook/Dockerfile Co-authored-by: Ayaz Salikhov <[email protected]> * Update datascience-notebook/Rprofile.site Co-authored-by: Ayaz Salikhov <[email protected]> * Adding R notebook tests * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Moving Rprofile.site to minimal; Removing duplicate R test code * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fixing flake8 errors * Update minimal-notebook/Dockerfile Co-authored-by: Ayaz Salikhov <[email protected]> * Update minimal-notebook/Rprofile.site Co-authored-by: Ayaz Salikhov <[email protected]> * Removing empty line * Renaming minetypes to mimetypes * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Renaming test module to avoid mypy error * Adding to jupyter.plot_mimetypes * Update R_mimetype_check.py * Update test_mimetypes.py * Update test_R_mimetypes.py * Update test_R_mimetypes.py Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ayaz Salikhov <[email protected]>
- Loading branch information
1 parent
0d65a32
commit 0fd68f0
Showing
7 changed files
with
51 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Add R mimetype to specify how the plot returns from R to the browser. | ||
# https://notebook.community/andrie/jupyter-notebook-samples/Changing%20R%20plot%20options%20in%20Jupyter | ||
|
||
options(jupyter.plot_mimetypes = c('text/plain', 'image/png', 'image/jpeg', 'image/svg+xml', 'application/pdf')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
import logging | ||
|
||
from tests.conftest import TrackedContainer | ||
|
||
LOGGER = logging.getLogger(__name__) | ||
|
||
|
||
def check_r_mimetypes(container: TrackedContainer) -> None: | ||
"""Check if Rscript command can be executed""" | ||
LOGGER.info("Test that R command can be executed ...") | ||
Rcommand = 'if (length(getOption("jupyter.plot_mimetypes")) != 5) {stop("missing jupyter.plot_mimetypes")}' | ||
logs = container.run_and_wait( | ||
timeout=10, | ||
tty=True, | ||
command=["Rscript", "-e", Rcommand], | ||
) | ||
LOGGER.debug(f"{logs=}") | ||
assert len(logs) == 0, f"Command {Rcommand=} failed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
from tests.conftest import TrackedContainer | ||
from tests.R_mimetype_check import check_r_mimetypes | ||
|
||
|
||
def test_mimetypes(container: TrackedContainer) -> None: | ||
"""Check if Rscript command for mimetypes can be executed""" | ||
check_r_mimetypes(container) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
from tests.conftest import TrackedContainer | ||
from tests.R_mimetype_check import check_r_mimetypes | ||
|
||
|
||
def test_mimetypes(container: TrackedContainer) -> None: | ||
"""Check if Rscript command for mimetypes can be executed""" | ||
check_r_mimetypes(container) |