Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC refactored installation instruction #8240

Merged
merged 13 commits into from
Mar 23, 2017
Merged

DOC refactored installation instruction #8240

merged 13 commits into from
Mar 23, 2017

Conversation

NelleV
Copy link
Member

@NelleV NelleV commented Mar 8, 2017

This is a small refactoring of the installation instructions. I've mostly merged three files together and did some markup updates.

We now have only on README file, common to the three plateforms. The INSTALL file contains installation instructions for all plateform. It probably needs a bit of love.

Don't hesitate to edit the document directly.

Copy link
Member

@phobson phobson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this a good change. It'll be nice to have this all in one spot.

INSTALL Outdated
@@ -325,7 +325,32 @@ can get the libpng and freetype requirements (darwinports, fink,
/usr/X11R6) and the different architectures (e.g., x86, ppc, universal) and
the different OSX version (e.g., 10.4 and 10.5). We recommend that you build
the way we do for the OSX release: get the source from the tarball or the
git repository and follow the instruction in :file:`README.osx`.
git repository and install the required dependencies through a third-party
package manager: two widely used package managers are homebrew, and MacPorts.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest the was clarify that this whole section is for is when you're not using conda

Also suggest:
"through a third-party package manager such as homebrew <https://brew.sh/>_ or MacPorts <https://www.macports.org/>_"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this whole document needs to be consolidated.

INSTALL Outdated
without fiddling with environment variables::

# create a new environment with the required packages
conda create -n "matplotlib_build" python=3.4 numpy python-dateutil pyparsing pytz tornado "cycler>=0.10" tk libpng zlib freetype
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python=3.5 per the previous sentence?

INSTALL Outdated
Matplotlib and most of its dependencies all available as wheel packages for
OSX, windows and many linux distributions::

pip install -U numpy scipy scikit-learn
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this just be pip install -U matplotlib ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep it should… copy paste gone wrong.

INSTALL Outdated
optional Matplotlib backends and the capabilities they provide.

* :term:`tk` (>= 8.3, != 8.6.0 or 8.6.1): for the TkAgg backend;
* :term:`pyqt` (>= 4.4): for the Qt4Agg backend;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should mention qt5 as well. I could have sworn that this already said both...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

well… we have another section where we list dependencies: it is mentioned there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, there are many optional dependencies missing from this list. Aren't pycairo and pyside also optional dependencies?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

