| 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.217.4/containers/python-3 |
| 3 |
{ |
| 4 |
"name": "Python 3", |
| 5 |
"build": { |
| 6 |
"dockerfile": "Dockerfile", |
| 7 |
"context": "..", |
| 8 |
"args": { |
| 9 |
"VARIANT": "3.14-bookworm" |
| 10 |
} |
| 11 |
}, |
| 12 |
|
| 13 |
// Set *default* container specific settings.json values on container create. |
| 14 |
"customizations":{ |
| 15 |
"vscode": { |
| 16 |
"settings":{ |
| 17 |
"python.defaultInterpreterPath": "/usr/local/bin/python", |
| 18 |
"python.linting.enabled": true, |
| 19 |
"python.linting.flake8Enabled": true, |
| 20 |
"python.formatting.provider": "ruff", |
| 21 |
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8", |
| 22 |
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf", |
| 23 |
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit", |
| 24 |
"python.linting.flake8Path": "flake8", |
| 25 |
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy", |
| 26 |
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle", |
| 27 |
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle", |
| 28 |
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint", |
| 29 |
"jupyter.widgetScriptSources": [ |
| 30 |
"jsdelivr.com", |
| 31 |
"unpkg.com" |
| 32 |
], |
| 33 |
"[python]": { |
| 34 |
"editor.codeActionsOnSave": { |
| 35 |
"source.fixAll": "explicit", |
| 36 |
"source.organizeImports": "explicit" |
| 37 |
}, |
| 38 |
"editor.defaultFormatter": "charliermarsh.ruff", |
| 39 |
"editor.formatOnSave": true, |
| 40 |
"editor.tabSize": 4 |
| 41 |
} |
| 42 |
}, |
| 43 |
|
| 44 |
// Add the IDs of extensions you want installed when the container is created. |
| 45 |
"extensions": [ |
| 46 |
"ms-python.python", |
| 47 |
"ms-python.vscode-pylance", |
| 48 |
"charliermarsh.ruff", |
| 49 |
"ms-azuretools.vscode-docker" |
| 50 |
] |
| 51 |
} |
| 52 |
}, |
| 53 |
// Use 'forwardPorts' to make a list of ports inside the container available locally. |
| 54 |
// "forwardPorts": [], |
| 55 |
|
| 56 |
// Use 'postCreateCommand' to run commands after the container is created. |
| 57 |
// "postCreateCommand": "pip3 install --user -r requirements.txt", |
| 58 |
"postCreateCommand": "pre-commit install && pip3 install --user -e '.[test,docs]' && pip3 freeze > .devcontainer/frozen-requirements.txt", |
| 59 |
|
| 60 |
// Workaround for git security restrictions and dubious ownership in devcontainers |
| 61 |
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}", |
| 62 |
|
| 63 |
// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. |
| 64 |
"remoteUser": "vscode", |
| 65 |
// https: //code.visualstudio.com/docs/remote/containers#_dev-container-features-preview |
| 66 |
"features": { |
| 67 |
// "git": "latest", |
| 68 |
"github-cli": "latest" |
| 69 |
} |
| 70 |
} |