From d97e53aeb0b677964a0b34a5f70ddb4010da6466 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 5 Jan 2023 00:42:20 +0100 Subject: [PATCH] python3Packages.pytest-jupyter: init at 0.6.2 --- .../python-modules/pytest-jupyter/default.nix | 77 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 79 insertions(+) create mode 100644 pkgs/development/python-modules/pytest-jupyter/default.nix diff --git a/pkgs/development/python-modules/pytest-jupyter/default.nix b/pkgs/development/python-modules/pytest-jupyter/default.nix new file mode 100644 index 000000000000..39a9e7500e61 --- /dev/null +++ b/pkgs/development/python-modules/pytest-jupyter/default.nix @@ -0,0 +1,77 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub + +# build +, hatchling +, pytest + +# runtime +, jupyter-core + +# optionals +, jupyter-client +, ipykernel +, jupyter_server +, nbformat + +# tests +, pytest-timeout +, pytestCheckHook +}: + +let self = buildPythonPackage rec { + pname = "pytest-jupyter"; + version = "0.6.2"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "jupyter-server"; + repo = "pytest-jupyter"; + rev = "refs/tags/v${version}"; + hash = "sha256-kY4QHrlj0opEBywe4SpwE4Ck6l6JIzEosx6uuXh+yCQ="; + }; + + nativeBuildInputs = [ + hatchling + ]; + + buildInputs = [ + pytest + ]; + + propagatedBuildInputs = [ + jupyter-core + ]; + + passthru.optional-dependencies = rec { + client = [ + jupyter-client + ipykernel + ]; + server = [ + jupyter_server + nbformat + ] ++ client; + }; + + doCheck = false; # infinite recursion with jupyter-server + + checkInputs = [ + pytest-timeout + pytestCheckHook + ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies); + + passthru.tests = { + check = self.overridePythonAttrs (_: { doCheck = false; }); + }; + + meta = with lib; { + changelog = "https://github.com/jupyter-server/pytest-jupyter/releases/tag/v${version}"; + description = "pytest plugin for testing Jupyter core libraries and extensions"; + homepage = "https://github.com/jupyter-server/pytest-jupyter"; + license = licenses.bsd3; + maintainers = with maintainers; [ ]; + }; +}; +in self diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f4f81c61ca9b..abc96c8a36a5 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8935,6 +8935,8 @@ self: super: with self; { pytest-json-report = callPackage ../development/python-modules/pytest-json-report { }; + pytest-jupyter = callPackage ../development/python-modules/pytest-jupyter { }; + pytest-lazy-fixture = callPackage ../development/python-modules/pytest-lazy-fixture { }; pytest-localserver = callPackage ../development/python-modules/pytest-localserver { };