Skip to content

Commit 1341df1

Browse files
committed
Add initial devcontainer support
1 parent d905cf0 commit 1341df1

File tree

4 files changed

+80
-0
lines changed

4 files changed

+80
-0
lines changed

.devcontainer/.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.pytest_cache
3+
ms-python-insiders.vsix

.devcontainer/Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM mcr.microsoft.com/devcontainers/python:3.7
2+
3+
ENV CI_PYTHON_PATH=python
4+
5+
RUN python -m pip install --upgrade pip
6+
7+
COPY build/test-requirements.txt ./
8+
RUN python -m pip install -r test-requirements.txt \
9+
&& rm test-requirements.txt
10+
11+
COPY build/smoke-test-requirements.txt ./
12+
RUN python -m pip install -r smoke-test-requirements.txt \
13+
&& rm smoke-test-requirements.txt
14+
15+
COPY build/functional-test-requirements.txt ./
16+
RUN python -m pip install -r functional-test-requirements.txt \
17+
&& rm functional-test-requirements.txt
18+
19+
COPY build/functional-test-requirements.txt ./
20+
RUN python -m pip install -r functional-test-requirements.txt \
21+
&& rm functional-test-requirements.txt
22+
23+
COPY build/debugger-install-requirements.txt ./
24+
RUN python -m pip install -r debugger-install-requirements.txt \
25+
&& rm debugger-install-requirements.txt
26+
27+
28+
RUN apt-get update
29+
RUN apt-get install -y libatk1.0-0 libatk-bridge2.0-0 libdrm2 libgtk-3-0 libgbm-dev libasound2

.devcontainer/devcontainer.json

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/python
3+
{
4+
"name": "Python 3",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"build": {
7+
"dockerfile": "./Dockerfile",
8+
"context": ".."
9+
},
10+
"customizations": {
11+
"vscode": {
12+
"extensions": [
13+
"editorconfig.editorconfig",
14+
"esbenp.prettier-vscode",
15+
"dbaeumer.vscode-eslint",
16+
"ms-python.python",
17+
"ms-python.black-formatter",
18+
"ms-python.vscode-pylance"
19+
],
20+
"settings": {
21+
"python.defaultInterpreterPath": "/usr/local/bin/python"
22+
}
23+
}
24+
},
25+
// Features to add to the dev container. More info: https://containers.dev/features.
26+
// "features": {},
27+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
28+
// "forwardPorts": [],
29+
// Use 'postCreateCommand' to run commands after the container is created.
30+
"postCreateCommand": "bash scripts/post_create_command.sh",
31+
"features": {
32+
"ghcr.io/devcontainers/features/node:1": {
33+
"nodeGypDependencies": true,
34+
"version": "16"
35+
}
36+
},
37+
// Configure tool-specific properties.
38+
// "customizations": {},
39+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
40+
// "remoteUser": "root"
41+
}

scripts/post_create_command.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
export PATH="./node_modules/.bin:$PATH"
4+
5+
gulp installPythonLibs
6+
npm install
7+
npm run compile

0 commit comments

Comments
 (0)