From 302df6c2daf4ae2ecfa28abf78da82800d9e73ba Mon Sep 17 00:00:00 2001 From: 0x1f6 <178943044+0x1f6@users.noreply.github.com> Date: Tue, 6 Oct 2026 02:23:39 +0200 Subject: [PATCH] =?UTF-8?q?Image:=20~900=20MB=20lighter=20=E2=80=94=20uv?= =?UTF-8?q?=20cache,=20langpacks,=20docs,=20wallpapers,=20mypy=20out?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Measured on the current image (3.29 GB): /root/.cache/uv held 266 MB after sync (--no-cache now); glibc-langpack-* plus their /usr/lib and /usr/share locale data ~460 MB (only en stays); /usr/share doc/man/info + wallpapers ~150 MB. mypy moved from the dev group to a types group that the image does not install (uv sync --frozen --group tracker); pytest and ruff stay because CI tests inside the product environment. uv.lock relocked for the group change. --- pack/Containerfile | 12 ++++++++++-- pyproject.toml | 5 +++++ uv.lock | 6 ++++-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/pack/Containerfile b/pack/Containerfile index 65241d7..4192f52 100644 --- a/pack/Containerfile +++ b/pack/Containerfile @@ -21,7 +21,11 @@ RUN dnf -y install --setopt=install_weak_deps=False \ # the KDE/Qt stack has no PyPI wheels, so it stays a dnf package python3-pyside6 kf6-kirigami kf6-qqc2-desktop-style qt6-qtwayland \ breeze-icon-theme plasma-breeze krdp freerdp tigervnc-x11-server xrandr \ - && dnf clean all + && dnf -y remove 'glibc-langpack-*' \ + && dnf -y install glibc-langpack-en \ + && dnf clean all \ + && rm -rf /usr/share/doc/* /usr/share/man/* /usr/share/info/* \ + /usr/share/wallpapers # uv, pinned. Python dependencies come from the committed uv.lock, not from # whatever PyPI serves on build day. @@ -47,7 +51,11 @@ RUN install -d /opt/frametop/include /opt/frametop/lib \ # variable comes first so the venv lands in /opt/frametop/venv. ENV UV_PROJECT_ENVIRONMENT=/opt/frametop/venv COPY pyproject.toml uv.lock .python-version /src/frametop/ -RUN cd /src/frametop && uv sync --frozen --all-groups +# uv sync --frozen --group tracker: the default groups (dev: pytest/ruff for +# CI's in-image tests; tracker: the hand tracker's stack) plus the tracker — +# the `types` group (mypy) stays out. --no-cache keeps uv's download cache +# out of the image. +RUN cd /src/frametop && uv sync --frozen --group tracker --no-cache # The sources, then the binaries (built as the Frame-side build scripts build # them; outputs go to /opt/frametop/bin). Hand tracking is deferred exactly as diff --git a/pyproject.toml b/pyproject.toml index 463020b..3aa1694 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,6 +14,11 @@ dev = [ "pytest>=8", "ruff>=0.14", "pyflakes>=3.4", +] +# type checking is dev tooling outside the image: the image installs the +# default groups (dev for CI's pytest/ruff, tracker for the hand tracker) +# but not this one +types = [ "mypy>=1.19", ] tracker = [ diff --git a/uv.lock b/uv.lock index 6cdd866..d71d230 100644 --- a/uv.lock +++ b/uv.lock @@ -117,7 +117,6 @@ source = { virtual = "." } [package.dev-dependencies] dev = [ - { name = "mypy" }, { name = "pyflakes" }, { name = "pytest" }, { name = "ruff" }, @@ -127,12 +126,14 @@ tracker = [ { name = "numpy" }, { name = "opencv-python-headless" }, ] +types = [ + { name = "mypy" }, +] [package.metadata] [package.metadata.requires-dev] dev = [ - { name = "mypy", specifier = ">=1.19" }, { name = "pyflakes", specifier = ">=3.4" }, { name = "pytest", specifier = ">=8" }, { name = "ruff", specifier = ">=0.14" }, @@ -142,6 +143,7 @@ tracker = [ { name = "numpy", specifier = ">=2.2" }, { name = "opencv-python-headless", specifier = ">=4.11" }, ] +types = [{ name = "mypy", specifier = ">=1.19" }] [[package]] name = "fsspec"