From 5572869764a6314e6cff6ebf63f134a008340c5a Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 13 Nov 2017 13:46:25 -0600 Subject: [PATCH 1/5] MNT: Clean up AppVeyor a bit Upload coverage as part of post processing rather than test script. Also remove duplicated command to visualize test results. --- .appveyor.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index af3d322e8eae..7849ae0087a8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -134,10 +134,6 @@ test_script: # tests - echo The following args are passed to pytest %PYTEST_ARGS% - python tests.py %PYTEST_ARGS% - # Generate a html for visual tests - - python tools/visualize_tests.py --no-browser - - pip install codecov - - codecov -e PYTHON_VERSION PLATFORM after_test: # After the tests were a success, build packages (wheels and conda) @@ -174,8 +170,11 @@ artifacts: type: zip on_finish: + - pip install codecov + - codecov -e PYTHON_VERSION PLATFORM on_failure: + # Generate a html for visual tests - python tools/visualize_tests.py --no-browser - echo zipping images after a failure... - 7z a result_images.zip result_images\ | grep -v "Compressing" From 9c34260025472a7af1f984c1855d9e9fb70b6deb Mon Sep 17 00:00:00 2001 From: Ryan May Date: Tue, 14 Nov 2017 11:37:44 -0700 Subject: [PATCH 2/5] Make sure AppVeyor exits if test script fails --- .appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.appveyor.yml b/.appveyor.yml index 7849ae0087a8..b217b80d113a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -96,7 +96,7 @@ install: # https://github.com/matplotlib/matplotlib/issues/9176 - python -c "import sys; sys.exit(not (3,) < sys.version_info < (3,6,3))" && ( curl -sL https://github.com/python/cpython/pull/1224.patch | - patch -fsup 1 -d %CONDA_PREFIX% ) || ( set errorlevel= ) + patch -fsup 1 -d %CONDA_PREFIX% ) || cmd /c "exit /b 0" # Let the install prefer the static builds of the libs - set LIBRARY_LIB=%CONDA_PREFIX%\Library\lib From 84a1c0d9c81e822ff684959ff6297170b3b3a3bb Mon Sep 17 00:00:00 2001 From: Ryan May Date: Thu, 16 Nov 2017 22:53:13 -0700 Subject: [PATCH 3/5] MNT: Fix test failures from string representations --- lib/matplotlib/tests/test_preprocess_data.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/matplotlib/tests/test_preprocess_data.py b/lib/matplotlib/tests/test_preprocess_data.py index 633ce5983914..553f9e21b554 100644 --- a/lib/matplotlib/tests/test_preprocess_data.py +++ b/lib/matplotlib/tests/test_preprocess_data.py @@ -2,6 +2,7 @@ import re +import numpy as np import pytest from matplotlib import _preprocess_data @@ -165,7 +166,9 @@ def test_function_call_with_pandas_data(func): """test with pandas dataframe -> label comes from data["col"].name """ pd = pytest.importorskip('pandas') - data = pd.DataFrame({"a": [1, 2], "b": [8, 9], "w": ["NOT", "NOT"]}) + data = pd.DataFrame({"a": np.array([1, 2], dtype=np.int32), + "b": np.array([8, 9], dtype=np.int32), + "w": ["NOT", "NOT"]}) assert (func(None, "a", "b", data=data) == "x: [1, 2], y: [8, 9], ls: x, w: xyz, label: b") From 5edaadb3a913d79c44910c9283c0d54b765c8f8d Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 20 Nov 2017 15:39:44 -0700 Subject: [PATCH 4/5] MNT: Remove conda recipe Just defer to the conda-forge recipe, since that's what's really being used. Also stop building conda packages on AppVeyor to save some build time. --- .appveyor.yml | 61 +++++------------------- ci/conda_recipe/README.md | 3 -- ci/conda_recipe/bld.bat | 16 ------- ci/conda_recipe/build.sh | 37 --------------- ci/conda_recipe/cfg_qt4agg.patch | 13 ------ ci/conda_recipe/condaversion.patch | 15 ------ ci/conda_recipe/meta.yaml | 75 ------------------------------ ci/conda_recipe/osx-tk.patch | 60 ------------------------ ci/conda_recipe/rctmp_pyside.patch | 19 -------- ci/conda_recipe/run_test.py | 28 ----------- 10 files changed, 11 insertions(+), 316 deletions(-) delete mode 100644 ci/conda_recipe/README.md delete mode 100644 ci/conda_recipe/bld.bat delete mode 100644 ci/conda_recipe/build.sh delete mode 100644 ci/conda_recipe/cfg_qt4agg.patch delete mode 100644 ci/conda_recipe/condaversion.patch delete mode 100644 ci/conda_recipe/meta.yaml delete mode 100644 ci/conda_recipe/osx-tk.patch delete mode 100644 ci/conda_recipe/rctmp_pyside.patch delete mode 100644 ci/conda_recipe/run_test.py diff --git a/.appveyor.yml b/.appveyor.yml index b217b80d113a..e663063a8205 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -11,41 +11,26 @@ branches: environment: global: - # SDK v7.0 MSVC Express 2008's SetEnv.cmd script will fail if the - # /E:ON and /V:ON options are not enabled in the batch script intepreter - # See: http://stackoverflow.com/a/13751649/163740 - CMD_IN_ENV: cmd /E:ON /V:ON /C obvci_appveyor_python_build_env.cmd - # Workaround for https://github.com/conda/conda-build/issues/636 PYTHONIOENCODING: UTF-8 PYTEST_ARGS: -rawR --numprocesses=auto --timeout=300 --durations=25 --cov-report= --cov=lib -m "not network" matrix: - # for testing purpose: numpy 1.8 on py2.7, for the rest use 1.10/latest # theoretically the CONDA_INSTALL_LOCN could be only two: one for 32bit, # one for 64bit because we construct envs anyway. But using one for the # right python version is hopefully making it fast due to package caching. - - TARGET_ARCH: "x64" - CONDA_PY: "27" - CONDA_NPY: "18" - PYTHON_VERSION: "2.7" - TEST_ALL: "no" + - PYTHON_VERSION: "2.7" CONDA_INSTALL_LOCN: "C:\\Miniconda-x64" - - TARGET_ARCH: "x64" - CONDA_PY: "35" - CONDA_NPY: "110" - PYTHON_VERSION: "3.5" + TEST_ALL: "no" + - PYTHON_VERSION: "3.5" CONDA_INSTALL_LOCN: "C:\\Miniconda35-x64" TEST_ALL: "no" - - TARGET_ARCH: "x64" - CONDA_PY: "36" - PYTHON_VERSION: "3.6" - CONDA_NPY: "111" + - PYTHON_VERSION: "3.6" CONDA_INSTALL_LOCN: "C:\\Miniconda36-x64" TEST_ALL: "no" # We always use a 64-bit machine, but can build x86 distributions -# with the PYTHON_ARCH variable (which is used by CMD_IN_ENV). +# with the PYTHON_ARCH variable platform: - x64 @@ -62,16 +47,11 @@ init: install: - set PATH=%CONDA_INSTALL_LOCN%;%CONDA_INSTALL_LOCN%\scripts;%PATH%; - set PYTHONUNBUFFERED=1 - # for obvci_appveyor_python_build_env.cmd - - conda update --all --yes - - conda install anaconda-client=1.6.3 --yes - - conda install -c conda-forge --yes obvious-ci # for msinttypes and newer stuff - - conda config --prepend channels conda-forge - - conda config --set show_channel_urls yes - conda config --set always_yes true - # For building conda packages - - conda install --yes conda-build jinja2 anaconda-client + - conda update --all + - conda config --set show_channel_urls yes + - conda config --prepend channels conda-forge # this is now the downloaded conda... - conda info -a @@ -116,7 +96,7 @@ install: test_script: # Now build the thing.. - - '%CMD_IN_ENV% pip install -ve .' + - pip install -ve . # these should show no z, png, or freetype dll... - set "DUMPBIN=%VS140COMNTOOLS%\..\..\VC\bin\dumpbin.exe" - '"%DUMPBIN%" /DEPENDENTS lib\matplotlib\ft2font*.pyd | findstr freetype.*.dll && exit /b 1 || exit /b 0' @@ -136,28 +116,9 @@ test_script: - python tests.py %PYTEST_ARGS% after_test: - # After the tests were a success, build packages (wheels and conda) - - # Build the wheel with the static libs + # After the tests were a success, build wheels with the static libs # Hide the output, the copied files really clutter the build log... - - '%CMD_IN_ENV% python setup.py bdist_wheel > NUL:' - - # And now the conda build after a cleanup... - # cleanup build files so that they don't pollute the conda build but keep the wheel in dist... - - git clean -xdfq -e dist/ - # cleanup the environment so that the test-environment does not leak into the conda build... - - set MPLBASEDIRLIST= - - set LIBRARY_LIB= - - deactivate - - path - - where python - - '%CMD_IN_ENV% conda config --get channels' - - '%CMD_IN_ENV% conda build -q .\ci\conda_recipe' - - # Move the conda package into the dist directory, to register it - # as an "artifact" for Appveyor. - - copy /y %CONDA_INSTALL_LOCN%\conda-bld\win-32\*.bz2 dist || cmd /c "exit /b 0" - - copy /y %CONDA_INSTALL_LOCN%\conda-bld\win-64\*.bz2 dist || cmd /c "exit /b 0" + - 'python setup.py bdist_wheel > NUL:' - dir dist\ - echo finished... diff --git a/ci/conda_recipe/README.md b/ci/conda_recipe/README.md deleted file mode 100644 index 7819c9f0c766..000000000000 --- a/ci/conda_recipe/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# conda package - -Up to now, this is mainly used to build a test conda package on windows on appveyor. \ No newline at end of file diff --git a/ci/conda_recipe/bld.bat b/ci/conda_recipe/bld.bat deleted file mode 100644 index a7810d418d2f..000000000000 --- a/ci/conda_recipe/bld.bat +++ /dev/null @@ -1,16 +0,0 @@ -set LIBPATH=%LIBRARY_LIB%; -set INCLUDE=%INCLUDE%;%PREFIX%\Library\include\freetype2 - -ECHO [directories] > setup.cfg -ECHO basedirlist = %LIBRARY_PREFIX% >> setup.cfg -ECHO [packages] >> setup.cfg -ECHO tests = False >> setup.cfg -ECHO sample_data = False >> setup.cfg -ECHO toolkits_tests = False >> setup.cfg - -@rem workaround for https://github.com/matplotlib/matplotlib/issues/6460 -@rem see also https://github.com/conda-forge/libpng-feedstock/pull/4 -copy /y %LIBRARY_LIB%\libpng16.lib %LIBRARY_LIB%\png.lib - -%PYTHON% setup.py install --single-version-externally-managed --record=record.txt -if errorlevel 1 exit 1 diff --git a/ci/conda_recipe/build.sh b/ci/conda_recipe/build.sh deleted file mode 100644 index c2967acb98cf..000000000000 --- a/ci/conda_recipe/build.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -if [ `uname` == Linux ]; then - pushd $PREFIX/lib - ln -s libtcl8.5.so libtcl.so - ln -s libtk8.5.so libtk.so - popd -fi - -cat < setup.cfg -[directories] -basedirlist = $PREFIX - -[packages] -tests = False -toolkit_tests = False -sample_data = False - -EOF - -# The macosx backend isn't building with conda at this stage. -if [ `uname` == Darwin ]; then -cat << EOF >> setup.cfg - -[gui_support] -tkagg = true -macosx = false - -EOF -fi - -cat setup.cfg -sed -i.bak "s|/usr/local|$PREFIX|" setupext.py - - -$PYTHON setup.py install --single-version-externally-managed --record=record.txt - diff --git a/ci/conda_recipe/cfg_qt4agg.patch b/ci/conda_recipe/cfg_qt4agg.patch deleted file mode 100644 index 16e6fc6c3934..000000000000 --- a/ci/conda_recipe/cfg_qt4agg.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git setup.cfg.template setup.cfg.template -index cae6f67..fd11c79 100644 ---- setup.cfg.template -+++ setup.cfg.template -@@ -88,7 +88,7 @@ - # if you have disabled the relevent extension modules. Agg will be used - # by default. - # --#backend = Agg -+backend = Qt4Agg - # - - [package_data] diff --git a/ci/conda_recipe/condaversion.patch b/ci/conda_recipe/condaversion.patch deleted file mode 100644 index 915fda3bcc23..000000000000 --- a/ci/conda_recipe/condaversion.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git setup.py setup.py -index 8af8b6d..4e4f9d2 100644 ---- setup.py -+++ setup.py -@@ -57,6 +57,9 @@ - import versioneer - __version__ = versioneer.get_version() - -+# For conda builds... -+with open("__conda_version__.txt", "w") as f: -+ f.write(__version__) - - # These are the packages in the order we want to display them. This - # list may contain strings to create section headers for the display. - \ No newline at end of file diff --git a/ci/conda_recipe/meta.yaml b/ci/conda_recipe/meta.yaml deleted file mode 100644 index ad3c80da231f..000000000000 --- a/ci/conda_recipe/meta.yaml +++ /dev/null @@ -1,75 +0,0 @@ -# Full credit goes to https://github.com/conda/conda-recipes for providing this recipe. -# It has been subsequently adapted for automated building with conda-forge and matplotlib. - -package: - name: matplotlib - version: 1.9.9 - -source: - path: ../../ - - patches: - # A patch to make Qt4Agg the default backend. - - cfg_qt4agg.patch # [linux] - # Patches the matplotlibrc template to default to Qt4. - - rctmp_pyside.patch # [not osx] - # dynamic version from git - # we can't use condas usual dynamic versions as setup.py uses - # multiprocessing during the configure stage and this seems to confuse conda-build. - # https://github.com/conda/conda-build/issues/1061 - - condaversion.patch - - -requirements: - build: - - python - - setuptools - - pkg-config # [not win] - - numpy x.x - - python-dateutil - - freetype 2.6* - - msinttypes # [win] - - cycler >=0.10 - - pytest >=3.0.0 - - pyparsing - - pytz -# - py2cairo # [linux and py2k] - - tornado - - libpng >=1.6.21,<1.7 - - zlib 1.2* # [win] - - pyqt # [not osx] - - tk 8.5* # [linux] - - backports.functools_lru_cache # [py2k] - - run: - - python - - numpy x.x - - cycler >=0.10 - - python-dateutil - - freetype 2.6* - - pytz - - pyparsing -# - py2cairo # [linux and py2k] - - qt 4* - - libpng >=1.6.21,<1.7 - - pyqt # [not osx] - - tk 8.5* # [linux and win] - - backports.functools_lru_cache # [py2k] - -test: - imports: - - matplotlib - - matplotlib.pyplot - -about: - home: http://matplotlib.org/ - license: PSF-based (http://matplotlib.org/users/license.html) - summary: Publication quality figures in Python - -extra: - recipe-maintainers: - - janschulz # only in the mpl repository - - mdboom # rest form conda-forge - - ocefpaf - - pelson - - tacaswell diff --git a/ci/conda_recipe/osx-tk.patch b/ci/conda_recipe/osx-tk.patch deleted file mode 100644 index 1411225550e9..000000000000 --- a/ci/conda_recipe/osx-tk.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff --git setupext.py setupext.py -index ddf2ca1..b9e0729 100755 ---- setupext.py -+++ setupext.py -@@ -1659,52 +1659,11 @@ class BackendTkAgg(OptionalBackendPackage): - ext.library_dirs.extend([os.path.join(sys.prefix, 'dlls')]) - - elif sys.platform == 'darwin': -- # this config section lifted directly from Imaging - thanks to -- # the effbot! -- -- # First test for a MacOSX/darwin framework install - from os.path import join, exists -- framework_dirs = [ -- join(os.getenv('HOME'), '/Library/Frameworks'), -- '/Library/Frameworks', -- '/System/Library/Frameworks/', -- ] - -- # Find the directory that contains the Tcl.framework and -- # Tk.framework bundles. -- tk_framework_found = 0 -- for F in framework_dirs: -- # both Tcl.framework and Tk.framework should be present -- for fw in 'Tcl', 'Tk': -- if not exists(join(F, fw + '.framework')): -- break -- else: -- # ok, F is now directory with both frameworks. Continure -- # building -- tk_framework_found = 1 -- break -- if tk_framework_found: -- # For 8.4a2, we must add -I options that point inside -- # the Tcl and Tk frameworks. In later release we -- # should hopefully be able to pass the -F option to -- # gcc, which specifies a framework lookup path. -- -- tk_include_dirs = [ -- join(F, fw + '.framework', H) -- for fw in ('Tcl', 'Tk') -- for H in ('Headers', 'Versions/Current/PrivateHeaders') -- ] -- -- # For 8.4a2, the X11 headers are not included. Rather -- # than include a complicated search, this is a -- # hard-coded path. It could bail out if X11 libs are -- # not found... -- -- # tk_include_dirs.append('/usr/X11R6/include') -- frameworks = ['-framework', 'Tcl', '-framework', 'Tk'] -- ext.include_dirs.extend(tk_include_dirs) -- ext.extra_link_args.extend(frameworks) -- ext.extra_compile_args.extend(frameworks) -+ ext.include_dirs.append(join(sys.prefix, 'include')) -+ ext.libraries.extend(['tk8.5', 'tcl8.5']) -+ ext.library_dirs.append(join(sys.prefix, 'lib')) - - # you're still here? ok we'll try it this way... - else: diff --git a/ci/conda_recipe/rctmp_pyside.patch b/ci/conda_recipe/rctmp_pyside.patch deleted file mode 100644 index c5541f8064c5..000000000000 --- a/ci/conda_recipe/rctmp_pyside.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff --git a/matplotlibrc.template b/matplotlibrc.template -index 2f0e5c4..c9b6e49 100644 ---- a/matplotlibrc.template -+++ b/matplotlibrc.template -@@ -38,12 +38,12 @@ - # - # If you omit this parameter, it will always default to "Agg", which is a - # non-interactive backend. --backend : $TEMPLATE_BACKEND -+backend : Qt4Agg - - # If you are using the Qt4Agg backend, you can choose here - # to use the PyQt4 bindings or the newer PySide bindings to - # the underlying Qt4 toolkit. --#backend.qt4 : PyQt4 # PyQt4 | PySide -+backend.qt4 : PyQt4 # PyQt4 | PySide - - # Note that this can be overridden by the environment variable - # QT_API used by Enthought Tool Suite (ETS); valid values are diff --git a/ci/conda_recipe/run_test.py b/ci/conda_recipe/run_test.py deleted file mode 100644 index 5b3d95d1174f..000000000000 --- a/ci/conda_recipe/run_test.py +++ /dev/null @@ -1,28 +0,0 @@ -import os -import platform -import sys - -import matplotlib -import matplotlib.pyplot -import matplotlib._cntr -import matplotlib._image -import matplotlib._path -import matplotlib._png -import matplotlib._tri -import matplotlib.backends._backend_agg -import matplotlib.ft2font -import matplotlib.ttconv -if platform.system() not in ['Windows']: - import matplotlib.backends._tkagg - -import pylab -import mpl_toolkits - -if int(os.getenv('GUI_TEST', 0)): - assert matplotlib.rcParams['backend.qt4'] == 'PyQt4' - - import matplotlib.pyplot as plt - plt.ioff() - plt.title('If this window displays, success: CLOSE TO CONTINUE TESTS') - plt.plot([1,2,5,9]) - plt.show() From 16512eef323182b300140c3a12c0b1aef44bf988 Mon Sep 17 00:00:00 2001 From: Ryan May Date: Mon, 20 Nov 2017 15:45:48 -0700 Subject: [PATCH 5/5] MNT: Remove AppVeyor workaround for Python 3.4 We're not using here any more. --- .appveyor.yml | 4 ---- ci/appveyor/vcvars64.bat | 1 - 2 files changed, 5 deletions(-) delete mode 100644 ci/appveyor/vcvars64.bat diff --git a/.appveyor.yml b/.appveyor.yml index e663063a8205..a2a0f9f8c34b 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -55,10 +55,6 @@ install: # this is now the downloaded conda... - conda info -a - # Fix the appveyor build environment to work with conda build - # workaround for missing vcvars64.bat in py34 64bit - - copy ci\appveyor\vcvars64.bat "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64" - # For building, use a new environment which only includes the requirements for mpl # same things as the requirements in ci/conda_recipe/meta.yaml # if conda-forge gets a new pyqt, it might be nice to install it as well to have more backends diff --git a/ci/appveyor/vcvars64.bat b/ci/appveyor/vcvars64.bat deleted file mode 100644 index c4659becc3ae..000000000000 --- a/ci/appveyor/vcvars64.bat +++ /dev/null @@ -1 +0,0 @@ -CALL "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" /x64 \ No newline at end of file