@@ -21,44 +21,62 @@ also welcome to post feature requests or pull requests.
21
21
Retrieving and installing the latest version of the code
22
22
========================================================
23
23
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.
24
34
25
35
We use `Git <https://git-scm.com/ >`_ for version control and
26
36
`GitHub <https://github.com/ >`_ for hosting our main repository.
27
37
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)::
29
40
30
41
git clone git@github.com:matplotlib/matplotlib.git
31
42
43
+ and navigate to the matplotlib directory.
32
44
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::
37
48
38
- or::
39
-
40
- pip install -v -e .
49
+ export MPLLOCALFREETYPE=1
41
50
51
+ or copy :file: `setup.cfg.template ` to :file: `setup.cfg ` and edit to contain ::
42
52
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
45
55
46
- .. warning ::
47
56
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 ::
50
59
60
+ pip install -v -e ./
51
61
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 ./ ``.
58
72
59
- every time the source code of a compiled extension is changed (for
60
- instance when switching branches or pulling changes from upstream).
61
73
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.
62
80
63
81
64
82
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::
70
88
.. _pep8 : https://pep8.readthedocs.io/en/latest/
71
89
72
90
.. note ::
73
-
91
+
74
92
**Additional dependencies for testing **: nose _ (version 1.0 or later), `mock
75
93
<https://docs.python.org/dev/library/unittest.mock.html> `_ (if python < 3.3), `Ghostscript
76
94
<http://www.ghostscript.com/> `_, `Inkscape <http://inkscape.org >`_
77
95
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
-
90
96
.. seealso ::
91
-
97
+
92
98
* :ref: `testing `
93
99
94
100
@@ -137,7 +143,7 @@ You may want to consider sending an email to the mailing list for more
137
143
visibility.
138
144
139
145
.. seealso ::
140
-
146
+
141
147
* `Git documentation <https://git-scm.com/documentation >`_
142
148
* :ref: `development-workflow `.
143
149
* :ref: `using-git `
@@ -196,12 +202,12 @@ tools:
196
202
197
203
* Code with a good unittest coverage (at least 70%, better 100%), check
198
204
with::
199
-
205
+
200
206
pip install coverage
201
207
python tests.py --with-coverage
202
208
203
209
* No pyflakes warnings, check with::
204
-
210
+
205
211
pip install pyflakes
206
212
pyflakes path/to/module.py
207
213
@@ -227,10 +233,10 @@ Issues for New Contributors
227
233
---------------------------
228
234
229
235
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
231
237
`new-contributor-friendly <https://github.com/matplotlib/matplotlib/labels/new-contributor-friendly >`_
232
238
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
234
240
`Easy-fix <https://github.com/matplotlib/matplotlib/labels/Difficulty%3A%20Easy >`_
235
241
issues. This helps the contributor become familiar with the contribution
236
242
workflow, and for the core devs to become acquainted with the contributor;
0 commit comments