@@ -222,39 +222,96 @@ How to contribute
222222
223223The preferred way to contribute to Matplotlib is to fork the `main
224224repository <https://github.com/matplotlib/matplotlib/> `__ on GitHub,
225- then submit a "pull request" (PR).
225+ then submit a "pull request" (PR). You can do this by cloning a copy of the
226+ Maplotlib repository to your own computer, or alternatively using
227+ `GitHub Codespaces <https://docs.github.com/codespaces >`_ (a cloud-based
228+ in-browser development environment, that comes with the appropriated setup to
229+ contribute to Matplotlib).
226230
227- A brief overview is:
231+ A brief overview of the workflows is as follows.
228232
229- 1. `Create an account <https://github.com/join >`_ on GitHub if you do not
230- already have one.
233+ .. tab-set ::
231234
232- 2. Fork the `project repository <https://github.com/matplotlib/matplotlib >`_:
233- click on the 'Fork' button near the top of the page. This creates a copy of
234- the code under your account on the GitHub server.
235+ .. tab-item :: Local development
235236
236- 3. Clone this copy to your local disk::
237+ 1. `Create an account <https://github.com/join >`_ on GitHub if you do
238+ not already have one.
237239
238- git clone https://github.com/<YOUR GITHUB USERNAME>/matplotlib.git
240+ 2. Fork the
241+ `project repository <https://github.com/matplotlib/matplotlib >`_:
242+ click on the 'Fork' button near the top of the page. This creates a
243+ copy of the code under your account on the GitHub server.
239244
240- 4. Enter the directory and install the local version of Matplotlib.
241- See :ref: `installing_for_devs ` for instructions
245+ 3. Clone this copy to your local disk::
242246
243- 5. Create a branch to hold your changes::
247+ git clone https://github.com/<YOUR GITHUB USERNAME>/matplotlib.git
244248
245- git checkout -b my-feature origin/main
249+ 4. Enter the directory and install the local version of Matplotlib.
250+ See :ref: `installing_for_devs ` for instructions
246251
247- and start making changes. Never work in the ``main`` branch!
252+ 5. Create a branch to hold your changes::
248253
249- 6. Work on this copy, on your computer, using Git to do the version control.
250- When you're done editing e.g., ``lib/matplotlib/collections.py ``, do::
254+ git checkout -b my-feature origin/main
251255
252- git add lib/matplotlib/collections.py
253- git commit
256+ and start making changes. Never work in the ``main`` branch!
254257
255- to record your changes in Git, then push them to GitHub with::
258+ 6. Work on this copy, on your computer, using Git to do the version
259+ control. When you're done editing e.g.,
260+ ``lib/matplotlib/collections.py ``, do::
256261
257- git push -u origin my-feature
262+ git add lib/matplotlib/collections.py
263+ git commit
264+
265+ to record your changes in Git, then push them to GitHub with::
266+
267+ git push -u origin my-feature
268+
269+ .. tab-item :: Using GitHub Codespaces
270+
271+ 1. `Create an account <https://github.com/join >`_ on GitHub if you do
272+ not already have one.
273+
274+ 2. Fork the
275+ `project repository <https://github.com/matplotlib/matplotlib >`_:
276+ click on the 'Fork' button near the top of the page. This creates a
277+ copy of the code under your account on the GitHub server.
278+
279+ 3. Open codespaces on your fork by clicking on the green "Code" button
280+ on the GitHub web interface and selecting the "Codespaces" tab. Next,
281+ click on "Open codespaces on <your fork name>". You will be able to
282+ change branches later, so you can select the default ``main `` branch.
283+
284+ After the codespace is created, you will be taken to a new browser
285+ tab where you can use the terminal to activate a pre-defined conda
286+ environment called ``mpl-dev ``::
287+
288+ conda activate mpl-dev
289+
290+ 4. Install the local version of Matplotlib with::
291+
292+ python -m pip install -e .
293+
294+ (See :ref:`installing_for_devs` for detailed instructions.)
295+
296+ 5. Create a branch to hold your changes::
297+
298+ git checkout -b my-feature origin/main
299+
300+ and start making changes. Never work in the ``main`` branch!
301+
302+ 6. Work on this task using Git to do the version control. Codespaces
303+ persist for some time (check the `documentation for details
304+ <https://docs.github.com/codespaces/getting-started/the-codespace-lifecycle> `_)
305+ and can be managed on https://github.com/codespaces. When you're done
306+ editing e.g., ``lib/matplotlib/collections.py ``, do::
307+
308+ git add lib/matplotlib/collections.py
309+ git commit
310+
311+ to record your changes in Git, then push them to your GitHub fork
312+ with::
313+
314+ git push -u origin my-feature
258315
259316Finally, go to the web page of your fork of the Matplotlib repo, and click
260317'Pull request' to send your changes to the maintainers for review.
0 commit comments