-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Allow users to install a project's dependencies, without the project itself #4028
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
(Not decided, filed to revisit later.) |
Lots of prior chatter over in python-poetry/poetry#800 |
Maybe see also pypa/pip#11440 for potential use cases. |
(Interestingly, we actually kind of already support what's described in that issue because we allow |
That doesn't support the [extras] syntax (e.g. Personally, I'd love to see support for the syntax suggested here:
[EDIT] |
This works great
So it would also work with PS: uv is such an amazing tool - thanks for building it ❤️ |
I have a use case for that: my blog, which is actually Markdown content only, and is built by Pelican, a pure Python static website generator. In that case the In the mean time, I hacked the process and added a dummy package at the root of my repository:
And added the following directive in [tool.setuptools.packages.find]
include = ["blog"] |
My use case: ansible project with bundled For ansible project, the majority of code are written in yaml, by providing Besides, non-python-package programs like |
We use The first layer just installs the project dependencies; the second adds the projects itself. We hope to write something like: WORKDIR /app
ADD pyproject.toml uv.lock /app
RUN uv sync --no-dev --no-root
ADD src /app
RUN uv sync --no-dev |
In the above scenario of a layered Dockerfile to leverage caching of infrequently changing dependencies, it is important that there is a way to install from At first sight, IMHO this is a critical feature for adoption of |
I agree that something like this is necessary. |
I'll chime in that In particular the idea is that if you have a monorepo you can still copy in your top-level lockfile and not have to copy in anything (not even the |
Yeah 100% agree that you should be able to sync from just the lockfile. The lockfile itself is actually designed to support that (it doesn’t rely on pyproject.toml), but we need to expose the right options to users… |
I can see a few approaches here (all fairly easy to implement, mostly about getting the API right)...
|
In case you’re looking for opinions, I like “seed”. The others are rather generic and I’d have to guess what they exactly mean. |
(Gonna see if we can come up with an API and ship this ~today.) |
Opinions very welcome. |
I think |
Would |
|
Some thoughts.... I think extras would be covered by the normal I worry about I think we might want to use The difficulty is in choosing how to describe what we're selecting. There are a few things we want to be able exclude:
Unfortunately All of these are "local" dependencies, as in they're on the local file system, so It feels like we need a separate flag for excluding just the current project, like Do we need the ability to exclude all local dependencies except the current project? Or can it be done in two steps:
What's the use-case for that? |
I think the only use-case for the Docker caching situation is "exclude all locals". I think excluding the current project (but not other workspace members) is independently useful, like for "virtual projects." We could choose not to solve that here, but we should probably have a design that won't cause us problems in the future if we pursue it. |
Might be worth considering #4422 too when designing a |
What stands out to me is that uv sync is not a command designed for application install or deployment. It sets up the venv and workspace (for development/test?) and all the defaults point towards that use case (?) |
Today we discussed doing something like:
So most usages would just be We may even want to have a dedicated separate command for this with different defaults (per the above). |
#6538) See #4028 A smaller version of #6398 Co-authored-by: Charlie Marsh <[email protected]>
This will be available when we release (soon, I'm sure). Let me know if you encounter any problems! |
This is available now in 0.3.3 |
Is |
@justenstall we're waiting to see how necessary it is since we have |
Can |
No, it's not intended for long-term usage. You're probably looking for #6585 instead (which will release today). |
uv ha añadido soporte para gestionar proyectos. Se prueba en esta PR Relacionado: https://astral.sh/blog/uv-unified-python-packaging EDIT: - Ejemplo de FastAPI oficial: https://github.com/astral-sh/uv-fastapi-example - Hilos discutiendo mejoras para Docker: - astral-sh/uv#4028 - astral-sh/uv#6451 De esos últimos hilos, probablemente queremos añadir el `--frozen` y el `--no-locals` cuando lo implementen. Closes #43 Closes #48 Closes #49
For those who have specified a build-backend and wish to avoid building and installing the project for which you have created the
Thanks to uv community for this project. |
@VigneshVSV Hi, can you help me? I want to add a library (e.g., requests), but when I ran |
@Quang-elec44, Unfortunately, I could not find a quick answer. You could comment out the build section in your # just comment it out
# [build-system]
# requires = ["setuptools>=42", "wheel"]
# build-backend = "setuptools.build_meta" There are |
Not sure if we want this -- it's like Poetry's
--no-root
. Let's wait and see if we can find motivating use-cases for it. Poetry also has this concept of "operating modes" which toggle this automatically.The text was updated successfully, but these errors were encountered: