2024-12-13 08:22:01 +00:00
|
|
|
FROM mcr.microsoft.com/devcontainers/python:1-3.13
|
2019-06-23 19:18:33 +00:00
|
|
|
|
2021-02-04 11:51:38 +00:00
|
|
|
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
|
|
2022-10-06 23:16:38 +00:00
|
|
|
# Uninstall pre-installed formatting and linting tools
|
|
|
|
# They would conflict with our pinned versions
|
2023-04-12 22:46:54 +00:00
|
|
|
RUN \
|
2023-11-27 13:38:59 +00:00
|
|
|
pipx uninstall pydocstyle \
|
2023-04-12 22:46:54 +00:00
|
|
|
&& pipx uninstall pycodestyle \
|
|
|
|
&& pipx uninstall mypy \
|
|
|
|
&& pipx uninstall pylint
|
2022-10-06 23:16:38 +00:00
|
|
|
|
2020-04-25 23:54:41 +00:00
|
|
|
RUN \
|
2021-02-04 11:51:38 +00:00
|
|
|
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
|
|
|
&& apt-get update \
|
|
|
|
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
2021-09-04 10:16:06 +00:00
|
|
|
# Additional library needed by some tests and accordingly by VScode Tests Discovery
|
|
|
|
bluez \
|
2023-12-30 12:14:49 +00:00
|
|
|
ffmpeg \
|
2019-07-12 07:16:14 +00:00
|
|
|
libudev-dev \
|
|
|
|
libavformat-dev \
|
|
|
|
libavcodec-dev \
|
|
|
|
libavdevice-dev \
|
|
|
|
libavutil-dev \
|
2024-04-23 16:35:53 +00:00
|
|
|
libgammu-dev \
|
2019-07-12 07:16:14 +00:00
|
|
|
libswscale-dev \
|
|
|
|
libswresample-dev \
|
|
|
|
libavfilter-dev \
|
2021-02-11 23:17:49 +00:00
|
|
|
libpcap-dev \
|
2022-01-19 21:04:13 +00:00
|
|
|
libturbojpeg0 \
|
2022-06-13 18:44:46 +00:00
|
|
|
libyaml-dev \
|
2022-05-02 02:04:05 +00:00
|
|
|
libxml2 \
|
2019-07-12 07:16:14 +00:00
|
|
|
git \
|
2022-04-20 07:01:06 +00:00
|
|
|
cmake \
|
2019-06-23 19:18:33 +00:00
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
|
2024-11-11 19:13:20 +00:00
|
|
|
# Add go2rtc binary
|
|
|
|
COPY --from=ghcr.io/alexxit/go2rtc:latest /usr/local/bin/go2rtc /bin/go2rtc
|
|
|
|
|
2024-05-21 07:56:31 +00:00
|
|
|
# Install uv
|
|
|
|
RUN pip3 install uv
|
|
|
|
|
2019-07-12 07:16:14 +00:00
|
|
|
WORKDIR /usr/src
|
|
|
|
|
2019-08-20 17:37:55 +00:00
|
|
|
# Setup hass-release
|
2019-07-12 07:16:14 +00:00
|
|
|
RUN git clone --depth 1 https://github.com/home-assistant/hass-release \
|
2024-08-25 15:24:06 +00:00
|
|
|
&& uv pip install --system -e hass-release/ \
|
|
|
|
&& chown -R vscode /usr/src/hass-release/data
|
2019-07-12 07:16:14 +00:00
|
|
|
|
2024-05-21 07:56:31 +00:00
|
|
|
USER vscode
|
|
|
|
ENV VIRTUAL_ENV="/home/vscode/.local/ha-venv"
|
|
|
|
RUN uv venv $VIRTUAL_ENV
|
|
|
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
|
|
|
|
|
|
|
WORKDIR /tmp
|
2019-06-23 19:18:33 +00:00
|
|
|
|
2019-09-05 12:20:08 +00:00
|
|
|
# Install Python dependencies from requirements
|
2021-12-01 12:20:00 +00:00
|
|
|
COPY requirements.txt ./
|
2020-07-12 23:18:08 +00:00
|
|
|
COPY homeassistant/package_constraints.txt homeassistant/package_constraints.txt
|
2024-05-21 07:56:31 +00:00
|
|
|
RUN uv pip install -r requirements.txt
|
2021-12-01 12:20:00 +00:00
|
|
|
COPY requirements_test.txt requirements_test_pre_commit.txt ./
|
2024-05-21 07:56:31 +00:00
|
|
|
RUN uv pip install -r requirements_test.txt
|
|
|
|
|
|
|
|
WORKDIR /workspaces
|
2019-06-23 19:18:33 +00:00
|
|
|
|
|
|
|
# Set the default shell to bash instead of sh
|
|
|
|
ENV SHELL /bin/bash
|