Skip to content

Commit a326ad3

Browse files
committed
Add devcontainer config
1 parent cb3509d commit a326ad3

2 files changed

Lines changed: 44 additions & 0 deletions

File tree

.devcontainer.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "Python Thermia Online API",
3+
"image": "mcr.microsoft.com/devcontainers/python:1-3.12",
4+
"postCreateCommand": {
5+
"setup": "./scripts/setup.sh",
6+
"git": "git config --global --add safe.directory /workspaces/python-thermia-online-api"
7+
},
8+
"remoteUser": "vscode",
9+
"customizations": {
10+
"vscode": {
11+
"settings": {
12+
"python.pythonPath": "/usr/local/bin/python",
13+
"python.formatting.provider": "black",
14+
"editor.defaultFormatter": "ms-python.black-formatter"
15+
},
16+
"extensions": [
17+
"GitHub.copilot",
18+
"github.vscode-pull-request-github",
19+
"ms-python.python",
20+
"ms-python.vscode-pylance",
21+
"ms-python.black-formatter"
22+
]
23+
}
24+
}
25+
}

scripts/setup.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
cd "$(dirname "$0")/.."
6+
7+
# Install dependencies
8+
9+
install_packages() {
10+
python -m pip \
11+
install \
12+
--upgrade \
13+
--disable-pip-version-check \
14+
"${@}"
15+
}
16+
17+
install_packages "pip<23.2,>=21.3.1"
18+
install_packages setuptools wheel black
19+
install_packages -r requirements.txt

0 commit comments

Comments
 (0)