-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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 should respect uv.lock in the workspace root when invoking pip install -target in a subproject #5653
Comments
|
I am not sure I see a path with |
This comment did help me understand the intent. I think it could work, but |
I think this works well if you intend to deploy as a venv to production, but I am trying to avoid that. Ideally I would have to venv workflow in dev with editable packages, but In prod I would like to have a normal folder with all deps added to PYTHONPATH. Ultimately, this is for AWS lambdas and I am trying to use their base image without changing the entrypoint. I need the prod dependency to be locked, which appears impossible with I could be seeing this all wrong |
To add to this. uv sync doesn't seem to respect |
That's not supported right now. The lockfile is only intended for use in the workspace environment. Very likely we'll support it but we haven't committed to an API yet. |
My use case is probably not the exact same as this ticket's (happy to open another one!), but since the discussion is heading in a somewhat related direction:
Is this a permanent limitation, or something you'd be willing to relax? I think the value there is immense; e.g. when building a Docker image of my package I definitely do not want to Right now our approach is a very simple (either that, I guess projects would have to maintain lockfiles and constraints files side-by-side, but that seems duplicative and possibly error-prone?) |
I'm pretty open-minded about it right now. Is it something we can solve outside of the |
The new I do think the path to creating a production docker image with locked dependencies is a bit cumbersome. Some documentation and best practice would help. |
Can you expand a bit on why either of these two things are a problem? |
Nothing is unsurmountable.. I wouldn't call that a "problem", more like "sub-optimal"? but it feels weird to use venv in docker as they are both different ways to solve the same problem. There was a similar argument on poetry. I don't feel that strongly about it, but many of the folks there did. |
I just stubbled a real use case that I can't see any workaround for. As I am converting the current build system at work, I need to build a zip lambda package for some functions. I don't think either .pth or .venv would wok. |
I would consider that unsupported by the |
I am not sure if the That said, I sense a XY problem brewing here... so let me take a step back and define what I want to achieve (appears to be similar to @jpambrun-vida's use case after all?) instead of the 'how':
|
I sense something like |
I would love that -- I own an equivalent tool in my org and I would love to eventually replace it with off-the-shelf uv commands. (side note: I strenuously avoided the |
Bumping this request. We have the exact same use case. Currently getting around this limitation with
|
Same here, I found that PDM has a packing plugin to handle such cases: https://github.com/frostming/pdm-packer That "bundling" functionality would be great, or at least having the ability to sync into a target directory. Although, sync sounds wrong in this context, I feel like install suits better in this case as the intention is to perform a one-time download of packages into a target location. |
I have a worspace with a virtual top level project. uv sync correctly install and create an
uv.lock
file.Later I need to create multiple docker images from subprojects and I want to narrow the dependencies for each.
My current attempt involves invoking from subproject
However, testing locally by editing the lock files doesn't seem to have any effect (I could be doing this wrong). Also, debug logs with
-v
show no activity around uv.lock.This might be a bit related to #5008.
The text was updated successfully, but these errors were encountered: