@@ -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::
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::
35
48
36
- python setup.py develop
49
+ export MPLLOCALFREETYPE=1
37
50
38
- or::
51
+ or copy :file: ` setup.cfg.template ` to :file: ` setup.cfg ` and edit to contain ::
39
52
40
- pip install -v -e .
53
+ [test]
54
+ local_freetype = True
41
55
42
56
43
- This installs matplotlib for development (i.e., builds everything and places the
44
- symbolic links back to the source code).
57
+ To install Matplotlib (and compile the c-extensions) run the following
58
+ command from the top-level directory ::
45
59
46
- .. warning ::
60
+ pip install -v -e ./
47
61
48
- If you already have a version of matplotlib installed, you will need to
49
- uninstall it.
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::
50
68
69
+ python setup.py build
51
70
52
- .. note ::
71
+ or re-run `` pip install -v -e ./ ``.
53
72
54
- If you decide to do install with ``python setup.py develop `` or ``pip
55
- install -v -e ``, you will have to rerun::
56
73
57
- python setup.py build
74
+ Alternatively, if you do ::
58
75
59
- every time the source code of a compiled extension is changed (for
60
- instance when switching branches or pulling changes from upstream).
76
+ pip install -v ./
61
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::
@@ -75,18 +93,6 @@ You can then run the tests to check your work environment is set up properly::
75
93
<https://docs.python.org/dev/library/unittest.mock.html> `_ (if python < 3.3), `Ghostscript
76
94
<https://www.ghostscript.com/> `_, `Inkscape <https://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 `
0 commit comments