From 3a087c1bc8b72a531999b548c581417a7f917f68 Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Mon, 24 Oct 2022 01:19:04 -0700 Subject: [PATCH 1/8] python3Packages.testbook: init at 0.4.2 --- .../python-modules/testbook/default.nix | 34 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 36 insertions(+) create mode 100644 pkgs/development/python-modules/testbook/default.nix diff --git a/pkgs/development/python-modules/testbook/default.nix b/pkgs/development/python-modules/testbook/default.nix new file mode 100644 index 000000000000..0b9cc1117b60 --- /dev/null +++ b/pkgs/development/python-modules/testbook/default.nix @@ -0,0 +1,34 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pythonOlder, + nbformat, + nbclient, +}: +buildPythonPackage rec { + pname = "testbook"; + version = "0.4.2"; + format = "pyproject"; + + disabled = pythonOlder "3.6"; + + src = fetchFromGitHub { + owner = "nteract"; + repo = pname; + rev = version; + sha256 = "08fdd5ef7c96480ad11c12d472de21acd32359996f69a5259299b540feba4560"; + }; + + nativeBuildInputs = [ + nbformat + nbclient + ]; + + meta = with lib; { + description = "testbook is a unit testing framework extension for testing code in Jupyter Notebooks."; + homepage = "https://testbook.readthedocs.io/"; + license = with licenses; [bsd3]; + maintainers = with maintainers; [djacu]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index ac7aea67d2e7..1b7c89a5becf 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11065,6 +11065,8 @@ in { textual = callPackage ../development/python-modules/textual { }; + testbook = callPackage ../development/python-modules/testbook { }; + testing-common-database = callPackage ../development/python-modules/testing-common-database { }; testing-postgresql = callPackage ../development/python-modules/testing-postgresql { }; From 26e9344d30079672e4cb93aef47cb5f44d9475ef Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Mon, 24 Oct 2022 14:22:23 +0200 Subject: [PATCH 2/8] fixes 'failed to produce output path for output' error --- pkgs/development/python-modules/testbook/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/testbook/default.nix b/pkgs/development/python-modules/testbook/default.nix index 0b9cc1117b60..fed4e68327d8 100644 --- a/pkgs/development/python-modules/testbook/default.nix +++ b/pkgs/development/python-modules/testbook/default.nix @@ -17,7 +17,7 @@ buildPythonPackage rec { owner = "nteract"; repo = pname; rev = version; - sha256 = "08fdd5ef7c96480ad11c12d472de21acd32359996f69a5259299b540feba4560"; + sha256 = "sha256-qaDgae/5TRpjmjOf7aom7TC5HLHp0PHM/ds47AKtq8U="; }; nativeBuildInputs = [ From 50a2b6ed0c6ad6c4db0dce58b2114d759efe6790 Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Mon, 24 Oct 2022 14:23:08 +0200 Subject: [PATCH 3/8] fix testbook package tests dependencies --- .../python-modules/testbook/default.nix | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/testbook/default.nix b/pkgs/development/python-modules/testbook/default.nix index fed4e68327d8..5388d42d4a1d 100644 --- a/pkgs/development/python-modules/testbook/default.nix +++ b/pkgs/development/python-modules/testbook/default.nix @@ -1,10 +1,14 @@ { lib, buildPythonPackage, - fetchFromGitHub, pythonOlder, + fetchFromGitHub, nbformat, nbclient, + ipykernel, + pandas, + pytest, + traitlets, }: buildPythonPackage rec { pname = "testbook"; @@ -21,10 +25,19 @@ buildPythonPackage rec { }; nativeBuildInputs = [ - nbformat nbclient + nbformat ]; + checkInputs = [ + ipykernel + pandas + pytest + traitlets + ]; + + checkPhase = "pytest"; + meta = with lib; { description = "testbook is a unit testing framework extension for testing code in Jupyter Notebooks."; homepage = "https://testbook.readthedocs.io/"; From 67f7168a6bb553e1d6d88df93a28ab90e80466c5 Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Mon, 24 Oct 2022 15:19:38 +0200 Subject: [PATCH 4/8] add myself (djacu) to maintainers list --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index d30e7563be0f..f580f4d9049f 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3456,6 +3456,12 @@ githubId = 8852888; name = "David Izquierdo"; }; + djacu = { + email = "daniel.n.baker@gmail.com"; + github = "djacu"; + githubId = "7043297"; + name = "Daniel Baker"; + }; djanatyn = { email = "djanatyn@gmail.com"; github = "djanatyn"; From f267af423f8a8eb5472f99c82708fc88eda1c160 Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Mon, 24 Oct 2022 15:31:22 +0200 Subject: [PATCH 5/8] fixing meta.description --- pkgs/development/python-modules/testbook/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/testbook/default.nix b/pkgs/development/python-modules/testbook/default.nix index 5388d42d4a1d..6c13af52bed3 100644 --- a/pkgs/development/python-modules/testbook/default.nix +++ b/pkgs/development/python-modules/testbook/default.nix @@ -39,7 +39,7 @@ buildPythonPackage rec { checkPhase = "pytest"; meta = with lib; { - description = "testbook is a unit testing framework extension for testing code in Jupyter Notebooks."; + description = "A unit testing framework extension for testing code in Jupyter Notebooks"; homepage = "https://testbook.readthedocs.io/"; license = with licenses; [bsd3]; maintainers = with maintainers; [djacu]; From 33a6b4a2024d85d1792859039d0ad2bc500ce946 Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Mon, 24 Oct 2022 16:31:29 +0200 Subject: [PATCH 6/8] fix maintainer githubId --- maintainers/maintainer-list.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index f580f4d9049f..d5aeceb8244e 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -3459,7 +3459,7 @@ djacu = { email = "daniel.n.baker@gmail.com"; github = "djacu"; - githubId = "7043297"; + githubId = 7043297; name = "Daniel Baker"; }; djanatyn = { From c57312027c4bd70faa37bb6e9594ef1db25e5063 Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Mon, 24 Oct 2022 18:33:47 +0200 Subject: [PATCH 7/8] build inputs need to be propagated for runtime. --- pkgs/development/python-modules/testbook/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/testbook/default.nix b/pkgs/development/python-modules/testbook/default.nix index 6c13af52bed3..3ef95b2e8d54 100644 --- a/pkgs/development/python-modules/testbook/default.nix +++ b/pkgs/development/python-modules/testbook/default.nix @@ -24,7 +24,7 @@ buildPythonPackage rec { sha256 = "sha256-qaDgae/5TRpjmjOf7aom7TC5HLHp0PHM/ds47AKtq8U="; }; - nativeBuildInputs = [ + propagatedBuildInputs = [ nbclient nbformat ]; From cd4b365002757df1819521adee8803b9c8818f31 Mon Sep 17 00:00:00 2001 From: Daniel Baker Date: Thu, 27 Oct 2022 21:58:35 +0200 Subject: [PATCH 8/8] feedback from PR review. --- .../python-modules/testbook/default.nix | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/pkgs/development/python-modules/testbook/default.nix b/pkgs/development/python-modules/testbook/default.nix index 3ef95b2e8d54..615fb96cd142 100644 --- a/pkgs/development/python-modules/testbook/default.nix +++ b/pkgs/development/python-modules/testbook/default.nix @@ -1,15 +1,15 @@ -{ - lib, - buildPythonPackage, - pythonOlder, - fetchFromGitHub, - nbformat, - nbclient, - ipykernel, - pandas, - pytest, - traitlets, +{ lib +, buildPythonPackage +, pythonOlder +, fetchFromGitHub +, nbformat +, nbclient +, ipykernel +, pandas +, pytestCheckHook +, traitlets }: + buildPythonPackage rec { pname = "testbook"; version = "0.4.2"; @@ -32,16 +32,18 @@ buildPythonPackage rec { checkInputs = [ ipykernel pandas - pytest + pytestCheckHook traitlets ]; - checkPhase = "pytest"; + pythonImportsCheck = [ + "testbook" + ]; meta = with lib; { description = "A unit testing framework extension for testing code in Jupyter Notebooks"; homepage = "https://testbook.readthedocs.io/"; - license = with licenses; [bsd3]; - maintainers = with maintainers; [djacu]; + license = with licenses; [ bsd3 ]; + maintainers = with maintainers; [ djacu ]; }; }