INSTALL Outdated
* `six <https://pypi.python.org/pypi/six>`_
* `backports.functools_lru_cache <https://pypi.python.org/pypi/backports.functools_lru_cache>`_
(for Python 2.7 only)
* `subprocess32 <https://pypi.python.org/pypi/subprocess32/>`_ (for Python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the '*nix' got dropped here.

@NelleV
Copy link
Member Author

NelleV commented Mar 11, 2017

So @tacaswell 's review underlined that we list dependencies twice: once for everything, and another time for windows. I'll try to consolidate this.

INSTALL Outdated

* :term:`tk` (>= 8.3, != 8.6.0 or 8.6.1): for the TkAgg backend;
* :term:`pyqt` (>= 4.4): for the Qt4Agg backend;
* :term:`pygtk` (>= 2.4): for the GTK and the GTKAgg backend;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did we lose pygtk3 at somepoint? I have lost track of exactly how that is packaged at this point...



Required libraries that ship with matplotlib
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should keep this section someplace.

@anntzer
Copy link
Contributor

anntzer commented Mar 11, 2017

Minor suggestion: can you rename INSTALL to INSTALL.rst? This will render it properly on github and syntax-highlight it correctly on editors that can.

This is also consistent with having README.rst.

@NelleV
Copy link
Member Author

NelleV commented Mar 11, 2017

I am wondering what people think of moving this file down to the documentation folder. It's barely readable as a text file as it has a lot of sphinx-specific syntax. We could then refer to it in the README.rst.

@tacaswell
Copy link
Member

There is a pretty strong tradition of having a top-level INSTALL file. Adding the rst extenstion is reasonable

@NelleV NelleV changed the title DOC refactored installation instruction [MRG] DOC refactored installation instruction Mar 11, 2017
@NelleV
Copy link
Member Author

NelleV commented Mar 11, 2017

OK, so I renamed it to INSTALL.rst.

I think this PR is good to go for a review. Our installation instructions do need a lot of love, and I think this is just a first pass on it.

INSTALL.rst Outdated
Matplotlib and most of its dependencies all available as wheel packages for
OSX, windows and many linux distributions::

pip install -U matplotlib
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true for linux and osx, but it'd be nice to check for windows!

INSTALL.rst Outdated
@@ -0,0 +1,363 @@
.. The source of this document is INSTALL. During the doc build process,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be updated.

@NelleV
Copy link
Member Author

NelleV commented Mar 16, 2017

@anntzer the command pip install matplotlib does work out of the box on windows. So I think everything is correct in this PR.

INSTALL.rst Outdated
Installing an official release
==============================

Matplotlib and most of its dependencies all available as wheel packages for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"are all"

INSTALL.rst Outdated
==============================

Matplotlib and most of its dependencies all available as wheel packages for
OSX, windows and many linux distributions::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and Linux distributions" (sure manylinux technically doesn't cover very old distros but I guess very old macos are likewise not supported too...)
(capitalize Linux for consistency with below)

INSTALL.rst Outdated
=======================================

Scientific Python distributions: Conda, Canopy...
--------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one too many "-"

INSTALL.rst Outdated
is packaged for almost every major Linux distribution.

* Debian / Ubuntu : ``sudo apt-get install python-matplotlib``
* Fedora / Redhat : ``sudo yum install python-matplotlib``
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Red Hat.

on Arch, sudo pacman -S python-matplotlib (if you care to add it)

Depending on the distro it may be either python-matplotlib/python2-matplotlib (e.g. Fedora, Arch) or python-matplotlib/python3-matplotlib. Check at https://pkgs.org/download/matplotlib.

INSTALL.rst Outdated

We strongly recommend using `scipy-stack compatible Python distributions
<http://www.scipy.org/install.html>`_ such as WinPython, Python(x,y),
Enthought Canopy, or Continuum Anaconda, which have Matplotlib and many of its
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and its dependencies ("many" implies some are missing?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine changing this (this was not written by me), though I have no clue whether all of these include all dependencies.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we shouldn't recommend Python(x,y) any more - it is only Python 2.7.

INSTALL.rst Outdated
* `ImageMagick <http://www.imagemagick.org/script/index.php>`__ (for saving
animated gifs);
* `Pillow <http://python-pillow.org/>`__ (for a larger selection of image
file format: JPEG, BMP, and TIFF image files);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"formats". Also only needed for reading, IIRC?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be surprising. I think it is for IO, but both reading and writing though I have no clue on that one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eh "I think it is for all IO, so both reading and writing"…

Copy link
Contributor

@anntzer anntzer Mar 16, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we can write to all these image formats, can we?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed we can't:

In [1]: fig, ax = plt.subplots()
a
In [2]: ax.plot(np.arange(100))
Out[2]: [<matplotlib.lines.Line2D at 0x7fe9a1b02048>]

In [3]: fig.savefig("test.jpeg")

In [4]: fig.savefig("test.bmp")
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-4-25b9508e5148> in <module>()
----> 1 fig.savefig("test.bmp")

/home/nelle/Projects/matplotlib/lib/matplotlib/figure.py in savefig(self, *args, **kwargs)
   1761             self.set_frameon(frameon)
   1762 
-> 1763         self.canvas.print_figure(*args, **kwargs)
   1764 
   1765         if frameon:

/home/nelle/Projects/matplotlib/lib/matplotlib/backend_bases.py in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs)
   2132 
   2133         # get canvas object and print method for format
-> 2134         canvas = self._get_output_canvas(format)
   2135         print_method = getattr(canvas, 'print_%s' % format)
   2136 

/home/nelle/Projects/matplotlib/lib/matplotlib/backend_bases.py in _get_output_canvas(self, format)
   2075         raise ValueError('Format "%s" is not supported.\n'
   2076                          'Supported formats: '
-> 2077                          '%s.' % (format, ', '.join(formats)))
   2078 
   2079     def print_figure(self, filename, dpi=None, facecolor=None, edgecolor=None,

ValueError: Format "bmp" is not supported.
Supported formats: eps, jpeg, jpg, pdf, pgf, png, ps, raw, rgba, svg, svgz, tif, tiff.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, more specifically, we can't write to BMP, but the rest is apparently fine (I do have pillow installed).

INSTALL.rst Outdated

The build situation on OSX is complicated by the various places one
can get the libpng and freetype requirements (darwinports, fink,
/usr/X11R6) and the different architectures (e.g., x86, ppc, universal) and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and" -> ","
plus a second comma before the last "and" if you like oxford commas.

INSTALL.rst Outdated
the different OSX version (e.g., 10.4 and 10.5). We recommend that you build
the way we do for the OSX release: get the source from the tarball or the
git repository and install the required dependencies through a third-party
package manager: two widely used package managers are homebrew, and MacPorts.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two colons in this sentence.

INSTALL.rst Outdated
The following example illustrates how to install libpng and freetype using
brew:

Example usage::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove "example usage" here and below, tuck the :: to the previous paragraph.

INSTALL.rst Outdated

The commands below assume that you can compile a native python lib for the python version of your
choice. See `this howto <http://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/>`_
how to install and setup such environments. If in doubt: use python 3.5 as it mostly works
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.5+

@NelleV
Copy link
Member Author

NelleV commented Mar 16, 2017

Thanks for the review @anntzer . I fixed most of the comments.

Alt Text

Copy link
Contributor

@anntzer anntzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just added a few more (tiny) apples

For `standard Python <https://www.python.org/downloads/>`_ installations,
install Matplotlib using pip_::

python -m pip install -U pip setuptools
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make this pip install ... as well for consistency with above then?

README.rst Outdated
Matplotlib is a Python 2D plotting library which produces publication-quality
figures in a variety of hardcopy formats and interactive environments across
platforms. Matplotlib can be used in Python scripts, the Python and IPython
shell (ala MATLAB or Mathematica), web application servers, and various
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you know how to spell "à la" (it's correct even in English, see https://en.wiktionary.org/wiki/%C3%A0_la)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QuLogic is going to do a pass over it, but it might be easier for me to fix this one considering my awesome french keyboard (Yéǎh¡!).
I'll do another pass tonight to check for this particular point )

Copy link
Member

@QuLogic QuLogic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will make the minor modifications directly, but here are some wider reaching comments.

INSTALL.rst Outdated
==============================

Matplotlib and most of its dependencies arr all available as wheel packages for
OSX, windows and Linux distributions::
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we change OSX to macOS?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so, yes.

INSTALL.rst Outdated

Since there is no canonical Windows package manager, the methods for building
freetype, zlib, and libpng from source code are documented as a build script
at `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild>`_.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we import this into the Matplotlib organization?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am actually slightly worried that this repository is totally out of date. It hasn't bee updated in 2014, so there is maybe a bit of work to be done to have the scripts run.

INSTALL.rst Outdated
at `matplotlib-winbuild <https://github.com/jbmohler/matplotlib-winbuild>`_.


There are a few possibilities to build matplotlib on Windows:
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matplotlib -> Matplotlib

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, I've fixed all of these (locally).

INSTALL.rst Outdated
:ref:`install the latest development version<install_from_source>`.


.. contents..
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should. It is really strange that it compiled properly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turned into a comment (which explains the colour on GitHub now.)

@NelleV
Copy link
Member Author

NelleV commented Mar 19, 2017

@anntzer It's fixed.

@NelleV NelleV changed the title [MRG] DOC refactored installation instruction [MRG+1] DOC refactored installation instruction Mar 20, 2017
README.rst Outdated

For installation instructions and requirements, see the INSTALL file or the `install <http://matplotlib.org/users/installing.html>`_ documentation. If you think you may want to contribute to matplotlib, check out the `guide to working with the source code <http://matplotlib.org/devel/gitwash/index.html>`_.
For installation instructions and requirements, see the INSTALL file or the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't it called INSTALL.rst in this PR now?

@phobson phobson merged commit 43ac39b into matplotlib:master Mar 23, 2017
@phobson phobson changed the title [MRG+1] DOC refactored installation instruction DOC refactored installation instruction Mar 23, 2017
@QuLogic QuLogic added this to the 2.1 (next point release) milestone Mar 23, 2017
@NelleV NelleV deleted the installation_instructions branch April 8, 2017 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants