From a7166cdc35263b2ea1266226580d0831637cd293 Mon Sep 17 00:00:00 2001 From: Uli Baum Date: Mon, 10 Sep 2018 17:06:54 +0200 Subject: [PATCH 1/8] pythonPackages.us: fix build Required jellyfish==0.5.6 but we have 0.6.1. Loosen requirements. --- pkgs/development/python-modules/us/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/us/default.nix b/pkgs/development/python-modules/us/default.nix index eb001410ce5..53b5bc9ad16 100644 --- a/pkgs/development/python-modules/us/default.nix +++ b/pkgs/development/python-modules/us/default.nix @@ -15,6 +15,13 @@ buildPythonPackage rec { sha256 = "1niglalkp7pinibzbxjdz9mxx9qmwkrh8884dag3kr72cfkrpp09"; }; + # Upstream requires jellyfish==0.5.6 but we have 0.6.1 + postPatch = '' + substituteInPlace setup.py --replace "jellyfish==" "jellyfish>=" + ''; + + doCheck = false; # pypi version doesn't include tests + meta = { description = "A package for easily working with US and state metadata"; longDescription = '' From bb1f3422e0c62bba962b40db10d1e929039bec03 Mon Sep 17 00:00:00 2001 From: Uli Baum Date: Mon, 10 Sep 2018 17:19:05 +0200 Subject: [PATCH 2/8] pythonPackages.readme_renderer: fix build Disable one test case that has failed since last bleach update. --- pkgs/development/python-modules/readme_renderer/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/readme_renderer/default.nix b/pkgs/development/python-modules/readme_renderer/default.nix index 4690dcc89bc..d6c333ce36d 100644 --- a/pkgs/development/python-modules/readme_renderer/default.nix +++ b/pkgs/development/python-modules/readme_renderer/default.nix @@ -27,7 +27,8 @@ buildPythonPackage rec { ]; checkPhase = '' - py.test + # disable one failing test case + py.test -k "not test_invalid_link" ''; meta = { From d2a885a3b5d387952f2343e42507ebc00b9cdbbc Mon Sep 17 00:00:00 2001 From: Uli Baum Date: Mon, 10 Sep 2018 17:32:50 +0200 Subject: [PATCH 3/8] pythonPackages.pyfakefs: 3.4.1 -> 3.4.3, fix build Update and disable some failing test cases --- .../python-modules/pyfakefs/default.nix | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pkgs/development/python-modules/pyfakefs/default.nix b/pkgs/development/python-modules/pyfakefs/default.nix index cfb575c7675..3208a512e59 100644 --- a/pkgs/development/python-modules/pyfakefs/default.nix +++ b/pkgs/development/python-modules/pyfakefs/default.nix @@ -1,7 +1,7 @@ { stdenv, buildPythonPackage, fetchFromGitHub, python, pytest, glibcLocales }: buildPythonPackage rec { - version = "3.4.1"; + version = "3.4.3"; pname = "pyfakefs"; # no tests in PyPI tarball @@ -10,22 +10,26 @@ buildPythonPackage rec { owner = "jmcgeheeiv"; repo = pname; rev = "v${version}"; - sha256 = "0i8kq7sl8bczr927hllgfhsmirjqjh89c9184kcqmprc13ac4kxy"; + sha256 = "0rhbkcb5h2x8kmyxivr5jr1db2xvmpjdbsfjxl142qhfb29hr2hp"; }; postPatch = '' # test doesn't work in sandbox - substituteInPlace tests/fake_filesystem_test.py \ + substituteInPlace pyfakefs/tests/fake_filesystem_test.py \ --replace "test_expand_root" "notest_expand_root" - substituteInPlace tests/fake_os_test.py \ - --replace "test_append_mode" "notest_append_mode" + substituteInPlace pyfakefs/tests/fake_os_test.py \ + --replace "test_path_links_not_resolved" "notest_path_links_not_resolved" \ + --replace "test_append_mode_tell_linux_windows" "notest_append_mode_tell_linux_windows" + substituteInPlace pyfakefs/tests/fake_filesystem_unittest_test.py \ + --replace "test_copy_real_file" "notest_copy_real_file" ''; checkInputs = [ pytest glibcLocales ]; checkPhase = '' - LC_ALL=en_US.UTF-8 ${python.interpreter} -m tests.all_tests - py.test tests/pytest_plugin_test.py + export LC_ALL=en_US.UTF-8 + ${python.interpreter} -m pyfakefs.tests.all_tests + ${python.interpreter} -m pytest pyfakefs/tests/pytest_plugin_test.py ''; meta = with stdenv.lib; { From 80ecef8e4beb007aa558f123f8ac66b69b4f0a90 Mon Sep 17 00:00:00 2001 From: Uli Baum Date: Mon, 10 Sep 2018 18:05:40 +0200 Subject: [PATCH 4/8] pythonPackages.pydub: fix build and tests - remove obsolete patch that caused build failure - no tests were run because required data files were missing in pypi version; use github version instead --- .../python-modules/pydub/default.nix | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/pkgs/development/python-modules/pydub/default.nix b/pkgs/development/python-modules/pydub/default.nix index 28a76da4bd9..e9ce74263c2 100644 --- a/pkgs/development/python-modules/pydub/default.nix +++ b/pkgs/development/python-modules/pydub/default.nix @@ -1,19 +1,22 @@ -{ stdenv, buildPythonPackage, fetchPypi, scipy, ffmpeg-full }: +{ stdenv, buildPythonPackage, fetchFromGitHub, scipy, ffmpeg-full }: buildPythonPackage rec { pname = "pydub"; version = "0.22.1"; - src = fetchPypi { - inherit pname version; - sha256 = "20beff39e9959a3b2cb4392802aecb9b2417837fff635d2b00b5ef5f5326d313"; + # pypi version doesn't include required data files for tests + src = fetchFromGitHub { + owner = "jiaaro"; + repo = pname; + rev = "v${version}"; + sha256 = "0xqyvzgdfy01p98wnvsrf6iwdfq91ad377r6j12r8svm13ygx5bv"; }; - patches = [ - ./pyaudioop-python3.patch - ]; - checkInputs = [ scipy ffmpeg-full ]; + checkPhase = '' + python test/test.py + ''; + meta = with stdenv.lib; { description = "Manipulate audio with a simple and easy high level interface."; homepage = "http://pydub.com/"; From 40c469e56bcb894078a837d87070d7ef92f88e46 Mon Sep 17 00:00:00 2001 From: Uli Baum Date: Mon, 10 Sep 2018 18:19:01 +0200 Subject: [PATCH 5/8] pythonPackages.pydub: remove obsolete patch --- .../pydub/pyaudioop-python3.patch | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 pkgs/development/python-modules/pydub/pyaudioop-python3.patch diff --git a/pkgs/development/python-modules/pydub/pyaudioop-python3.patch b/pkgs/development/python-modules/pydub/pyaudioop-python3.patch deleted file mode 100644 index 58c56db5b8a..00000000000 --- a/pkgs/development/python-modules/pydub/pyaudioop-python3.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git i/pydub/pyaudioop.py w/pydub/pyaudioop.py -index 8f8f017..aa6bb8c 100644 ---- i/pydub/pyaudioop.py -+++ w/pydub/pyaudioop.py -@@ -1,4 +1,4 @@ --import __builtin__ -+import builtins - import math - import struct - from fractions import gcd -@@ -79,7 +79,7 @@ def _get_minval(size, signed=True): - def _get_clipfn(size, signed=True): - maxval = _get_maxval(size, signed) - minval = _get_minval(size, signed) -- return lambda val: __builtin__.max(min(val, maxval), minval) -+ return lambda val: builtins.max(min(val, maxval), minval) - - - def _overflow(val, size, signed=True): -@@ -109,7 +109,7 @@ def max(cp, size): - if len(cp) == 0: - return 0 - -- return __builtin__.max(abs(sample) for sample in _get_samples(cp, size)) -+ return builtins.max(abs(sample) for sample in _get_samples(cp, size)) - - - def minmax(cp, size): -@@ -117,8 +117,8 @@ def minmax(cp, size): - - max_sample, min_sample = 0, 0 - for sample in _get_samples(cp, size): -- max_sample = __builtin__.max(sample, max_sample) -- min_sample = __builtin__.min(sample, min_sample) -+ max_sample = builtins.max(sample, max_sample) -+ min_sample = builtins.min(sample, min_sample) - - return min_sample, max_sample - -@@ -542,4 +542,4 @@ def lin2adpcm(cp, size, state): - - - def adpcm2lin(cp, size, state): -- raise NotImplementedError() -\ No newline at end of file -+ raise NotImplementedError() From bc036397a3ff83a01df820e232ef845cb16ed6bb Mon Sep 17 00:00:00 2001 From: Uli Baum Date: Mon, 10 Sep 2018 22:36:14 +0200 Subject: [PATCH 6/8] pythonPackages.pydub: fix aarch64 build one test failed due to rounding errors, disable it --- pkgs/development/python-modules/pydub/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/pydub/default.nix b/pkgs/development/python-modules/pydub/default.nix index e9ce74263c2..0770c78b674 100644 --- a/pkgs/development/python-modules/pydub/default.nix +++ b/pkgs/development/python-modules/pydub/default.nix @@ -11,6 +11,13 @@ buildPythonPackage rec { sha256 = "0xqyvzgdfy01p98wnvsrf6iwdfq91ad377r6j12r8svm13ygx5bv"; }; + + # disable a test that fails on aarch64 due to rounding errors + postPatch = stdenv.lib.optionalString stdenv.isAarch64 '' + substituteInPlace test/test.py \ + --replace "test_overlay_with_gain_change" "notest_overlay_with_gain_change" + ''; + checkInputs = [ scipy ffmpeg-full ]; checkPhase = '' From bd02a1931a4d8c6bf239de534890c64b16a33ab4 Mon Sep 17 00:00:00 2001 From: Uli Baum Date: Mon, 10 Sep 2018 22:42:23 +0200 Subject: [PATCH 7/8] pythonPackages.pyfakefs: fix darwin build One test failed on darwin due to case-insensitive file system, disable it. --- pkgs/development/python-modules/pyfakefs/default.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pyfakefs/default.nix b/pkgs/development/python-modules/pyfakefs/default.nix index 3208a512e59..64d547ce97e 100644 --- a/pkgs/development/python-modules/pyfakefs/default.nix +++ b/pkgs/development/python-modules/pyfakefs/default.nix @@ -22,7 +22,11 @@ buildPythonPackage rec { --replace "test_append_mode_tell_linux_windows" "notest_append_mode_tell_linux_windows" substituteInPlace pyfakefs/tests/fake_filesystem_unittest_test.py \ --replace "test_copy_real_file" "notest_copy_real_file" - ''; + '' + (stdenv.lib.optionalString stdenv.isDarwin '' + # this test fails on darwin due to case-insensitive file system + substituteInPlace pyfakefs/tests/fake_os_test.py \ + --replace "test_rename_dir_to_existing_dir" "notest_rename_dir_to_existing_dir" + ''); checkInputs = [ pytest glibcLocales ]; From 6dc57134dac0037aedfeea5a7c1b7fac17588135 Mon Sep 17 00:00:00 2001 From: Uli Baum Date: Thu, 13 Sep 2018 11:21:19 +0200 Subject: [PATCH 8/8] pythonPackages.restview: fix tests Failed after readme_renderer was updated. Apply an upstream patch. --- pkgs/development/python-modules/restview/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/python-modules/restview/default.nix b/pkgs/development/python-modules/restview/default.nix index e8a8b9dd637..a6b22220da3 100644 --- a/pkgs/development/python-modules/restview/default.nix +++ b/pkgs/development/python-modules/restview/default.nix @@ -1,6 +1,7 @@ { lib , buildPythonPackage , fetchPypi +, fetchpatch , docutils , readme_renderer , pygments @@ -19,6 +20,15 @@ buildPythonPackage rec { propagatedBuildInputs = [ docutils readme_renderer pygments ]; checkInputs = [ mock ]; + patches = [ + # fix tests after readme_renderer update + # TODO remove on next update + (fetchpatch { + url = "https://github.com/mgedmin/restview/commit/541743ded13ae55dea4c437046984a5f13d06e8b.patch"; + sha256 = "031b1dlqx346bz7afpc011lslnq771lnxb6iy1l2285pph534bci"; + }) + ]; + postPatch = '' # dict order breaking tests sed -i 's@@...@' src/restview/tests.py