From 6aac7f88054f5e5ba743f509faae0fefafd01b5e Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 3 Feb 2024 10:45:33 +0900 Subject: [PATCH 1/3] python311Packages.papermill: fix build --- .../python-modules/papermill/default.nix | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/papermill/default.nix b/pkgs/development/python-modules/papermill/default.nix index 65b5f7c0035d..aa2df0232d98 100644 --- a/pkgs/development/python-modules/papermill/default.nix +++ b/pkgs/development/python-modules/papermill/default.nix @@ -1,12 +1,12 @@ { lib -, ansiwrap , azure-datalake-store +, azure-identity , azure-storage-blob , boto3 , buildPythonPackage , click , entrypoints -, fetchPypi +, fetchFromGitHub , gcsfs , nbclient , nbformat @@ -17,6 +17,7 @@ , pythonOlder , pyyaml , requests +, setuptools , tenacity , tqdm }: @@ -24,17 +25,22 @@ buildPythonPackage rec { pname = "papermill"; version = "2.5.0"; - format = "setuptools"; + pyproject = true; - disabled = pythonOlder "3.7"; + disabled = pythonOlder "3.8"; - src = fetchPypi { - inherit pname version; - hash = "sha256-6ntwwFU/Vv6RsPqcxeFwEs1pkyCosBU3PnhwxeYIbHI="; + src = fetchFromGitHub { + owner = "nteract"; + repo = "papermill"; + rev = "refs/tags/${version}"; + hash = "sha256-x6f5hhTdOPDVFiBvRhfrXq1wd5keYiuUshXnT0IkjX0="; }; + nativeBuildInputs = [ + setuptools + ]; + propagatedBuildInputs = [ - ansiwrap click pyyaml nbformat @@ -48,6 +54,7 @@ buildPythonPackage rec { passthru.optional-dependencies = { azure = [ azure-datalake-store + azure-identity azure-storage-blob ]; gcs = [ From 22b7b3d9c1e8d5bfce9e8b7f469c9f7bb660c0dd Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 3 Feb 2024 10:47:08 +0900 Subject: [PATCH 2/3] python311Packages.papermill: enable tests --- .../python-modules/papermill/default.nix | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/papermill/default.nix b/pkgs/development/python-modules/papermill/default.nix index aa2df0232d98..f78aa541140a 100644 --- a/pkgs/development/python-modules/papermill/default.nix +++ b/pkgs/development/python-modules/papermill/default.nix @@ -1,4 +1,5 @@ { lib +, stdenv , azure-datalake-store , azure-identity , azure-storage-blob @@ -8,6 +9,8 @@ , entrypoints , fetchFromGitHub , gcsfs +, ipykernel +, moto , nbclient , nbformat , pyarrow @@ -72,21 +75,29 @@ buildPythonPackage rec { }; nativeCheckInputs = [ - pytestCheckHook + ipykernel + moto pytest-mock - ]; + pytestCheckHook + ] ++ passthru.optional-dependencies.azure + ++ passthru.optional-dependencies.s3 + ++ passthru.optional-dependencies.gcs; preCheck = '' export HOME=$(mktemp -d) ''; - # The test suite depends on cloud resources azure/aws - doCheck = false; - pythonImportsCheck = [ "papermill" ]; + disabledTests = lib.optionals stdenv.isDarwin [ + # might fail due to the sandbox + "test_end2end_autosave_slow_notebook" + ]; + + __darwinAllowLocalNetworking = true; + meta = with lib; { description = "Parametrize and run Jupyter and interact with notebooks"; homepage = "https://github.com/nteract/papermill"; From 87a0a83b9710aeca552c90f7975814cc473880e2 Mon Sep 17 00:00:00 2001 From: natsukium Date: Sat, 3 Feb 2024 10:47:26 +0900 Subject: [PATCH 3/3] python311Packages.papermill: add mainProgram --- pkgs/development/python-modules/papermill/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/papermill/default.nix b/pkgs/development/python-modules/papermill/default.nix index f78aa541140a..28f5c9b6f9e1 100644 --- a/pkgs/development/python-modules/papermill/default.nix +++ b/pkgs/development/python-modules/papermill/default.nix @@ -103,5 +103,6 @@ buildPythonPackage rec { homepage = "https://github.com/nteract/papermill"; license = licenses.bsd3; maintainers = with maintainers; [ ]; + mainProgram = "papermill"; }; }