Skip to content

Commit

Permalink
Add devcontainer config
Browse files Browse the repository at this point in the history
  • Loading branch information
klejejs committed Oct 6, 2024
1 parent cb3509d commit a326ad3
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "Python Thermia Online API",
"image": "mcr.microsoft.com/devcontainers/python:1-3.12",
"postCreateCommand": {
"setup": "./scripts/setup.sh",
"git": "git config --global --add safe.directory /workspaces/python-thermia-online-api"
},
"remoteUser": "vscode",
"customizations": {
"vscode": {
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.formatting.provider": "black",
"editor.defaultFormatter": "ms-python.black-formatter"
},
"extensions": [
"GitHub.copilot",
"github.vscode-pull-request-github",
"ms-python.python",
"ms-python.vscode-pylance",
"ms-python.black-formatter"
]
}
}
}
19 changes: 19 additions & 0 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -e

cd "$(dirname "$0")/.."

# Install dependencies

install_packages() {
python -m pip \
install \
--upgrade \
--disable-pip-version-check \
"${@}"
}

install_packages "pip<23.2,>=21.3.1"
install_packages setuptools wheel black
install_packages -r requirements.txt

0 comments on commit a326ad3

Please sign in to comment.