GitHub Codespaces are a hosted developer environment operating in the cloud that can be run with Visual Studio Code. You can customize the development experience for any development project on GitHub, pre-installing dependencies, libraries, and even Visual Studio Code extensions and settings. Imagine having the same environment, with the same settings and pre-installed dependencies, for every contributor to a GitHub repository! If you are a teacher or a student, this will significantly simplify most workflows and allow you to focus on being hands-on rather than setting an environment. You can also select the type of virtual machine you wish to utilize based on the resources you require. There are several models available, starting with a 2-core processor, 4 GB of RAM, and 32 GB of storage. The following video provides additional details.
To test Codespaces functionality, while inside one of your repositories, select the Codespaces tab after clicking on the green <>Code button. Then select the green "Create codespace on main":
Next, your repository's contents will be loaded into a online version of Visual Studio Code in your browser, and you'll be ready to begin development immediately.
The real power of Codespaces is highlighted when the developer container enviroment is configured for specific use. To quickly test it out, open up the Command Palette (Ctrl-Shift-P or Cmd-Shift-P) and type "Dev Container Configuration" and select the option to Add Dev Contianer Configuration Files:
Next type Python and select the first option, then select None for Node.js and lastly click OK for no additional features:
You'll end up with a new directory called .devcontainer with a single file called devcontainer.json with contents similar like this one:
Finally, a notification message will appear at the bottom, urging you to rebuild the environment. Wait for it to finish before clicking the rebuild button. When it's finished, you'll have a Python 3.10-configured environment! You may now commit and push those modifications to the repository to make them permanent, so that whenever you (or anybody else) open the repository using Codespaces, Python 3.10 will be used.