-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add option to uv export to obtain version in workspace packages #11250
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
Comments
Any updates on this? Thank you |
We have a similar use case, and I believe this sort of setup is very common among organizations. I am curious why it seems like all workspace/monorepo examples completely ignore this use case? Can you provide some insight on this, @konstin? |
I think this would be reasonable to support, though I'm not sure what it would look like. Perhaps |
From my experience it doesn't, or if it does, I would need to know how to apply it correctly. I have made a small minimalist example of the problem here. I have tried very combinations of |
Yeah |
I don't quite follow why |
Use caseI think a very common use case for many companies is to have a set of packages that can be interlinked. As an example, having some sort of Having multiple interconnected packages in a single repository works fantastic locally with We have a package named Now I need to publish my changes, which mean the following (for simplicity assume we just bump the versions manually in respective
Having this sort of workflow easily accessible I think is a core feature, because hardly anyone needs to develop packages that (i) does not need sharing, or (ii) loves extremely loose coupling. I have tried various solutions, but I have yet to find some way of doing this with Your original questionThe I completely honor the desire to be What I have triedIdeally I hope the feature and workflow I am describing can already be handled using |
I think this issue is similar or related to these:
|
Thank you for the example repo!
I'm trying to figure out the exact workflow that needs to be exposed. Would let's say we had this hypothetical workflow, would that do what you need?
I'm trying to figure out whether |
Hi, We internally wrote a script that does exactly that: bump all the workspace packages in the right order and publish to our pypi server. However export is needed at deployment time, where we need to install from a published wheel, not from sources (in the dockerfile of our product we do not want to clone the repo, we just want to use the published package at the right version from our pypi server). So we need the exact dependencies of our internal packages pinned when exporting, as it already happens for external packages. Right now I am build a requirements.txt with a script by merging uv export with the versions of our packages manually parsed from uv.lock file. |
I think your series of commands are precisely what is desired, however I think the problem can be thought of more conceptually. WorkspacesFrom my understanding workspaces in I think workspaces are highly desirable in a setting where you have a set of interconnected packages where you want certainty and robustness about how they interact (which is also reflected by having a shared lockfile). As mentioned previously, you have high certainty about this in a development environment, but as soon you shift to distributing the packages (in current version of Given that workspaces are already a non-PEP initiative, I think it would be highly desirable if
To put it a bit boldly, I think workspaces are almost irrelevant without this feature, I think the amount of issues related to this topic also indicate that it is highly desirable by the community. I think there are multiple ways of solving this problem, and which one is the most ideal in a Back to the questionBeyond the precise series of commands, I think it would be desirable if something along those lines could be achieved automatically. Basically:
|
Summary
Description
We have a monorepo project, which is composed of several python packages. We use uv as project manager and we use a private pypi server where our wheels are published. When creating the docker image for our product we install the packages from the private pypi server, so we need exact versions, and we would like to avoid having to mount the sources, to be sure to have the published version in the final docker image.
Request
We would like to obtain package versions also for workspace members whe using
uv export --frozen
, so that later we can just install the generated requirements file and get packages from the pypi server.Current situation:
Command:
uv export --frozen --no-hashes
Output:
Example
Here we use an hypothetical
--emit-workspace-with-versions
flag, to emit the workspace members as "remote" dependencies.Command:
uv export --frozen --emit-workspace-with-versions --no-hashes
Output:
The versions in the workspace's members here are the ones taken from the
pyproject.toml
file of each member at the time the command is run.The text was updated successfully, but these errors were encountered: