@@ -53,28 +53,8 @@ Thank you for your help in keeping bug reports complete, targeted and descriptiv
5353Retrieving and installing the latest version of the code
5454========================================================
5555
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.
7858
7959We use `Git <https://git-scm.com/ >`_ for version control and
8060`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
8868you can use ``git@ `` instead of ``https:// ``, which works through the ssh protocol
8969and might be easier to use if you are using 2-factor authentication.
9070
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!
9176
92- Building Matplotlib for image comparison tests
93- ----------------------------------------------
77+ A new environment can be set up with ::
9478
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
10080
81+ and activated with one of the following::
10182
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!
10489
10590To install Matplotlib (and compile the C-extensions) run the following
10691command from the top-level directory ::
@@ -115,28 +100,15 @@ reflected the next time you import the library. If you change the
115100C-extension source (which might happen if you change branches) you
116101will need to run ::
117102
118- python setup.py build
103+ python setup.py build_ext --inplace
119104
120105or re-run ``python -mpip install -ve . ``.
121106
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::
137108
138- pytest
109+ python -mpytest
139110
111+ .. _virtual environment : https://docs.python.org/3/library/venv.html
140112.. _pytest : http://doc.pytest.org/en/latest/
141113.. _pep8 : https://pep8.readthedocs.io/en/latest/
142114.. _Ghostscript : https://www.ghostscript.com/
@@ -260,7 +232,7 @@ tools:
260232* Code with a good unittest coverage (at least 70%, better 100%), check with::
261233
262234 python -mpip install coverage
263- pytest --cov=matplotlib --showlocals -v
235+ python -mpytest --cov=matplotlib --showlocals -v
264236
265237* No pyflakes warnings, check with::
266238
0 commit comments