@@ -21,44 +21,65 @@ 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, use an
33
+ virtual environment or uninstall using the same method you used
34
+ to install it. Installing multiple versions of Matplotlib via different
35
+ methods into the same environment may not always work as expected.
24
36
25
37
We use `Git <https://git-scm.com/ >`_ for version control and
26
38
`GitHub <https://github.com/ >`_ for hosting our main repository.
27
39
28
- You can check out the latest sources with the command::
40
+ You can check out the latest sources with the command (see
41
+ :ref: `set-up-fork ` for more details)::
29
42
30
43
git clone git@github.com:matplotlib/matplotlib.git
31
44
45
+ and navigate to the :file: `matplotlib ` directory.
32
46
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::
47
+ To make sure the tests run locally you must build against the correct version
48
+ of freetype. To configure the build system to fetch and build it either export
49
+ the env ``MPLLOCALFREETYPE `` as::
35
50
36
- python setup.py develop
51
+ export MPLLOCALFREETYPE=1
37
52
38
- or::
53
+ or copy :file: ` setup.cfg.template ` to :file: ` setup.cfg ` and edit to contain ::
39
54
40
- pip install -v -e .
55
+ [test]
56
+ local_freetype = True
41
57
42
58
43
- This installs matplotlib for development (i.e., builds everything and places the
44
- symbolic links back to the source code).
59
+ To install Matplotlib (and compile the c-extensions) run the following
60
+ command from the top-level directory ::
45
61
46
- .. warning ::
62
+ pip install -v -e ./
47
63
48
- If you already have a version of matplotlib installed, you will need to
49
- uninstall it.
64
+ This installs Matplotlib in 'editable/develop mode', i.e., builds
65
+ everything and places the correct link entries in the install
66
+ directory so that python will be able to import Matplotlib from the
67
+ source directory. Thus, any changes to the ``*.py `` files will be
68
+ reflected the next time you import the library. If you change the
69
+ c-extension source (which might happen if you change branches) you
70
+ will need to run::
50
71
72
+ python setup.py build
51
73
52
- .. note ::
74
+ or re-run `` pip install -v -e ./ ``.
53
75
54
- If you decide to do install with ``python setup.py develop `` or ``pip
55
- install -v -e ``, you will have to rerun::
56
76
57
- python setup.py build
77
+ Alternatively, if you do ::
58
78
59
- every time the source code of a compiled extension is changed (for
60
- instance when switching branches or pulling changes from upstream).
79
+ pip install -v ./
61
80
81
+ all of the files will be copied to the installation directory however,
82
+ you will have to rerun this command every time the source is changed.
62
83
63
84
64
85
You can then run the tests to check your work environment is set up properly::
@@ -75,18 +96,6 @@ You can then run the tests to check your work environment is set up properly::
75
96
<https://docs.python.org/dev/library/unittest.mock.html> `_ (if python < 3.3), `Ghostscript
76
97
<https://www.ghostscript.com/> `_, `Inkscape <https://inkscape.org >`_
77
98
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
99
.. seealso ::
91
100
92
101
* :ref: `testing `
@@ -98,7 +107,7 @@ Contributing code
98
107
How to contribute
99
108
-----------------
100
109
101
- The preferred way to contribute to matplotlib is to fork the `main
110
+ The preferred way to contribute to Matplotlib is to fork the `main
102
111
repository <https://github.com/matplotlib/matplotlib/> `__ on GitHub,
103
112
then submit a "pull request" (PR):
104
113
@@ -131,7 +140,7 @@ then submit a "pull request" (PR):
131
140
132
141
$ git push -u origin my-feature
133
142
134
- Finally, go to the web page of your fork of the matplotlib repo,
143
+ Finally, go to the web page of your fork of the Matplotlib repo,
135
144
and click 'Pull request' to send your changes to the maintainers for review.
136
145
You may want to consider sending an email to the mailing list for more
137
146
visibility.
@@ -207,7 +216,7 @@ tools:
207
216
208
217
.. note ::
209
218
210
- The current state of the matplotlib code base is not compliant with all
219
+ The current state of the Matplotlib code base is not compliant with all
211
220
of those guidelines, but we expect that enforcing those constraints on all
212
221
new contributions will move the overall code base quality in the right
213
222
direction.
@@ -230,7 +239,7 @@ New contributors should look for the following tags when looking for issues.
230
239
We strongly recommend that new contributors tackle
231
240
`new-contributor-friendly <https://github.com/matplotlib/matplotlib/labels/new-contributor-friendly >`_
232
241
issues (easy, well documented issues, that do not require an understanding of
233
- the different submodules of matplotlib ) and
242
+ the different submodules of Matplotlib ) and
234
243
`Easy-fix <https://github.com/matplotlib/matplotlib/labels/Difficulty%3A%20Easy >`_
235
244
issues. This helps the contributor become familiar with the contribution
236
245
workflow, and for the core devs to become acquainted with the contributor;
@@ -242,7 +251,7 @@ Other ways to contribute
242
251
=========================
243
252
244
253
245
- Code is not the only way to contribute to matplotlib . For instance,
254
+ Code is not the only way to contribute to Matplotlib . For instance,
246
255
documentation is also a very important part of the project and often doesn't
247
256
get as much attention as it deserves. If you find a typo in the documentation,
248
257
or have made improvements, do not hesitate to send an email to the mailing
@@ -372,10 +381,10 @@ Developing a new backend
372
381
If you are working on a custom backend, the *backend * setting in
373
382
:file: `matplotlibrc ` (:ref: `customizing-matplotlib `) supports an
374
383
external backend via the ``module `` directive. if
375
- :file: `my_backend.py ` is a matplotlib backend in your
384
+ :file: `my_backend.py ` is a Matplotlib backend in your
376
385
:envvar: `PYTHONPATH `, you can set it on one of several ways
377
386
378
- * in matplotlibrc::
387
+ * in :file: ` matplotlibrc ` ::
379
388
380
389
backend : module://my_backend
381
390
@@ -406,7 +415,7 @@ when the website is built to show up both in the `examples
406
415
<../gallery.html> `_ sections of the website.
407
416
408
417
Any sample data that the example uses should be kept small and
409
- distributed with matplotlib in the
418
+ distributed with Matplotlib in the
410
419
`lib/matplotlib/mpl-data/sample_data/ ` directory. Then in your
411
420
example code you can load it into a file handle with::
412
421
0 commit comments