about summary refs log tree commit diff
path: root/pkgs/development/python-modules/ipykernel
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/ipykernel')
-rw-r--r--pkgs/development/python-modules/ipykernel/default.nix53
-rw-r--r--pkgs/development/python-modules/ipykernel/tests.nix79
2 files changed, 70 insertions, 62 deletions
diff --git a/pkgs/development/python-modules/ipykernel/default.nix b/pkgs/development/python-modules/ipykernel/default.nix
index 394974103537c..3ef98a9a8eb8e 100644
--- a/pkgs/development/python-modules/ipykernel/default.nix
+++ b/pkgs/development/python-modules/ipykernel/default.nix
@@ -1,23 +1,27 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, callPackage
-, fetchPypi
-, hatchling
-, pythonOlder
-, appnope
-, comm
-, debugpy
-, ipython
-, jupyter-client
-, jupyter-core
-, matplotlib-inline
-, nest-asyncio
-, packaging
-, psutil
-, pyzmq
-, tornado
-, traitlets
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  callPackage,
+  fetchPypi,
+  hatchling,
+  pythonOlder,
+  appnope,
+  comm,
+  debugpy,
+  ipython,
+  jupyter-client,
+  jupyter-core,
+  matplotlib-inline,
+  nest-asyncio,
+  packaging,
+  psutil,
+  pyzmq,
+  tornado,
+  traitlets,
+
+  # Reverse dependency
+  sage,
 }:
 
 buildPythonPackage rec {
@@ -37,9 +41,7 @@ buildPythonPackage rec {
     sed -i "/debugpy/d" pyproject.toml
   '';
 
-  nativeBuildInputs = [
-    hatchling
-  ];
+  nativeBuildInputs = [ hatchling ];
 
   propagatedBuildInputs = [
     comm
@@ -54,15 +56,14 @@ buildPythonPackage rec {
     pyzmq
     tornado
     traitlets
-  ] ++ lib.optionals stdenv.isDarwin [
-    appnope
-  ];
+  ] ++ lib.optionals stdenv.isDarwin [ appnope ];
 
   # check in passthru.tests.pytest to escape infinite recursion with ipyparallel
   doCheck = false;
 
   passthru.tests = {
     pytest = callPackage ./tests.nix { };
+    inherit sage;
   };
 
   meta = {
diff --git a/pkgs/development/python-modules/ipykernel/tests.nix b/pkgs/development/python-modules/ipykernel/tests.nix
index 0de6d2feb4aef..4d96d4c6787db 100644
--- a/pkgs/development/python-modules/ipykernel/tests.nix
+++ b/pkgs/development/python-modules/ipykernel/tests.nix
@@ -1,14 +1,15 @@
-{ lib
-, stdenv
-, buildPythonPackage
-, pythonOlder
-, flaky
-, ipykernel
-, ipyparallel
-, pre-commit
-, pytestCheckHook
-, pytest-asyncio
-, pytest-timeout
+{
+  lib,
+  stdenv,
+  buildPythonPackage,
+  pythonOlder,
+  flaky,
+  ipykernel,
+  ipyparallel,
+  pre-commit,
+  pytestCheckHook,
+  pytest-asyncio,
+  pytest-timeout,
 }:
 
 buildPythonPackage {
@@ -33,35 +34,41 @@ buildPythonPackage {
     export HOME=$(mktemp -d)
   '';
 
-  disabledTests = [ # The follwing three tests fail for unclear reasons.
-    # pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-8
-    "test_asyncio_interrupt"
+  disabledTests =
+    [
+      # The follwing three tests fail for unclear reasons.
+      # pytest.PytestUnhandledThreadExceptionWarning: Exception in thread Thread-8
+      "test_asyncio_interrupt"
 
-    # DeprecationWarning: Passing unrecognized arguments to super(IPythonKernel)
-    "test_embed_kernel_func"
+      # DeprecationWarning: Passing unrecognized arguments to super(IPythonKernel)
+      "test_embed_kernel_func"
 
-    # traitlets.config.configurable.MultipleInstanceError: An incompatible siblin...
-    "test_install_kernelspec"
-  ] ++ lib.optionals stdenv.isDarwin ([
-    # see https://github.com/NixOS/nixpkgs/issues/76197
-    "test_subprocess_print"
-    "test_subprocess_error"
-    "test_ipython_start_kernel_no_userns"
+      # traitlets.config.configurable.MultipleInstanceError: An incompatible siblin...
+      "test_install_kernelspec"
+    ]
+    ++ lib.optionals stdenv.isDarwin (
+      [
+        # see https://github.com/NixOS/nixpkgs/issues/76197
+        "test_subprocess_print"
+        "test_subprocess_error"
+        "test_ipython_start_kernel_no_userns"
 
-    # https://github.com/ipython/ipykernel/issues/506
-    "test_unc_paths"
-  ] ++ lib.optionals (pythonOlder "3.8") [
-    # flaky test https://github.com/ipython/ipykernel/issues/485
-    "test_shutdown"
+        # https://github.com/ipython/ipykernel/issues/506
+        "test_unc_paths"
+      ]
+      ++ lib.optionals (pythonOlder "3.8") [
+        # flaky test https://github.com/ipython/ipykernel/issues/485
+        "test_shutdown"
 
-    # test regression https://github.com/ipython/ipykernel/issues/486
-    "test_sys_path_profile_dir"
-    "test_save_history"
-    "test_help_output"
-    "test_write_kernel_spec"
-    "test_ipython_start_kernel_userns"
-    "ZMQDisplayPublisherTests"
-  ]);
+        # test regression https://github.com/ipython/ipykernel/issues/486
+        "test_sys_path_profile_dir"
+        "test_save_history"
+        "test_help_output"
+        "test_write_kernel_spec"
+        "test_ipython_start_kernel_userns"
+        "ZMQDisplayPublisherTests"
+      ]
+    );
 
   # Some of the tests use localhost networking.
   __darwinAllowLocalNetworking = true;