From 9dcfa743e4fae45dc35529f15fb62862608b0401 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Tue, 18 Mar 2025 17:25:10 +0100 Subject: [PATCH] python312Packages.nbdime: modernize, fix failing tests on darwin --- .../python-modules/nbdime/default.nix | 47 ++++++++++++------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/pkgs/development/python-modules/nbdime/default.nix b/pkgs/development/python-modules/nbdime/default.nix index 9ccb1a257b88..581e7463ff78 100644 --- a/pkgs/development/python-modules/nbdime/default.nix +++ b/pkgs/development/python-modules/nbdime/default.nix @@ -1,23 +1,29 @@ { lib, buildPythonPackage, - pythonOlder, fetchPypi, + + # build-system hatch-jupyter-builder, hatchling, jupyterlab, - nbformat, + + # dependencies colorama, - pygments, - tornado, - requests, gitpython, + jinja2, jupyter-server, jupyter-server-mathjax, - jinja2, + nbformat, + pygments, + requests, + tornado, + + # tests gitMinimal, pytest-tornado, pytestCheckHook, + writableTmpDirAsHomeHook, }: buildPythonPackage rec { @@ -25,8 +31,6 @@ buildPythonPackage rec { version = "4.0.2"; pyproject = true; - disabled = pythonOlder "3.6"; - src = fetchPypi { inherit pname version; hash = "sha256-2Cefj0sjbAslOyDWDEgxu2eEPtjb1uCfI06wEdNvG/I="; @@ -39,32 +43,39 @@ buildPythonPackage rec { ]; dependencies = [ - nbformat colorama - pygments - tornado - requests gitpython + jinja2 jupyter-server jupyter-server-mathjax - jinja2 + nbformat + pygments + requests + tornado ]; nativeCheckInputs = [ gitMinimal pytest-tornado pytestCheckHook + writableTmpDirAsHomeHook ]; disabledTests = [ + # subprocess.CalledProcessError: Command '['git', 'diff', 'base', 'diff.ipynb']' returned non-zero exit status 128. + # git-nbdiffdriver diff: line 1: git-nbdiffdriver: command not found + # fatal: external diff died, stopping at diff.ipynb "test_git_diffdriver" - "test_git_difftool" + + # subprocess.CalledProcessError: Command '['git', 'merge', 'remote-no-conflict']' returned non-zero exit status 1. "test_git_mergedriver" + + # Require network access + "test_git_difftool" "test_git_mergetool" ]; preCheck = '' - export HOME="$TEMP" git config --global user.email "janedoe@example.com" git config --global user.name "Jane Doe" ''; @@ -73,11 +84,11 @@ buildPythonPackage rec { pythonImportsCheck = [ "nbdime" ]; - meta = with lib; { + meta = { homepage = "https://github.com/jupyter/nbdime"; changelog = "https://github.com/jupyter/nbdime/blob/${version}/CHANGELOG.md"; description = "Tools for diffing and merging of Jupyter notebooks"; - license = licenses.bsd3; - maintainers = with maintainers; [ tbenst ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ tbenst ]; }; }