Using GitHub Codespaces for NumPy development#

This section of the documentation will guide you through:

  • using GitHub Codespaces for your NumPy development environment

  • creating a personal fork of the NumPy repository on GitHub

  • a quick tour of GitHub Codespaces and VSCode desktop application

  • working on the NumPy documentation in GitHub Codespaces

GitHub Codespaces#

GitHub Codespaces is a service that provides cloud baseddevelopment environments so that you don’t have to install anythingon your local machine or worry about configuration.

What is a codespace?#

A codespace is an instance of Codespaces - and thus a development environmentthat is hosted in the cloud. Each codespace runs on a virtual machine hosted byGitHub. You can choose the type of machine you want to use, depending on theresources you need. Various types of machine are available, starting with a2-core processor, 4 GB of RAM, and 32 GB of storage. You can connect to acodespace from your browser, from Visual Studio Code, from the JetBrainsGateway application, or by using GitHub CLI.

Forking the NumPy repository#

The best way to work on the NumPy codebase as a contributor is by making a forkof the repository first.

  1. Browse to theNumPy repository on GitHub andcreate your own fork.

  2. Browse to your fork. Your fork will have a URL likeinessapawson/numpy, except with your GitHub username in place ofinessapawson.

Starting GitHub Codespaces#

You can create a codespace from the green “<> Code” button on the repositoryhome page and choose “Codespaces”, or click this linkopen.

Quick workspace tour#

You can develop code in a codespace using your choice of tool:

  • a command shell, via an SSH connection initiated using GitHub CLI._

  • one of the JetBrains IDEs, via the JetBrains Gateway._

  • the Visual Studio Code desktop application._

  • a browser-based version of Visual Studio Code._

In this quickstart, we will be using the VSCode desktop application as theeditor. If you have not used it before, see the Getting startedVSCode docsto familiarize yourself with this tool.

Your workspace will look similar to the image below:

Development workflow with GitHub Codespaces#

TheDevelopment workflow section of this documentation containsinformation regarding the NumPy development workflow. Make sure to check thisbefore you start working on your contributions.

Rendering the NumPy documentation#

You can find the detailed documentation on how the rendering of thedocumentation with Sphinx works in theBuilding the NumPy API and reference docs section.

The documentation is pre-built during your codespace initialization. So oncethis task is completed, you have two main options to render the documentationin GitHub Codespaces.

FAQs and troubleshooting#

How long does my codespace stay active if I’m not using it?If you leave your codespace running without interaction, or if you exit yourcodespace without explicitly stopping it, by default the codespace will timeoutafter 30 minutes of inactivity. You can customize the duration of the timeoutperiod for new codespaces that you create.

Can I come back to a previous codespace?The lifecycle of a codespace begins when you create a codespace and ends whenyou delete it. You can disconnect and reconnect to an active codespace withoutaffecting its running processes. You may stop and restart a codespace withoutlosing changes that you have made to your project.