Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jupyter extensions: make sure to run tests (as much as possible) #244492

Merged
merged 6 commits into from
Aug 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
, fetchFromGitHub
, jupyter-core
, notebook
, pytestCheckHook
}:

buildPythonPackage rec {
Expand All @@ -21,6 +22,13 @@ buildPythonPackage rec {
notebook
];

nativeCheckInputs = [ pytestCheckHook ];

disabledTestPaths = [
# This test fails upstream too
"tests/test_application.py"
];

pythonImportsCheck = [ "jupyter_contrib_core" ];

meta = with lib; {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
, jupyter-highlight-selected-word
, jupyter-nbextensions-configurator
, lxml
, nose
, pytestCheckHook
, notebook
}:

buildPythonPackage rec {
Expand All @@ -27,12 +30,28 @@ buildPythonPackage rec {
lxml
];

nativeCheckInputs = [
nose
pytestCheckHook
];

disabledTestPaths = [
# Thoses tests fail upstream because of nbconvert being too recent
# https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1606
"tests/test_exporters.py"

# Requires to run jupyter which is not feasible here
"tests/test_application.py"
];

pythonImportsCheck = [ "jupyter_contrib_nbextensions" ];

meta = with lib; {
natsukium marked this conversation as resolved.
Show resolved Hide resolved
description = "A collection of various notebook extensions for Jupyter";
homepage = "https://github.com/ipython-contrib/jupyter_contrib_nbextensions";
license = licenses.bsd3;
maintainers = with maintainers; [ GaetanLepage ];
# https://github.com/ipython-contrib/jupyter_contrib_nbextensions/issues/1647
broken = versionAtLeast notebook.version "7";
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ buildPythonPackage rec {
hash = "sha256-KgM//SIfES46uZySwNR4ZOcolnJORltvThsmEvxXoIs=";
};

# This package does not have tests
doChecks = false;

pythonImportsCheck = [ "jupyter_highlight_selected_word" ];

meta = with lib; {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
, notebook
, pyyaml
, tornado
, nose
, pytestCheckHook
, selenium
}:

buildPythonPackage rec {
Expand Down Expand Up @@ -39,6 +42,19 @@ buildPythonPackage rec {
tornado
];

nativeCheckInputs = [
nose
pytestCheckHook
selenium
];

# Those tests fails upstream
disabledTestPaths = [
"tests/test_application.py"
"tests/test_jupyterhub.py"
"tests/test_nbextensions_configurator.py"
GaetanLepage marked this conversation as resolved.
Show resolved Hide resolved
];

pythonImportsCheck = [ "jupyter_nbextensions_configurator" ];

meta = with lib; {
Expand Down
29 changes: 15 additions & 14 deletions pkgs/development/python-modules/nbconvert/default.nix
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
{ beautifulsoup4
, bleach
{ lib
, fetchurl
, buildPythonPackage
, defusedxml
, pythonOlder
, fetchPypi
, fetchpatch
, fetchurl
, hatchling
, importlib-metadata
, ipywidgets
, beautifulsoup4
, bleach
, defusedxml
, jinja2
, jupyter-core
, jupyterlab-pygments
, lib
, markupsafe
, mistune
, nbclient
, packaging
, pandocfilters
, pygments
, pyppeteer
, pytestCheckHook
, pythonOlder
, tinycss2
, traitlets
, importlib-metadata
, flaky
, ipywidgets
, pyppeteer
, pytestCheckHook
}:

let
Expand All @@ -33,15 +33,15 @@ let
};
in buildPythonPackage rec {
pname = "nbconvert";
version = "7.2.5";
version = "7.7.3";

disabled = pythonOlder "3.7";
disabled = pythonOlder "3.8";

format = "pyproject";

src = fetchPypi {
inherit pname version;
hash = "sha256-j9xE/X2UJNt/3G4eg0oC9rhiD/tlN2c4i+L56xb4QYQ=";
hash = "sha256-SlmWv1880WqgQxiXuhqkxkhCwgefQ0s9xrjEslLvM1U=";
};

# Add $out/share/jupyter to the list of paths that are used to search for
Expand Down Expand Up @@ -85,6 +85,7 @@ in buildPythonPackage rec {
'';

nativeCheckInputs = [
flaky
ipywidgets
pyppeteer
pytestCheckHook
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/python-modules/notebook/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

buildPythonPackage rec {
pname = "notebook";
version = "7.0.1";
version = "7.0.2";
disabled = pythonOlder "3.8";

format = "pyproject";

src = fetchPypi {
inherit pname version;
hash = "sha256-LhatTmPqiffvviEu58FpP8+lq1X/73UEdTD3SvS9kmw=";
hash = "sha256-1w1qB0GMgpvV9UM3zpk7cQUmHZAm+dP+aOm4qhog2po=";
};

postPatch = ''
Expand Down