Repository navigation
DOC: Add documentation on codespaces usage #26201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
00eb561
a28db86
9a089fb
97c999c
8c3a9c0
34c7e52
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| # Contributing to Matplotlib using GitHub codespaces | ||
|
|
||
| You've discovered a bug or something else you want to change | ||
| in Matplotlib — excellent! | ||
|
|
||
| You've worked out a way to fix it — even better! | ||
|
|
||
| You want to tell us about it — best of all! | ||
|
|
||
| This project is a community effort, and everyone is welcome to contribute. | ||
| Everyone within the community is expected to abide by our | ||
| [Code of Conduct](../../CODE_OF_CONDUCT.md). | ||
|
|
||
| ## GitHub codespaces contribution workflow | ||
|
|
||
| The preferred way to contribute to Matplotlib is to fork the main | ||
| repository at https://github.com/matplotlib/matplotlib, then submit a "pull | ||
| request" (PR). You can do this by cloning a copy of the Maplotlib repository to | ||
| your own computer, or alternatively using | ||
| [GitHub Codespaces](https://docs.github.com/codespaces) (a cloud-based | ||
| in-browser development environment, that comes with the appropriated setup to | ||
| contribute to Matplotlib). | ||
|
|
||
| A brief overview of the workflows is as follows. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know the purpose of this document may not yet be determined. But, if this is ultimately going to be a beginner's guide for working in codespace, I suggest we remove the workflow for the preferred method throughout and just mention it with a link once. Afterward, only document for the codespaces workflow. Then change Line 24 to: |
||
|
|
||
| 1. Go to the GitHub web interface | ||
|
melissawm marked this conversation as resolved.
Outdated
|
||
| 2. Fork the [project repository](https://github.com/matplotlib/matplotlib): | ||
|
melissawm marked this conversation as resolved.
Outdated
|
||
| 3. Open codespaces on your fork by clicking on the green "Code" button on the | ||
| GitHub web interface and selecting the "Codespaces" tab. Next, click on "Open | ||
| codespaces on <your fork name>". You will be able to change branches later, | ||
|
melissawm marked this conversation as resolved.
Outdated
|
||
| so you can select the default `main` branch. | ||
|
melissawm marked this conversation as resolved.
Outdated
|
||
|
|
||
| After the codespace is created, you will be taken to a new browser tab where | ||
| you can use the terminal to activate a pre-defined conda environment called | ||
| `mpl-dev`: | ||
|
|
||
| ``` | ||
| conda activate mpl-dev | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think there is a vscode setting file we can drop to tell vscode we want to use the environment and it will auto-activate for us.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will investigate but this was not possible until recently because of the way the terminal is fired up when codespaces is first opened. They have been making a lot of updates lately so I'll verify. |
||
| ``` | ||
|
|
||
| 4. Install the local version of Matplotlib with: | ||
|
|
||
| ``` | ||
| python -m pip install -e . | ||
| ``` | ||
|
|
||
| (See [Setting up Matplotlib for development](https://matplotlib.org/devdocs/devel/development_setup.html) | ||
|
melissawm marked this conversation as resolved.
Outdated
|
||
| for detailed instructions.) | ||
|
|
||
| 5. Create a branch to hold your changes: | ||
|
|
||
| ``` | ||
| git checkout -b my-feature origin/main | ||
| ``` | ||
|
|
||
| and start making changes. Never work in the `main` branch! | ||
|
|
||
| 6. Work on this task using Git to do the version control. Codespaces persist for | ||
| some time (check the [documentation for details](https://docs.github.com/codespaces/getting-started/the-codespace-lifecycle)) | ||
| and can be managed on https://github.com/codespaces. When you're done editing | ||
| e.g., `lib/matplotlib/collections.py`, do: | ||
|
|
||
| ``` | ||
| git add lib/matplotlib/collections.py | ||
| git commit | ||
| ``` | ||
|
|
||
| to record your changes in Git, then push them to your GitHub fork with: | ||
|
|
||
| ``` | ||
| git push -u origin my-feature | ||
| ``` | ||
|
|
||
| Finally, go to the web page of your fork of the Matplotlib repo, and click | ||
| 'Pull request' to send your changes to the maintainers for review. | ||
|
|
||
| ## Other stuff you may want to do | ||
|
|
||
| * If you need to run tests to verify your changes before sending your PR, you | ||
| can run (in your `mpl-dev` conda environment): | ||
|
|
||
| ``` | ||
| pytest | ||
| ``` | ||
|
|
||
| * If you need to build the documentation, you can move to the `doc` folder and | ||
| run (in your `mpl-dev` conda environment): | ||
|
|
||
| ``` | ||
| cd doc | ||
|
melissawm marked this conversation as resolved.
Outdated
|
||
| make html | ||
| ``` | ||
|
|
||
|
melissawm marked this conversation as resolved.
Outdated
|
||
| * If you need to open a GUI window with Matplotlib output, our Codespaces | ||
| configuration includes a | ||
| [light-weight Fluxbox-based desktop](https://github.com/devcontainers/features/tree/main/src/desktop-lite). | ||
| You can use it by connecting to this desktop via your web browser. To do this: | ||
|
|
||
| 1. Press `F1` or `Ctrl/Cmd+Shift+P` and select `Ports: Focus on Ports View` in | ||
| VS Code to bring it into focus. Open the ports view in your tool, select | ||
| the `noVNC` port, and click the Globe icon. | ||
| 2. In the browser that appears, click the Connect button and enter the desktop | ||
| password (`vscode` by default). | ||
|
|
||
| Check the | ||
| [GitHub instructions](https://github.com/devcontainers/features/tree/main/src/desktop-lite#connecting-to-the-desktop) | ||
| for more details on connecting to the desktop. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really 😻 the sign-posting here