diff --git a/.appveyor.yml b/.appveyor.yml index a163f42f115e..7f47d15f2300 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -66,8 +66,7 @@ install: - activate test-environment - echo %PYTHON_VERSION% %TARGET_ARCH% # pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124 - - pip install -q "pytest!=3.3.0,>=3.2.0,<3.8" "pytest-cov>=2.3.1" - pytest-rerunfailures pytest-timeout pytest-xdist + - pip install -q "pytest>=3.6.1" "pytest-cov>=2.3.1" pytest-rerunfailures pytest-timeout pytest-xdist # Apply patch to `subprocess` on Python versions > 2 and < 3.6.3 # https://github.com/matplotlib/matplotlib/issues/9176 diff --git a/.travis.yml b/.travis.yml index cbf1c9624684..70e130caf038 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,9 @@ language: python dist: xenial sudo: false +services: + - xvfb + branches: except: - /^auto-backport-of-pr-\d*/ @@ -37,6 +40,7 @@ addons: - texlive-latex-extra - texlive-latex-recommended - texlive-xetex + - xvfb env: global: @@ -53,9 +57,7 @@ env: - PANDAS= - PILLOW=pillow - PYPARSING=pyparsing - # pytest-timeout master depends on pytest>=3.6. Testing with pytest 3.1 is - # still supported; this is tested by the first matrix entry. - - PYTEST='pytest>=3.6,<3.8' + - PYTEST='pytest>=3.6.1' - PYTEST_COV=pytest-cov - PYTEST_RERUNFAILURES=pytest-rerunfailures - PYTEST_PEP8= @@ -72,6 +74,7 @@ matrix: include: - python: 2.7 # pytest-cov>=2.3.1 due to https://github.com/pytest-dev/pytest-cov/issues/124. + # pytest>=3.6.1 due to https://github.com/pytest-dev/pytest/commit/b5a94d8e6c49201c8c79a7c52b8466e020e6d6b8 env: - CYCLER=cycler==0.10 - DATEUTIL=python-dateutil==2.1 @@ -80,10 +83,10 @@ matrix: - NUMPY=numpy==1.7.1 - PANDAS='pandas<0.21.0' - PYPARSING=pyparsing==2.0.1 - - PYTEST=pytest==3.1.0 + - PYTEST=pytest==3.6.1 - PYTEST_COV=pytest-cov==2.3.1 + - PYTEST_RERUNFAILURES='pytest-rerunfailures<6' # 6 needs pytest >=3.8 - PYTEST_TIMEOUT=pytest-timeout==1.2.1 # Newer pytest-timeouts don't support pytest <3.4. - - PYTEST_RERUNFAILURES='pytest-rerunfailures<5' # 5 needs pytest>=3.6 - SPHINX=sphinx==1.3 - python: 3.4 env: PYTHON_ARGS=-OO @@ -122,7 +125,7 @@ before_install: else brew update brew tap homebrew/gui - brew install python libpng ffmpeg imagemagick mplayer ccache + # brew install python libpng ffmpeg imagemagick mplayer ccache # We could install ghostscript and inkscape here to test svg and pdf # but this makes the test time really long. # brew install ghostscript inkscape @@ -189,12 +192,6 @@ install: # Install matplotlib pip install -ve . -before_script: - - | - if [[ $TRAVIS_OS_NAME != 'osx' ]]; then - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start - fi script: ci/travis/test_script.sh diff --git a/doc/devel/contributing.rst b/doc/devel/contributing.rst index 35f376beea66..b8656535bc08 100644 --- a/doc/devel/contributing.rst +++ b/doc/devel/contributing.rst @@ -109,7 +109,7 @@ value. Installing Matplotlib in developer mode --------------------------------------- -To install Matplotlib (and compile the c-extensions) run the following +To install Matplotlib (and compile the C-extensions) run the following command from the top-level directory :: python -mpip install -ve . @@ -148,11 +148,11 @@ environment is set up properly:: .. _pep8: https://pep8.readthedocs.io/en/latest/ .. _mock: https://docs.python.org/dev/library/unittest.mock.html .. _Ghostscript: https://www.ghostscript.com/ -.. _Inkscape: https://inkscape.org> +.. _Inkscape: https://inkscape.org/ .. note:: - **Additional dependencies for testing**: pytest_ (version 3.1 or later), + **Additional dependencies for testing**: pytest_ (version 3.6 or later), mock_ (if Python 2), Ghostscript_, Inkscape_ .. seealso:: diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst index 8334a132a74a..03ca5c9bdec6 100644 --- a/doc/devel/testing.rst +++ b/doc/devel/testing.rst @@ -22,11 +22,11 @@ Requirements Install the latest version of Matplotlib as documented in :ref:`installing_for_devs` In particular, follow the instructions to use a -local FreeType build +local FreeType build. The following software is required to run the tests: - - pytest_ (>=3.1) + - pytest_ (>=3.6) - mock_, when running Python 2 - Ghostscript_ (to render PDF files) - Inkscape_ (to render SVG files) diff --git a/lib/matplotlib/backends/backend_agg.py b/lib/matplotlib/backends/backend_agg.py index aff6cddf492d..491a9b2c5d6b 100644 --- a/lib/matplotlib/backends/backend_agg.py +++ b/lib/matplotlib/backends/backend_agg.py @@ -391,7 +391,7 @@ def post_processing(image, dpi): self._update_methods() if w > 0 and h > 0: - img = np.fromstring(buffer, np.uint8) + img = np.frombuffer(buffer, np.uint8) img, ox, oy = post_processing(img.reshape((h, w, 4)) / 255., self.dpi) gc = self.new_gc() diff --git a/lib/matplotlib/dates.py b/lib/matplotlib/dates.py index 2712d64291a7..290341146d85 100644 --- a/lib/matplotlib/dates.py +++ b/lib/matplotlib/dates.py @@ -1369,10 +1369,9 @@ def get_locator(self, dmin, dmax): else: locator = MicrosecondLocator(interval, tz=self.tz) if dmin.year > 20 and interval < 1000: - _log.warn('Plotting microsecond time intervals is not' - ' well supported. Please see the' - ' MicrosecondLocator documentation' - ' for details.') + _log.warning('Plotting microsecond time intervals is not well ' + 'supported. Please see the MicrosecondLocator ' + 'documentation for details.') locator.set_axis(self.axis) diff --git a/lib/matplotlib/image.py b/lib/matplotlib/image.py index 58a28c8f689a..3bdcccf48821 100644 --- a/lib/matplotlib/image.py +++ b/lib/matplotlib/image.py @@ -1447,9 +1447,9 @@ def pil_to_array(pilImage): # return MxN luminance array of uint16 raw = pilImage.tobytes('raw', pilImage.mode) if pilImage.mode.endswith('B'): - x = np.fromstring(raw, '>u2') + x = np.frombuffer(raw, '>u2') else: - x = np.fromstring(raw, '