8000 DOC: reorganize and simplify contributing.rst · matplotlib/matplotlib@fc4f3f3 · GitHub
[go: up one dir, main page]

Skip to content

Commit fc4f3f3

Browse files
committed
DOC: reorganize and simplify contributing.rst
- only provide one installation direction - put details about local testing at the top
1 parent 4c2a412 commit fc4f3f3

File tree

1 file changed

+46
-40
lines changed

1 file changed

+46
-40
lines changed

doc/devel/contributing.rst

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -21,44 +21,62 @@ also welcome to post feature requests or pull requests.
2121
Retrieving and installing the latest version of the code
2222
========================================================
2323

24+
When working on the Matplotlib source, setting up a `virtual
25+
environment
26+
<http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_ or a
27+
`conda environment <http://conda.pydata.org/docs/using/envs.html>`_ is
28+
recommended.
29+
30+
.. warning::
31+
32+
If you already have a version of matplotlib installed, you will need to
33+
uninstall it.
2434

2535
We use `Git <https://git-scm.com/>`_ for version control and
2636
`GitHub <https://github.com/>`_ for hosting our main repository.
2737

28-
You can check out the latest sources with the command::
38+
You can check out the latest sources with the command (see
39+
:ref:`set-up-fork` for more details)::
2940

3041
git clone git@github.com:matplotlib/matplotlib.git
3142

43+
and navigate to the matplotlib directory.
3244

33-
After obtaining a local copy of the matplotlib source code (:ref:`set-up-fork`),
34-
navigate to the matplotlib directory and run the following in the shell::
35-
36-
python setup.py develop
45+
To make sure the tests run locally you must build against the correct version
46+
of freetype. To configure the build system to fetch and build it either export
47+
the env ``MPLLOCALFREETYPE`` as::
3748

38-
or::
39-
40-
pip install -v -e .
49+
export MPLLOCALFREETYPE=1
4150

51+
or copy :file:`setup.cfg.template` to :file:`setup.cfg` and edit to contain ::
4252

43-
This installs matplotlib for development (i.e., builds everything and places the
44-
symbolic links back to the source code).
53+
[test]
54+
local_freetype = True
4555

46-
.. warning::
4756

48-
If you already have a version of matplotlib installed, you will need to
49-
uninstall it.
57+
To install Matplotlib (and compile the c-extensions) run the following
58+
command from the top-level directory ::
5059

60+
pip install -v -e ./
5161

52-
.. note::
53-
54-
If you decide to do install with ``python setup.py develop`` or ``pip
55-
install -v -e``, you will have to rerun::
56-
57-
python setup.py build
62+
This installs Matplotlib in 'editable/develop mode', i.e.,
63+
builds everything and places symbolic links back to the source code
64+
from the install directory. Thus, any changes to the ``*.py`` files
65+
will be reflected the next time you import the library. If you change
66+
the c-extension source (which might happen if you change branches) you
67+
will need to run::
68+
69+
python setup.py build
70+
71+
or re-run ``pip install -v -e ./``.
5872

59-
every time the source code of a compiled extension is changed (for
60-
instance when switching branches or pulling changes from upstream).
6173

74+
Alternatively, if you do ::
75+
76+
pip install -v ./
77+
78+
all of the files will be copied to the installation directory however,
79+
you will have to rerun this command every time the source is changed.
6280

6381

6482
You can then run the tests to check your work environment is set up properly::
@@ -70,25 +88,13 @@ You can then run the tests to check your work environment is set up properly::
7088
.. _pep8: https://pep8.readthedocs.io/en/latest/
7189

7290
.. note::
73-
91+
7492
**Additional dependencies for testing**: nose_ (version 1.0 or later), `mock
7593
<https://docs.python.org/dev/library/unittest.mock.html>`_ (if python < 3.3), `Ghostscript
7694
<http://www.ghostscript.com/>`_, `Inkscape <http://inkscape.org>`_
7795

78-
.. note:: To make sure the tests run locally:
79-
80-
* Copy setup.cfg.template to setup.cfg
81-
* Edit setup.cfg to set ``test`` to True, and ``local_freetype`` to True
82-
* If you have built matplotlib previously, remove the ``build`` folder.
83-
* Execute the build command.
84-
85-
When working on bleeding edge packages, setting up a
86-
`virtual environment
87-
<http://docs.python-guide.org/en/latest/dev/virtualenvs/>`_ or a `conda
88-
environment <http://conda.pydata.org/docs/using/envs.html>`_ is recommended.
89-
9096
.. seealso::
91-
97+
9298
* :ref:`testing`
9399

94100

@@ -137,7 +143,7 @@ You may want to consider sending an email to the mailing list for more
137143
visibility.
138144

139145
.. seealso::
140-
146+
141147
* `Git documentation <https://git-scm.com/documentation>`_
142148
* :ref:`development-workflow`.
143149
* :ref:`using-git`
@@ -196,12 +202,12 @@ tools:
196202

197203
* Code with a good unittest coverage (at least 70%, better 100%), check
198204
with::
199-
205+
200206
pip install coverage
201207
python tests.py --with-coverage
202208

203209
* No pyflakes warnings, check with::
204-
210+
205211
pip install pyflakes
206212
pyflakes path/to/module.py
207213

@@ -227,10 +233,10 @@ Issues for New Contributors
227233
---------------------------
228234

229235
New contributors should look for the following tags when looking for issues.
230-
We strongly recommend that new contributors tackle
236+
We strongly recommend that new contributors tackle
231237
`new-contributor-friendly <https://github.com/matplotlib/matplotlib/labels/new-contributor-friendly>`_
232238
issues (easy, well documented issues, that do not require an understanding of
233-
the different submodules of matplotlib) and
239+
the different submodules of matplotlib) and
234240
`Easy-fix <https://github.com/matplotlib/matplotlib/labels/Difficulty%3A%20Easy>`_
235241
issues. This helps the contributor become familiar with the contribution
236242
workflow, and for the core devs to become acquainted with the contributor;

0 commit comments

Comments
 (0)
0