Skip to content

Commit 5f06bb3

Browse files
committed
Initial codespaces support
1 parent e3b9217 commit 5f06bb3

10 files changed

+598
-77
lines changed

.devcontainer/Dockerfile

-21
This file was deleted.

.devcontainer/devcontainer.json

+21-46
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,25 @@
1-
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2-
// https://github.com/microsoft/vscode-dev-containers/tree/v0.203.0/containers/python-3
1+
// Adopting the default Github codespaces-jupyter template as starter
2+
// https://github.com/github/codespaces-jupyter
33
{
4-
"name": "Python 3",
5-
"runArgs": ["--init"],
6-
"build": {
7-
"dockerfile": "Dockerfile",
8-
"context": "..",
9-
"args": {
10-
// Update 'VARIANT' to pick a Python version: 3, 3.10, 3.9, 3.8, 3.7, 3.6
11-
// Append -bullseye or -buster to pin to an OS version.
12-
// Use -bullseye variants on local on arm64/Apple Silicon.
13-
"VARIANT": "3",
14-
// Options
15-
"NODE_VERSION": "none"
16-
}
4+
"name": "Generative AI For Beginners",
5+
"image": "mcr.microsoft.com/devcontainers/universal:2",
6+
"hostRequirements": {
7+
"cpus": 4
178
},
189

19-
// Set *default* container specific settings.json values on container create.
20-
"settings": {
21-
"python.pythonPath": "/usr/local/bin/python",
22-
"python.languageServer": "Pylance",
23-
"python.linting.enabled": true,
24-
"python.linting.pylintEnabled": true,
25-
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
26-
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
27-
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
28-
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
29-
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
30-
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
31-
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
32-
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
33-
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
34-
},
35-
36-
// Add the IDs of extensions you want installed when the container is created.
37-
"extensions": [
38-
"ms-python.python",
39-
"ms-python.vscode-pylance"
40-
],
41-
42-
// Use 'forwardPorts' to make a list of ports inside the container available locally.
43-
// "forwardPorts": [],
44-
45-
// Use 'postCreateCommand' to run commands after the container is created.
46-
// "postCreateCommand": "pip3 install --user -r requirements.txt",
10+
"waitFor": "onCreateCommand",
11+
"updateContentCommand": "python3 -m pip install -r requirements.txt",
12+
"postCreateCommand": "bash .devcontainer/post-create.sh",
4713

48-
// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
49-
"remoteUser": "vscode"
50-
}
14+
"customizations": {
15+
"codespaces": {
16+
"openFiles": []
17+
},
18+
"vscode": {
19+
"extensions": [
20+
"ms-toolsai.jupyter",
21+
"ms-python.python"
22+
]
23+
}
24+
}
25+
}

.devcontainer/icon.svg

+90
Loading

.devcontainer/post-create.sh

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#! /bin/bash
2+
3+
# Install the OpenAI packages for Node.js
4+
# (Python related dependencies are covered in requirements.txt)
5+
npm install --save openai

0 commit comments

Comments
 (0)