From db0fa06fce8adc85e49a0ffcf0f0bad85220ff89 Mon Sep 17 00:00:00 2001 From: Maximilian Bosch Date: Wed, 28 Mar 2018 01:08:12 +0200 Subject: [PATCH 1/2] pythonPackage.nipype: fix build `pythonPackages.prov` has been bumped to `1.5.2`, however `nipype` pinned `prov` to `1.5.0`. Patching `nipype/info.py` fixes this issue by bumping to the current `prov` version in nixpkgs. See https://hydra.nixos.org/build/71817962/log See ticket #36453 --- .../python-modules/nipype/default.nix | 3 +++ .../python-modules/nipype/prov-version.patch | 21 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 pkgs/development/python-modules/nipype/prov-version.patch diff --git a/pkgs/development/python-modules/nipype/default.nix b/pkgs/development/python-modules/nipype/default.nix index 30ee2b28561a..2ea6a10a5533 100644 --- a/pkgs/development/python-modules/nipype/default.nix +++ b/pkgs/development/python-modules/nipype/default.nix @@ -36,6 +36,9 @@ buildPythonPackage rec { sha256 = "47f62fda3d6b9a37aa407a6b78c80e91240aa71e61191ed00da68b02839fe258"; }; + # see https://github.com/nipy/nipype/issues/2240 + patches = [ ./prov-version.patch ]; + doCheck = false; # fails with TypeError: None is not callable checkInputs = [ which ]; buildInputs = [ pytest mock ]; # required in installPhase diff --git a/pkgs/development/python-modules/nipype/prov-version.patch b/pkgs/development/python-modules/nipype/prov-version.patch new file mode 100644 index 000000000000..133295d0560b --- /dev/null +++ b/pkgs/development/python-modules/nipype/prov-version.patch @@ -0,0 +1,21 @@ +diff --git a/nipype/info.py b/nipype/info.py +index 1daa382e2..da338d0ea 100644 +--- a/nipype/info.py ++++ b/nipype/info.py +@@ -108,7 +108,6 @@ DATEUTIL_MIN_VERSION = '2.2' + PYTEST_MIN_VERSION = '3.0' + FUTURE_MIN_VERSION = '0.16.0' + SIMPLEJSON_MIN_VERSION = '3.8.0' +-PROV_VERSION = '1.5.0' + CLICK_MIN_VERSION = '6.6.0' + PYDOT_MIN_VERSION = '1.2.3' + +@@ -140,7 +139,7 @@ REQUIRES = [ + 'traits>=%s' % TRAITS_MIN_VERSION, + 'future>=%s' % FUTURE_MIN_VERSION, + 'simplejson>=%s' % SIMPLEJSON_MIN_VERSION, +- 'prov==%s' % PROV_VERSION, ++ 'prov<2', + 'click>=%s' % CLICK_MIN_VERSION, + 'funcsigs', + 'pytest>=%s' % PYTEST_MIN_VERSION, From ee1896d63dec108be02489f73b677ace1c656a74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sat, 31 Mar 2018 20:43:32 +0200 Subject: [PATCH 2/2] pythonPackages.nipype: enable tests --- .../python-modules/nipype/default.nix | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/nipype/default.nix b/pkgs/development/python-modules/nipype/default.nix index 2ea6a10a5533..668e34a22476 100644 --- a/pkgs/development/python-modules/nipype/default.nix +++ b/pkgs/development/python-modules/nipype/default.nix @@ -21,8 +21,12 @@ , simplejson , traits , xvfbwrapper +, pytestcov +, codecov # other dependencies , which +, bash +, glibcLocales }: assert !isPy3k -> configparser != null; @@ -39,9 +43,11 @@ buildPythonPackage rec { # see https://github.com/nipy/nipype/issues/2240 patches = [ ./prov-version.patch ]; - doCheck = false; # fails with TypeError: None is not callable - checkInputs = [ which ]; - buildInputs = [ pytest mock ]; # required in installPhase + postPatch = '' + substituteInPlace nipype/interfaces/base/tests/test_core.py \ + --replace "/usr/bin/env bash" "${bash}/bin/bash" + ''; + propagatedBuildInputs = [ click dateutil @@ -62,6 +68,12 @@ buildPythonPackage rec { configparser ]; + checkInputs = [ pytest mock pytestcov codecov which glibcLocales ]; + + checkPhase = '' + LC_ALL="en_US.UTF-8" py.test -v --doctest-modules nipype + ''; + meta = with stdenv.lib; { homepage = http://nipy.org/nipype/; description = "Neuroimaging in Python: Pipelines and Interfaces";