diff --git a/pkgs/development/python-modules/papermill/default.nix b/pkgs/development/python-modules/papermill/default.nix index bbafe4f048a4..594fd654d594 100644 --- a/pkgs/development/python-modules/papermill/default.nix +++ b/pkgs/development/python-modules/papermill/default.nix @@ -1,32 +1,41 @@ { lib, stdenv, - aiohttp, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies ansicolors, + click, + entrypoints, + nbclient, + nbformat, + pyyaml, + requests, + tenacity, + tqdm, + pythonAtLeast, + aiohttp, + + # optional-dependencies azure-datalake-store, azure-identity, azure-storage-blob, - boto3, - buildPythonPackage, - click, - entrypoints, - fetchFromGitHub, gcsfs, + pygithub, + pyarrow, + boto3, + + # tests ipykernel, moto, - nbclient, - nbformat, - pyarrow, - pygithub, pytest-mock, pytestCheckHook, - pythonAtLeast, - pythonOlder, - pyyaml, - requests, - setuptools, - tenacity, - tqdm, + versionCheckHook, + writableTmpDirAsHomeHook, }: buildPythonPackage rec { @@ -34,8 +43,6 @@ buildPythonPackage rec { version = "2.6.0"; pyproject = true; - disabled = pythonOlder "3.8"; - src = fetchFromGitHub { owner = "nteract"; repo = "papermill"; @@ -46,15 +53,15 @@ buildPythonPackage rec { build-system = [ setuptools ]; dependencies = [ - click - pyyaml - nbformat - nbclient - tqdm - requests - entrypoints - tenacity ansicolors + click + entrypoints + nbclient + nbformat + pyyaml + requests + tenacity + tqdm ] ++ lib.optionals (pythonAtLeast "3.12") [ aiohttp ]; optional-dependencies = { @@ -75,17 +82,25 @@ buildPythonPackage rec { moto pytest-mock pytestCheckHook + versionCheckHook + writableTmpDirAsHomeHook ] ++ optional-dependencies.azure ++ optional-dependencies.s3 ++ optional-dependencies.gcs; - - preCheck = '' - export HOME=$(mktemp -d) - ''; + versionCheckProgramArg = "--version"; pythonImportsCheck = [ "papermill" ]; + # Using pytestFlagsArray to prevent disabling false positives + pytestFlagsArray = [ + # AssertionError: 'error' != 'display_data' + "--deselect=papermill/tests/test_execute.py::TestBrokenNotebook2::test" + + # AssertionError: '\x1b[31mSystemExit\x1b[39m\x1b[31m:\x1b[39m 1\n' != '\x1b[0;31mSystemExit\x1b[0m\x1b[0;31m:\x1b[0m 1\n' + "--deselect=papermill/tests/test_execute.py::TestOutputFormatting::test_output_formatting" + ]; + disabledTests = [ # pytest 8 compat @@ -103,10 +118,11 @@ buildPythonPackage rec { __darwinAllowLocalNetworking = true; - meta = with lib; { + meta = { description = "Parametrize and run Jupyter and interact with notebooks"; homepage = "https://github.com/nteract/papermill"; - license = licenses.bsd3; + changelog = "https://papermill.readthedocs.io/en/latest/changelog.html"; + license = lib.licenses.bsd3; maintainers = [ ]; mainProgram = "papermill"; };