Skip to content

Commit a1d9aab

Browse files
committed
Update devcontainer to install required library
1 parent c23791e commit a1d9aab

File tree

2 files changed

+94
-39
lines changed

2 files changed

+94
-39
lines changed

.devcontainer/devcontainer.json

Lines changed: 50 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,54 @@
11
{
2-
"name": "SmartThinQ Sensors Component",
3-
"image": "mcr.microsoft.com/devcontainers/python:1-3.12",
4-
"postCreateCommand": "scripts/setup",
5-
"forwardPorts": [
6-
8123
7-
],
8-
"portsAttributes": {
9-
"8123": {
10-
"label": "Home Assistant",
11-
"onAutoForward": "notify"
12-
}
13-
},
14-
"customizations": {
15-
"vscode": {
16-
"extensions": [
17-
"ms-python.black-formatter",
18-
"ms-python.pylint",
19-
"ms-python.vscode-pylance",
20-
"visualstudioexptteam.vscodeintellicode",
21-
"redhat.vscode-yaml",
22-
"esbenp.prettier-vscode",
23-
"GitHub.vscode-pull-request-github",
24-
"ryanluker.vscode-coverage-gutters"
25-
],
26-
"settings": {
27-
"files.eol": "\n",
28-
"editor.tabSize": 4,
29-
"python.pythonPath": "/usr/bin/python3",
30-
"python.testing.pytestArgs": ["--no-cov"],
31-
"python.analysis.autoSearchPaths": false,
32-
"editor.formatOnPaste": false,
33-
"editor.formatOnSave": true,
34-
"editor.formatOnType": true,
35-
"files.trimTrailingWhitespace": true
36-
}
2+
"name": "SmartThinQ Sensors Component",
3+
"dockerFile": "../Dockerfile.dev",
4+
"postCreateCommand": "scripts/setup",
5+
"forwardPorts": [
6+
8123
7+
],
8+
"portsAttributes": {
9+
"8123": {
10+
"label": "Home Assistant",
11+
"onAutoForward": "notify"
12+
}
13+
},
14+
"customizations": {
15+
"vscode": {
16+
"extensions": [
17+
"ms-python.black-formatter",
18+
"ms-python.pylint",
19+
"ms-python.vscode-pylance",
20+
"visualstudioexptteam.vscodeintellicode",
21+
"redhat.vscode-yaml",
22+
"esbenp.prettier-vscode",
23+
"GitHub.vscode-pull-request-github",
24+
"ryanluker.vscode-coverage-gutters"
25+
],
26+
"settings": {
27+
"files.eol": "\n",
28+
"editor.tabSize": 4,
29+
"python.pythonPath": "/usr/bin/python3",
30+
"python.testing.pytestArgs": [
31+
"--no-cov"
32+
],
33+
"python.analysis.autoSearchPaths": false,
34+
"editor.formatOnPaste": false,
35+
"editor.formatOnSave": true,
36+
"editor.formatOnType": true,
37+
"files.trimTrailingWhitespace": true,
38+
"terminal.integrated.profiles.linux": {
39+
"zsh": {
40+
"path": "/usr/bin/zsh"
41+
}
42+
},
43+
"terminal.integrated.defaultProfile.linux": "zsh",
44+
"[python]": {
45+
"editor.defaultFormatter": "ms-python.black-formatter"
3746
}
38-
},
39-
"remoteUser": "vscode",
40-
"features": {
41-
"rust": "latest"
47+
}
4248
}
49+
},
50+
"remoteUser": "vscode",
51+
"features": {
52+
"rust": "latest"
53+
}
4354
}

Dockerfile.dev

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM mcr.microsoft.com/devcontainers/python:1-3.12
2+
3+
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
4+
5+
# Uninstall pre-installed formatting and linting tools
6+
# They would conflict with our pinned versions
7+
RUN \
8+
pipx uninstall pydocstyle \
9+
&& pipx uninstall pycodestyle \
10+
&& pipx uninstall mypy \
11+
&& pipx uninstall pylint
12+
13+
RUN \
14+
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
15+
&& apt-get update \
16+
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
17+
# Additional library needed by some tests and accordingly by VScode Tests Discovery
18+
bluez \
19+
ffmpeg \
20+
libudev-dev \
21+
libavformat-dev \
22+
libavcodec-dev \
23+
libavdevice-dev \
24+
libavutil-dev \
25+
libgammu-dev \
26+
libswscale-dev \
27+
libswresample-dev \
28+
libavfilter-dev \
29+
libpcap-dev \
30+
libturbojpeg0 \
31+
libyaml-dev \
32+
libxml2 \
33+
git \
34+
cmake \
35+
&& apt-get clean \
36+
&& rm -rf /var/lib/apt/lists/*
37+
38+
# Install uv
39+
RUN pip3 install uv
40+
41+
WORKDIR /workspaces
42+
43+
# Set the default shell to bash instead of sh
44+
ENV SHELL /bin/bash

0 commit comments

Comments
 (0)