Open albertferras-vrf opened 3 weeks ago
Apologies, does it work if you copy over the pyproject.toml
? It might be relying on discovering it but not actually reading from it. Will fix.
Yes, it works after copying pyproject.toml
.
However, it seems like it tries to read it because after creating an empty one (touch pyproject.toml
) then uv sync
fails with 0.092 error: No
projecttable found in:
/opt/app/pyproject.toml``
Yes it reads it to discover the project name, so it can pick out the right dependency tree in the lockfile.
But it does not require the project contents which is the critical piece that would ruin caching.
(The docs are incorrect though.)
What happens if the project has multiple packages (using workspaces), do I need to copy all other pyproject.toml files too?
Let me test it before I try to answer confidently.
Yes, but I think we can fix that part.
I updated the documentation (and added test coverage) for now. We'll follow-up with some other changes.
thank you @charliermarsh !
One suggestion: Maybe we can consider storing the root (?) project name in uv.lock so that pyproject.toml is not needed. it would make it slightly easier to have a working Dockerfile
I think we probably can. Just trying to decide if we should. It creates some weirdness if we don't use the pyproject.toml
to discover the root directory, etc.
@charliermarsh I don't know low-level differences between uv
and pdm
, just to mention the latter is able to update venv without pyproject.toml
with the below command:
pdm sync --no-self
Btw, what is a difference between these two flags?
--locked Assert that the `uv.lock` will remain unchanged
--frozen Sync without updating the `uv.lock` file
@jaklan you can see the extended documentation at https://docs.astral.sh/uv/reference/cli/#uv-sync or uv help sync
.
@zanieb thanks, I haven't noticed docs contain extended version of options' help messages (I used uv sync --help
)
The end of uv sync --help
suggests the longer option and we cover this at https://docs.astral.sh/uv/getting-started/help/ — let me know if there's anything more we can do to emphasize that it's available though!
@zanieb ach lol, haven't noticed the footer at all 😄 Maybe you can make it bold:
Use
uv help sync
for more details.
or put at the top:
❯ uv sync --help Update the project's environment
Note: Use
uv help sync
for more detailed help.Usage: uv sync [OPTIONS] ...
but generally - it was simply my bad, I was just quickly testing uv
and haven't got familiar with the CLI and docs yet
The biggest hangup to doing this is that you lose any configuration specified in the pyproject.toml
, which feels like a footgun.
I'm trying the new feature in today's
0.3.3
release:uv sync --no-install-project
but I could not make it work since it keeps failing becausepyproject.toml
file is not foundThe full
Dockerfile
example provided in the documentation here https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers does not work and raises this error too