1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-02-16 07:48:58 +00:00

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
This commit is contained in:
Dmitry Kalinkin 2020-04-21 01:56:13 -04:00 committed by GitHub
parent fe07e2b2ac
commit c7d4882ab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 62 deletions

View file

@ -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 ];
};
}

View file

@ -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 = .

View file

@ -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 ];
};
}

View file

@ -0,0 +1,2 @@
[directories]
basedirlist = .