Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uv sync --no-self #6315

Closed
hynek opened this issue Aug 21, 2024 · 2 comments
Closed

uv sync --no-self #6315

hynek opened this issue Aug 21, 2024 · 2 comments

Comments

@hynek
Copy link
Contributor

hynek commented Aug 21, 2024

Since Docker is what it is and given how well caching in it works, I like to install my applications in two steps.

First, the dependencies:

COPY pyproject.toml /_lock
COPY pdm.lock /_lock

RUN --mount=type=cache,target=/root/.cache \
    set -ex \
    && cd /_lock \
    && pdm use -i /app/bin/python \
    && pdm sync --no-self --prod

Note, that the source is not copied; as long as the lock file doesn't change, this layer is cached and this is the layer that takes the longest to build.

And then the app:

COPY . /src
RUN --mount=type=cache,target=/root/.cache \
    set -ex \
    && uv pip install --python /app/bin/$PY --no-deps /src

Which is Blazing Fast™ already.

It would be great if something like this were possible with uv sync.

@mkniewallner
Copy link
Contributor

I think that's the same request as #4028?

@hynek
Copy link
Contributor Author

hynek commented Aug 21, 2024

Aw yeah sorry, looks like I searched for the wrong terms and they know. :| Looks like it depends from what side one comes and I don't know Poetry's flags. ;)

@hynek hynek closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants