lol

python312Packages.papermill: fix, cleanup (#400928)

authored by

Gaétan Lepage and committed by
GitHub
e1b21eaa 4fdf00c2

+61 -41
+15 -11
pkgs/development/python-modules/bash-kernel/default.nix
··· 1 1 { 2 2 lib, 3 3 buildPythonPackage, 4 - fetchPypi, 4 + fetchFromGitHub, 5 + replaceVars, 6 + bashInteractive, 5 7 flit-core, 6 8 filetype, 7 9 ipykernel, 10 + pexpect, 11 + writableTmpDirAsHomeHook, 8 12 python, 9 - pexpect, 10 - bashInteractive, 11 - replaceVars, 12 13 }: 13 14 14 15 buildPythonPackage rec { ··· 16 17 version = "0.10.0"; 17 18 pyproject = true; 18 19 19 - src = fetchPypi { 20 - pname = "bash_kernel"; 21 - inherit version; 22 - hash = "sha256-LtWgpBbEGNHXUecVBb1siJ4SFXREtQxCh6aF2ndcKMo="; 20 + src = fetchFromGitHub { 21 + owner = "takluyver"; 22 + repo = "bash_kernel"; 23 + tag = version; 24 + hash = "sha256-ugFMcQx1B1nKoO9rhb6PMllRcoZi0O4B9um8dOu5DU4="; 23 25 }; 24 26 25 27 patches = [ ··· 36 38 pexpect 37 39 ]; 38 40 39 - preBuild = '' 40 - export HOME=$TMPDIR 41 - ''; 41 + nativeBuildInputs = [ 42 + writableTmpDirAsHomeHook 43 + ]; 42 44 43 45 postInstall = '' 44 46 ${python.pythonOnBuildForHost.interpreter} -m bash_kernel.install --prefix $out ··· 58 60 59 61 runHook postCheck 60 62 ''; 63 + 64 + __darwinAllowLocalNetworking = true; 61 65 62 66 meta = { 63 67 description = "Bash Kernel for Jupyter";
+46 -30
pkgs/development/python-modules/papermill/default.nix
··· 1 1 { 2 2 lib, 3 3 stdenv, 4 - aiohttp, 4 + buildPythonPackage, 5 + fetchFromGitHub, 6 + 7 + # build-system 8 + setuptools, 9 + 10 + # dependencies 5 11 ansicolors, 6 - azure-datalake-store, 7 - azure-identity, 8 - azure-storage-blob, 9 - boto3, 10 - buildPythonPackage, 11 12 click, 12 13 entrypoints, 13 - fetchFromGitHub, 14 - gcsfs, 15 - ipykernel, 16 - moto, 17 14 nbclient, 18 15 nbformat, 19 - pyarrow, 20 - pygithub, 21 - pytest-mock, 22 - pytestCheckHook, 23 - pythonAtLeast, 24 - pythonOlder, 25 16 pyyaml, 26 17 requests, 27 - setuptools, 28 18 tenacity, 29 19 tqdm, 20 + pythonAtLeast, 21 + aiohttp, 22 + 23 + # optional-dependencies 24 + azure-datalake-store, 25 + azure-identity, 26 + azure-storage-blob, 27 + gcsfs, 28 + pygithub, 29 + pyarrow, 30 + boto3, 31 + 32 + # tests 33 + ipykernel, 34 + moto, 35 + pytest-mock, 36 + pytestCheckHook, 37 + versionCheckHook, 38 + writableTmpDirAsHomeHook, 30 39 }: 31 40 32 41 buildPythonPackage rec { ··· 34 43 version = "2.6.0"; 35 44 pyproject = true; 36 45 37 - disabled = pythonOlder "3.8"; 38 - 39 46 src = fetchFromGitHub { 40 47 owner = "nteract"; 41 48 repo = "papermill"; ··· 46 53 build-system = [ setuptools ]; 47 54 48 55 dependencies = [ 56 + ansicolors 49 57 click 50 - pyyaml 58 + entrypoints 59 + nbclient 51 60 nbformat 52 - nbclient 53 - tqdm 61 + pyyaml 54 62 requests 55 - entrypoints 56 63 tenacity 57 - ansicolors 64 + tqdm 58 65 ] ++ lib.optionals (pythonAtLeast "3.12") [ aiohttp ]; 59 66 60 67 optional-dependencies = { ··· 75 82 moto 76 83 pytest-mock 77 84 pytestCheckHook 85 + versionCheckHook 86 + writableTmpDirAsHomeHook 78 87 ] 79 88 ++ optional-dependencies.azure 80 89 ++ optional-dependencies.s3 81 90 ++ optional-dependencies.gcs; 91 + versionCheckProgramArg = "--version"; 82 92 83 - preCheck = '' 84 - export HOME=$(mktemp -d) 85 - ''; 93 + pythonImportsCheck = [ "papermill" ]; 86 94 87 - pythonImportsCheck = [ "papermill" ]; 95 + # Using pytestFlagsArray to prevent disabling false positives 96 + pytestFlagsArray = [ 97 + # AssertionError: 'error' != 'display_data' 98 + "--deselect=papermill/tests/test_execute.py::TestBrokenNotebook2::test" 99 + 100 + # AssertionError: '\x1b[31mSystemExit\x1b[39m\x1b[31m:\x1b[39m 1\n' != '\x1b[0;31mSystemExit\x1b[0m\x1b[0;31m:\x1b[0m 1\n' 101 + "--deselect=papermill/tests/test_execute.py::TestOutputFormatting::test_output_formatting" 102 + ]; 88 103 89 104 disabledTests = 90 105 [ ··· 103 118 104 119 __darwinAllowLocalNetworking = true; 105 120 106 - meta = with lib; { 121 + meta = { 107 122 description = "Parametrize and run Jupyter and interact with notebooks"; 108 123 homepage = "https://github.com/nteract/papermill"; 109 - license = licenses.bsd3; 124 + changelog = "https://papermill.readthedocs.io/en/latest/changelog.html"; 125 + license = lib.licenses.bsd3; 110 126 maintainers = [ ]; 111 127 mainProgram = "papermill"; 112 128 };