Skip to content

Issue: Docker build - uv.lock gets ignored #200

Open
@FranzForstmayr

Description

@FranzForstmayr

I ran into an issue with litestar_saq recently when using litestar_fullstack and found out the underlying problem is the uv build process.

When running the unit tests in CI the project's dependencies are installed with the versions specified in uv.lock.

For example:

[[package]]
name = "litestar-saq"
version = "0.3.0"
source = { registry = "https://pypi.org/simple" }
dependencies = [
    { name = "litestar" },
    { name = "saq" },
]
sdist = { url = "https://files.pythonhosted.org/packages/42/f6/c8a5dd23b9f31952e691f5ffac15af5bd2722f8690a1664bce66b8f96b00/litestar_saq-0.3.0.tar.gz", hash = "sha256:4a885edc6fc90e2aaad239b566c7e0f09e13ebf42b7ac7fbc75a547e5b36745d", size = 86114 }
wheels = [
    { url = "https://files.pythonhosted.org/packages/84/5e/df4db72b9427a5e77c2bbbf4c0df204cfd58c795debf9b3d3acd3b443637/litestar_saq-0.3.0-py3-none-any.whl", hash = "sha256:7c58c60203b76b66b482bde98b5686f3541e3c36f1e5dbbc2d9d572b91011dcb", size = 15140 },
]

However when building the container, the uv.lock file is obviously ignored, as pip list reports the following inside the container.

litestar                   2.14.0
litestar-granian           0.9.0
litestar-htmx              0.4.1
litestar-saq               0.4.0
litestar-vite              0.13.0

In this case all my unit tests pass, but the docker container is unable to start due to a failing import from litestar_saq.

In my opinion the docker build should use exactly the versions from uv.lock to avoid any issues like this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions