@@ -53,28 +53,8 @@ Thank you for your help in keeping bug reports complete, targeted and descriptiv
53
53
Retrieving and installing the latest version of the code
54
54
========================================================
55
55
56
- When developing Matplotlib, sources must be downloaded, built, and installed into
57
- a local environment on your machine.
58
-
59
- Follow the instructions detailed :ref: `here <install_from_source >` to set up your
60
- environment to build Matplotlib from source.
61
-
62
- .. warning ::
63
-
64
- When working on Matplotlib sources, having multiple versions installed by
65
- different methods into the same environment may not always work as expected.
66
-
67
- To work on Matplotlib sources, it is strongly recommended to set up an alternative
68
- development environment, using the something like `virtual environments in python
69
- <http://docs.python-guide.org/en/latest/dev/virtualenvs/> `_, or a
70
- `conda environment <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html >`_.
71
-
72
- If you choose to use an already existing environment, and not a clean virtual or
73
- conda environment, uninstall the current version of Matplotlib in that environment
74
- using the same method used to install it.
75
-
76
- If working on Matplotlib documentation only, the above steps are *not * absolutely
77
- necessary.
56
+ When developing Matplotlib, sources must be downloaded, built, and installed
57
+ into a local environment on your machine.
78
58
79
59
We use `Git <https://git-scm.com/ >`_ for version control and
80
60
`GitHub <https://github.com/ >`_ for hosting our main repository.
@@ -88,19 +68,24 @@ and navigate to the :file:`matplotlib` directory. If you have the proper privile
88
68
you can use ``git@ `` instead of ``https:// ``, which works through the ssh protocol
89
69
and might be easier to use if you are using 2-factor authentication.
90
70
71
+ Installing Matplotlib in developer mode
72
+ ---------------------------------------
73
+
74
+ It is strongly recommended to set up a clean `virtual environment `_. Do not
75
+ use on a preexisting environment!
91
76
92
- Building Matplotlib for image comparison tests
93
- ----------------------------------------------
77
+ A new environment can be set up with ::
94
78
95
- Matplotlib's test suite makes heavy use of image comparison tests, meaning
96
- the result of a plot is compared against a known good result. Unfortunately,
97
- different versions of FreeType produce differently formed characters, causing
98
- these image comparisons to fail. To make them reproducible, Matplotlib is, by
99
- default, built with a special local copy of FreeType.
79
+ python3 -mvenv /path/to/devel/env
100
80
81
+ and activated with one of the following::
101
82
102
- Installing Matplotlib in developer mode
103
- ---------------------------------------
83
+ source /path/to/devel/env/bin/activate # Linux/macOS
84
+ /path/to/devel/env/Scripts/activate.bat # Windows cmd.exe
85
+ /path/to/devel/env/Scripts/Activate.ps1 # Windows PowerShell
86
+
87
+ Whenever you plan to work on Matplotlib, remember to activate the development
88
+ environment in your shell!
104
89
105
90
To install Matplotlib (and compile the C-extensions) run the following
106
91
command from the top-level directory ::
@@ -115,28 +100,15 @@ reflected the next time you import the library. If you change the
115
100
C-extension source (which might happen if you change branches) you
116
101
will need to run ::
117
102
118
- python setup.py build
103
+ python setup.py build_ext --inplace
119
104
120
105
or re-run ``python -mpip install -ve . ``.
121
106
122
- Alternatively, if you do ::
123
-
124
- python -mpip install -v .
125
-
126
- all of the files will be copied to the installation directory however,
127
- you will have to rerun this command every time the source is changed.
128
- Additionally you will need to copy :file: `setup.cfg.template ` to
129
- :file: `setup.cfg ` and edit it to contain ::
130
-
131
- [test]
132
- local_freetype = True
133
- tests = True
134
-
135
- In either case you can then run the tests to check your work
136
- environment is set up properly::
107
+ You can then run the tests to check your work environment is set up properly::
137
108
138
109
pytest
139
110
111
+ .. _virtual environment : https://docs.python.org/3/library/venv.html
140
112
.. _pytest : http://doc.pytest.org/en/latest/
141
113
.. _pep8 : https://pep8.readthedocs.io/en/latest/
142
114
.. _Ghostscript : https://www.ghostscript.com/
0 commit comments