ADD dist dist
COPY requirements_all.txt .
-# ensure UV is installed
-COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# create venv which will be copied to the final image
ENV VIRTUAL_ENV=/app/venv
RUN uv venv $VIRTUAL_ENV
COPY --from=mwader/static-ffmpeg:7.1.1 /ffmpeg /usr/local/bin/
COPY --from=mwader/static-ffmpeg:7.1.1 /ffprobe /usr/local/bin/
+# ensure UV is installed into the base image
+COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
+
# Copy widevine client files to container
RUN mkdir -p /usr/local/bin/widevine_cdm
COPY widevine_cdm/* /usr/local/bin/widevine_cdm/
pass
-async def install_package(package: str, prefer_uv: bool = True) -> None:
+async def install_package(package: str) -> None:
"""Install package with pip, raise when install failed."""
LOGGER.debug("Installing python package %s", package)
- if await get_package_version("uv") is None:
- # uv is not present on this system
- prefer_uv = False
- # determine args (either uv pip or regular pip)
- if prefer_uv:
- args = ["uv", "pip", "install", "--no-cache", "--find-links", HA_WHEELS, package]
- else:
- args = [
- "pip",
- "install",
- "--no-cache-dir",
- "--no-input",
- "--find-links",
- HA_WHEELS,
- package,
- ]
+ args = ["uv", "pip", "install", "--no-cache", "--find-links", HA_WHEELS, package]
return_code, output = await check_output(*args)
if return_code != 0:
- if "Permission denied" in output.decode() and prefer_uv:
- # try again with regular pip
- # uv pip seems to have issues with permissions on docker installs
- await install_package(package, prefer_uv=False)
- return
msg = f"Failed to install package {package}\n{output.decode()}"
raise RuntimeError(msg)
InvalidDataError,
LoginFailed,
MediaNotFoundError,
+ SetupFailedError,
UnplayableMediaError,
)
from music_assistant_models.media_items import (
# us from having to update MA to ensure this provider works.
for package_name in PACKAGES_TO_INSTALL:
await install_package(package_name)
+ # verify if the yt_dlp package is usable
+ try:
+ await asyncio.to_thread(importlib.import_module, "yt_dlp")
+ except ImportError:
+ raise SetupFailedError("Package yt_dlp failed to install")