Skip to content

DOC: developer tips guide incomplete (for complete newbie) #9355

Closed

Description

@mattip

I am trying to run the matplotlib tests on Ubuntu 16.04 in a virtualenv. I am following the instructions on the developer's tips for testing page but am having problems getting started I will gladly submit a documentation pull request, but want to know if I am in the right direction.

It seems I need to pip install additional packages:

  • numpy
  • pyparsing
  • backports.functools_lru_cache
  • sphinx (for tests/tinypages, which does not have a skip if no sphinx)

Is pdflatex a recomendation?

There is no description of how to build matplotlib. I simply did python setup.py build_ext -i but then needed to run tests with PYTHONPATH=lib python -mpytest lib/matplotlib. IMO this should be described just after the section describing how to set setup.cfg

Once I did that, tests started running.

I have pdflatex installed, the test_backend_pgf::test_pdflatex image comparison test failed. I did verify that the build_ext command linked in the correct local libfreetype.a. Is the failure normal? If so I would also add that to the documentation, if not I would appreciate tips how to fix it. Maybe I am missing a font or two?

Matplotlib version

  • Operating system: Ubuntu 16.04
  • Matplotlib version: HEAD
  • Matplotlib backend (print(matplotlib.get_backend())): tkagg
  • Python version: 2.7.12
  • Jupyter version (if applicable): NA
  • Other libraries:

This is from a clean virtualenv, with only pytest, mock installed, and Ghostscript, Inkscape apt installed as per instructions.

Activity

  1. anntzer commented on Oct 11, 2017

    @anntzer
    Contributor

    A doc PR would be most welcome, of course!

    • I would make it clear that setting up a venv is the way to go. Alternatively, you should at least install (or pip install -e) matplotlib before running the tests, but I would guess most mpl devs also use mpl in a day to day basis for other tasks and may not want to run mpl master for these.
      The issue with setting PYTHONPATH is that due to the way namespace packages are implemented in pth files, globally installed toolkits will override toolkits available from PYTHONPATH.
      So it's either 1) run the tests off an installed mpl, or 2) set PYTHONPATH but do not have mpl installed in the same environment. In practice it seems simpler to document "install mpl in a venv with pip install -e .".

    • You probably need all non-Python dependencies documented at http://matplotlib.org/users/installing.html#dependencies.

    • test_pdflatex should effectively not rely on freetype (ghostscript is in charge of the font rendering). Can you post the failing images (tools/triage_tests.py may be helpful -- should be documented too)? Do they look like "small" rendering issues or a missing font?

    Note that master docs are rendered at http://matplotlib.org/devdocs.

  2. anntzer commented on Oct 19, 2017

    @anntzer
    Contributor

    I think this is closed by #9378, but feel free to ask more questions (gitter may be a faster place to do so).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions