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.231.6/containers/python-3
3+ {
4+ "name" : " Python 3" ,
5+ "build" : {
6+ "dockerfile" : " Dockerfile" ,
7+ "target" : " developer" ,
8+ "context" : " .." ,
9+ "args" : {}
10+ },
11+ "remoteEnv" : {
12+ "DISPLAY" : " ${localEnv:DISPLAY}"
13+ },
14+ // Set *default* container specific settings.json values on container create.
15+ "settings" : {
16+ "python.defaultInterpreterPath" : " /usr/local/bin/python" ,
17+ "python.linting.enabled" : true ,
18+ "python.linting.pylintEnabled" : true ,
19+ "python.formatting.autopep8Path" : " /usr/local/py-utils/bin/autopep8" ,
20+ "python.formatting.blackPath" : " /usr/local/py-utils/bin/black" ,
21+ "python.formatting.yapfPath" : " /usr/local/py-utils/bin/yapf" ,
22+ "python.linting.banditPath" : " /usr/local/py-utils/bin/bandit" ,
23+ "python.linting.flake8Path" : " /usr/local/py-utils/bin/flake8" ,
24+ "python.linting.mypyPath" : " /usr/local/py-utils/bin/mypy" ,
25+ "python.linting.pycodestylePath" : " /usr/local/py-utils/bin/pycodestyle" ,
26+ "python.linting.pydocstylePath" : " /usr/local/py-utils/bin/pydocstyle" ,
27+ "python.linting.pylintPath" : " /usr/local/py-utils/bin/pylint"
28+ },
29+ // Add the IDs of extensions you want installed when the container is created.
30+ "extensions" : [
31+ " ms-python.python" ,
32+ " ms-python.vscode-pylance" ,
33+ " streetsidesoftware.code-spell-checker" ,
34+ " ryanluker.vscode-coverage-gutters" ,
35+ " mhutchie.git-graph" ,
36+ " eamodio.gitlens" ,
37+ " gruntfuggly.todo-tree" ,
38+ " redhat.vscode-yaml" ,
39+ " nsd.vscode-epics" ,
40+ " alefragnani.bookmarks"
41+ ],
42+ "features" : {
43+ // "docker-from-docker": "20.10",
44+ "git" : " os-provided"
45+ },
46+ // Use 'forwardPorts' to make a list of ports inside the container available locally.
47+ // "forwardPorts": [],
48+ // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
49+ // "remoteUser": "vscode",
50+ // Make sure the files we are mapping into the container exist on the host
51+ "initializeCommand" : " bash -c 'for i in $HOME/.inputrc $HOME/.bashrc_dev; do [ -f $i ] || touch $i; done'" ,
52+ "runArgs" : [
53+ " --privileged" ,
54+ " --net=host" ,
55+ " -v=${localEnv:HOME}/.ssh:/root/.ssh" ,
56+ " -v=${localEnv:HOME}/.bashrc_dev:/root/.bashrc" ,
57+ " -v=${localEnv:HOME}/.inputrc:/root/.inputrc"
58+ ],
59+ "mounts" : [
60+ // map in home directory - not strictly necessary but may be useful
61+ " source=${localEnv:HOME},target=${localEnv:HOME},type=bind,consistency=cached"
62+ ],
63+ "workspaceMount" : " source=${localWorkspaceFolder},target=/workspace,type=bind" ,
64+ "workspaceFolder" : " /workspace" ,
65+ // After the container is created, install the python project in editable form
66+ // This installs into the system python of the container
67+ "postCreateCommand" : " pip install $([ -f requirements_dev.txt ] && echo -r requirements_dev.txt ) -e .[dev]"
68+ }
0 commit comments