Skip to content

Commit 3b329d9

Browse files
authored
Merge pull request #29526 from rcomer/doc-codespace
DOC: better separation of codespace instructions
2 parents 9e3ada3 + 9152a0b commit 3b329d9

File tree

1 file changed

+64
-43
lines changed

1 file changed

+64
-43
lines changed

doc/devel/development_setup.rst

+64-43
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,22 @@ repository, you should first fork this repository by *clicking* the
3434
This creates a copy of the code under your account on the GitHub server. See `the GitHub
3535
documentation <https://docs.github.com/get-started/quickstart/fork-a-repo>`__ for more details.
3636

37+
Decide whether to work locally or in GitHub Codespaces
38+
======================================================
39+
40+
You can either work locally on your machine, or online in
41+
`GitHub Codespaces <github-codespaces_>`_, a cloud-based in-browser development
42+
environment. If you are making a one-off, relatively simple change then
43+
working in GitHub Codespaces can be a good option because most of the setting
44+
up is done for you and you can skip the next few sections! If you are making
45+
extensive or frequent contributions to Matplotlib then it is probably worth
46+
taking the time to set up on your local machine: As well as having the
47+
convenience of your local familiar tools, you will not need to worry about
48+
Codespace's monthly usage limits.
49+
50+
If you want to use Codespaces, skip to :ref:`development-codespaces`,
51+
otherwise, continue with the next section.
52+
3753
Retrieve the latest version of the code
3854
=======================================
3955

@@ -106,8 +122,8 @@ code, as described in :ref:`development-workflow`.
106122

107123
.. _dev-environment:
108124

109-
Create a dedicated environment
110-
==============================
125+
Create a dedicated python environment
126+
=====================================
111127
You should set up a dedicated environment to decouple your Matplotlib
112128
development from other Python and Matplotlib installations on your system.
113129

@@ -158,64 +174,69 @@ setup.
158174

159175
Remember to activate the environment whenever you start working on Matplotlib!
160176

161-
.. tab-item:: :octicon:`codespaces` GitHub Codespaces
162177

163-
`GitHub Codespaces <https://docs.github.com/codespaces>`_ is a cloud-based
164-
in-browser development environment that comes with the appropriate setup to
165-
contribute to Matplotlib.
178+
Install external dependencies
179+
=============================
166180

167-
#. Open codespaces on your fork by clicking on the green :octicon:`code` ``Code``
168-
button on the GitHub web interface and selecting the ``Codespaces`` tab.
181+
Python dependencies were installed as part of :ref:`setting up the environment <dev-environment>`.
182+
Additionally, the following non-Python dependencies must also be installed locally:
169183

170-
#. Next, click on "Open codespaces on <your branch name>". You will be
171-
able to change branches later, so you can select the default
172-
``main`` branch.
184+
.. rst-class:: checklist
173185

174-
#. After the codespace is created, you will be taken to a new browser
175-
tab where you can use the terminal to activate a pre-defined conda
176-
environment called ``mpl-dev``::
186+
* :ref:`c++ compiler<compile-dependencies>`
187+
* :ref:`external tools used by the documentation build <doc-dependencies-external>`
177188

178-
conda activate mpl-dev
179189

180-
Remember to activate the *mpl-dev* environment whenever you start working on
181-
Matplotlib.
190+
For a full list of dependencies, see :ref:`dependencies`. External dependencies do not
191+
need to be installed when working in codespaces.
182192

183-
If you need to open a GUI window with Matplotlib output on Codespaces, our
184-
configuration includes a `light-weight Fluxbox-based desktop
185-
<https://github.com/devcontainers/features/tree/main/src/desktop-lite>`_.
186-
You can use it by connecting to this desktop via your web browser. To do this:
193+
.. _development-codespaces:
187194

188-
#. Press ``F1`` or ``Ctrl/Cmd+Shift+P`` and select
189-
``Ports: Focus on Ports View`` in the VSCode session to bring it into
190-
focus. Open the ports view in your tool, select the ``noVNC`` port, and
191-
click the Globe icon.
192-
#. In the browser that appears, click the Connect button and enter the desktop
193-
password (``vscode`` by default).
195+
:octicon:`codespaces` Create a GitHub Codespace
196+
===============================================
194197

195-
Check the `GitHub instructions
196-
<https://github.com/devcontainers/features/tree/main/src/desktop-lite#connecting-to-the-desktop>`_
197-
for more details on connecting to the desktop.
198+
`GitHub Codespaces <github-codespaces_>`_ is a cloud-based
199+
in-browser development environment that comes with the appropriate setup to
200+
contribute to Matplotlib.
198201

199-
If you also built the documentation pages, you can view them using Codespaces.
200-
Use the "Extensions" icon in the activity bar to install the "Live Server"
201-
extension. Locate the ``doc/build/html`` folder in the Explorer, right click
202-
the file you want to open and select "Open with Live Server."
202+
#. Open codespaces on your fork by clicking on the green :octicon:`code` ``Code``
203+
button on the GitHub web interface and selecting the ``Codespaces`` tab.
203204

205+
#. Next, click on "Open codespaces on <your branch name>". You will be
206+
able to change branches later, so you can select the default
207+
``main`` branch.
204208

205-
Install external dependencies
206-
=============================
209+
#. After the codespace is created, you will be taken to a new browser
210+
tab where you can use the terminal to activate a pre-defined conda
211+
environment called ``mpl-dev``::
207212

208-
Python dependencies were installed as part of :ref:`setting up the environment <dev-environment>`.
209-
Additionally, the following non-Python dependencies must also be installed locally:
213+
conda activate mpl-dev
210214

211-
.. rst-class:: checklist
215+
Remember to activate the *mpl-dev* environment whenever you start working on
216+
Matplotlib.
212217

213-
* :ref:`c++ compiler<compile-dependencies>`
214-
* :ref:`external tools used by the documentation build <doc-dependencies-external>`
218+
If you need to open a GUI window with Matplotlib output on Codespaces, our
219+
configuration includes a `light-weight Fluxbox-based desktop
220+
<https://github.com/devcontainers/features/tree/main/src/desktop-lite>`_.
221+
You can use it by connecting to this desktop via your web browser. To do this:
215222

223+
#. Press ``F1`` or ``Ctrl/Cmd+Shift+P`` and select
224+
``Ports: Focus on Ports View`` in the VSCode session to bring it into
225+
focus. Open the ports view in your tool, select the ``noVNC`` port, and
226+
click the Globe icon.
227+
#. In the browser that appears, click the Connect button and enter the desktop
228+
password (``vscode`` by default).
216229

217-
For a full list of dependencies, see :ref:`dependencies`. External dependencies do not
218-
need to be installed when working in codespaces.
230+
Check the `GitHub instructions
231+
<https://github.com/devcontainers/features/tree/main/src/desktop-lite#connecting-to-the-desktop>`_
232+
for more details on connecting to the desktop.
233+
234+
If you also built the documentation pages, you can view them using Codespaces.
235+
Use the "Extensions" icon in the activity bar to install the "Live Server"
236+
extension. Locate the ``doc/build/html`` folder in the Explorer, right click
237+
the file you want to open and select "Open with Live Server."
238+
239+
.. _`github-codespaces`: https://docs.github.com/codespaces
219240

220241
.. _development-install:
221242

0 commit comments

Comments
 (0)