Skip to content

UV_COMPILE_BYTECODE=1 please? 🥺 #6493

@hynek

Description

@hynek

Hello, it is I again, your obnoxious Docker user!

As the documentation correctly states, bytecode-compilation is super useful in Docker containers. Could we have a UV_COMPILE_BYTECODE=1 to set once and forget?

If one only uses it to install one app, it's no big deal to also pass --compile-bytecode, but thanks to uv tool, I've got the following block in my build container:

ENV PATH=/root/.local/bin:/root/.cargo/bin:$PATH \
    UV_INDEX_URL=$PIP_INDEX_URL \
    UV_LINK_MODE=copy \
    UV_PYTHON_DOWNLOADS=never \
    UV_PYTHON=/usr/bin/python3.12

RUN --mount=type=cache,target=/root/.cache \
    set -ex \
    && uv tool install --compile-bytecode secret-internal-tool \
    && uv tool install --compile-bytecode pdm \
    && uv tool install --compile-bytecode hatch \
    && uv tool install --compile-bytecode virtualenv \
    && ...

It would be great if I could just move it to the ENVs.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions