diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2020-04-21 01:56:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-21 07:56:13 +0200 |
commit | c7d4882ab15f911258adf853785c904620159707 (patch) | |
tree | 79c8787545f3db1f683eb86db1f83b1350686947 /pkgs/development/python-modules/matplotlib | |
parent | fe07e2b2ac54b352680658ae2ececbe721433e14 (diff) |
python3Packages.matplotlib: 3.1.3 -> 3.2.1, and various cleanups (#84362)
* pythonPackages.matplotlib: add veprbl to maintainers * pythonPackages.matplotlib: remove an old darwin hack * pythonPackages.matplotlib: remove python and stdenv from buildInputs * python3Packages.matplotlib: remove a hack for python33 * pythonPackages.matplotlib: remove outdated checkPhase Downloading the baseline_images is not a real issue, building against older freetype (local_freetype = True) is, perhaps, not what we want. The good news is that the tests would pass (tested on 3.2.1) if we were to enable them: ========== 6684 passed, 1332 skipped, 10 xfailed in 228.64s (0:03:48) ========== * pythonPackages.matplotlib: provide setup.cfg from a file instead of a patch * python3Packages.matplotlib: 3.1.3 -> 3.2.1
Diffstat (limited to 'pkgs/development/python-modules/matplotlib')
4 files changed, 28 insertions, 62 deletions
diff --git a/pkgs/development/python-modules/matplotlib/2.nix b/pkgs/development/python-modules/matplotlib/2.nix index 8ea530489e249..dd25860795baf 100644 --- a/pkgs/development/python-modules/matplotlib/2.nix +++ b/pkgs/development/python-modules/matplotlib/2.nix @@ -7,7 +7,6 @@ # darwin has its own "MacOSX" backend , enableTk ? !stdenv.isDarwin, tcl ? null, tk ? null, tkinter ? null, libX11 ? null , enableQt ? false, pyqt4 -, libcxx , Cocoa , pythonOlder }: @@ -29,13 +28,20 @@ buildPythonPackage rec { sha256 = "7355bf757ecacd5f0ac9dd9523c8e1a1103faadf8d33c22664178e17533f8ce5"; }; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; + patches = [ + # https://github.com/matplotlib/matplotlib/pull/12478 + (fetchpatch { + name = "numpy-1.16-compat.patch"; + url = "https://github.com/matplotlib/matplotlib/commit/2980184d092382a40ab21f95b79582ffae6e19d6.patch"; + sha256 = "1c0wj28zy8s5h6qiavx9zzbhlmhjwpzbc3fyyw9039mbnqk0spg2"; + }) + ]; XDG_RUNTIME_DIR = "/tmp"; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ python which sphinx stdenv ] + buildInputs = [ which sphinx ] ++ stdenv.lib.optional enableGhostscript ghostscript ++ stdenv.lib.optional stdenv.isDarwin [ Cocoa ]; @@ -48,16 +54,10 @@ buildPythonPackage rec { ++ stdenv.lib.optionals enableQt [ pyqt4 ] ++ stdenv.lib.optionals python.isPy2 [ functools32 subprocess32 ]; - patches = [ - ./basedirlist.patch - - # https://github.com/matplotlib/matplotlib/pull/12478 - (fetchpatch { - name = "numpy-1.16-compat.patch"; - url = "https://github.com/matplotlib/matplotlib/commit/2980184d092382a40ab21f95b79582ffae6e19d6.patch"; - sha256 = "1c0wj28zy8s5h6qiavx9zzbhlmhjwpzbc3fyyw9039mbnqk0spg2"; - }) - ]; + setup_cfg = ./setup.cfg; + preBuild = '' + cp "$setup_cfg" ./setup.cfg + ''; # Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the # corresponding interpreter object for its library paths. This fails if @@ -73,27 +73,14 @@ buildPythonPackage rec { stdenv.lib.optionalString enableTk "sed -i '/self.tcl_tk_cache = None/s|None|${tcl_tk_cache}|' setupext.py"; - checkPhase = '' - ${python.interpreter} tests.py - ''; - - # Test data is not included in the distribution (the `tests` folder - # is missing) + # Matplotlib needs to be built against a specific version of freetype in + # order for all of the tests to pass. doCheck = false; - prePatch = '' - # Failing test: ERROR: matplotlib.tests.test_style.test_use_url - sed -i 's/test_use_url/fails/' lib/matplotlib/tests/test_style.py - # Failing test: ERROR: test suite for <class 'matplotlib.sphinxext.tests.test_tinypages.TestTinyPages'> - sed -i 's/TestTinyPages/fails/' lib/matplotlib/sphinxext/tests/test_tinypages.py - # Transient errors - sed -i 's/test_invisible_Line_rendering/noop/' lib/matplotlib/tests/test_lines.py - ''; - meta = with stdenv.lib; { description = "Python plotting library, making publication quality plots"; homepage = "https://matplotlib.org/"; - maintainers = with maintainers; [ lovek323 ]; + maintainers = with maintainers; [ lovek323 veprbl ]; }; } diff --git a/pkgs/development/python-modules/matplotlib/basedirlist.patch b/pkgs/development/python-modules/matplotlib/basedirlist.patch deleted file mode 100644 index 0a84a05bbaeae..0000000000000 --- a/pkgs/development/python-modules/matplotlib/basedirlist.patch +++ /dev/null @@ -1,8 +0,0 @@ -diff --git a/setup.cfg b/setup.cfg -new file mode 100644 -index 0000000..6f81985 ---- /dev/null -+++ b/setup.cfg -@@ -0,0 +1,2 @@ -+[directories] -+basedirlist = . diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index 658388eabae4a..03afcfe75ae3b 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -6,7 +6,6 @@ # darwin has its own "MacOSX" backend , enableTk ? !stdenv.isDarwin, tcl ? null, tk ? null, tkinter ? null, libX11 ? null , enableQt ? false, pyqt5 ? null -, libcxx , Cocoa , pythonOlder }: @@ -20,36 +19,35 @@ assert enableTk -> (tcl != null) assert enableQt -> pyqt5 != null; buildPythonPackage rec { - version = "3.1.3"; + version = "3.2.1"; pname = "matplotlib"; disabled = !isPy3k; src = fetchPypi { inherit pname version; - sha256 = "db3121f12fb9b99f105d1413aebaeb3d943f269f3d262b45586d12765866f0c6"; + sha256 = "ffe2f9cdcea1086fc414e82f42271ecf1976700b8edd16ca9d376189c6d93aee"; }; - NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${libcxx}/include/c++/v1"; - XDG_RUNTIME_DIR = "/tmp"; nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ python which sphinx stdenv ] + buildInputs = [ which sphinx ] ++ stdenv.lib.optional enableGhostscript ghostscript ++ stdenv.lib.optional stdenv.isDarwin [ Cocoa ]; propagatedBuildInputs = [ cycler dateutil numpy pyparsing tornado freetype kiwisolver libpng mock pytz ] - ++ stdenv.lib.optional (pythonOlder "3.3") backports_functools_lru_cache ++ stdenv.lib.optionals enableGtk3 [ cairo pycairo gtk3 gobject-introspection pygobject3 ] ++ stdenv.lib.optionals enableTk [ tcl tk tkinter libX11 ] ++ stdenv.lib.optionals enableQt [ pyqt5 ]; - patches = - [ ./basedirlist.patch ]; + setup_cfg = ./setup.cfg; + preBuild = '' + cp "$setup_cfg" ./setup.cfg + ''; # Matplotlib tries to find Tcl/Tk by opening a Tk window and asking the # corresponding interpreter object for its library paths. This fails if @@ -65,27 +63,14 @@ buildPythonPackage rec { stdenv.lib.optionalString enableTk "sed -i '/self.tcl_tk_cache = None/s|None|${tcl_tk_cache}|' setupext.py"; - checkPhase = '' - ${python.interpreter} tests.py - ''; - - # Test data is not included in the distribution (the `tests` folder - # is missing) + # Matplotlib needs to be built against a specific version of freetype in + # order for all of the tests to pass. doCheck = false; - prePatch = '' - # Failing test: ERROR: matplotlib.tests.test_style.test_use_url - sed -i 's/test_use_url/fails/' lib/matplotlib/tests/test_style.py - # Failing test: ERROR: test suite for <class 'matplotlib.sphinxext.tests.test_tinypages.TestTinyPages'> - sed -i 's/TestTinyPages/fails/' lib/matplotlib/sphinxext/tests/test_tinypages.py - # Transient errors - sed -i 's/test_invisible_Line_rendering/noop/' lib/matplotlib/tests/test_lines.py - ''; - meta = with stdenv.lib; { description = "Python plotting library, making publication quality plots"; homepage = "https://matplotlib.org/"; - maintainers = with maintainers; [ lovek323 ]; + maintainers = with maintainers; [ lovek323 veprbl ]; }; } diff --git a/pkgs/development/python-modules/matplotlib/setup.cfg b/pkgs/development/python-modules/matplotlib/setup.cfg new file mode 100644 index 0000000000000..6f81985efa446 --- /dev/null +++ b/pkgs/development/python-modules/matplotlib/setup.cfg @@ -0,0 +1,2 @@ +[directories] +basedirlist = . |