WithUv doesn't work with just requirements.txt
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Is your feature request related to a problem? Please describe the problem.
I'm trying to use `.WithUv` on a python project that only has a requirements.txt, and not a pyproject.toml. This doesn't work because when I run the app `.WithUv()` will cause `uv sync` to run, which doesn't install the dependencies from requirements.txt. Instead it should run `uv pip install -r requirements.txt`.
And when I go to deploy the app, I get this error:
```
14:33:59 (build-backend) i [DBG] docker buildx (stderr): #13 DONE 0.1s
14:33:59 (build-backend) i [DBG] docker buildx (stderr): ------
14:33:59 (build-backend) i [DBG] docker buildx (stderr): > [builder 3/6] COPY pyproject.toml /app/:
14:33:59 (build-backend) i [DBG] docker buildx (stderr): ------
14:33:59 (build-backend) i [DBG] docker buildx (stderr): tmpc2uivp.tmp:12
14:33:59 (build-backend) i [DBG] docker buildx (stderr): --------------------
14:33:59 (build-backend) i [DBG] docker buildx (stderr): 10 |
14:33:59 (build-backend) i [DBG] docker buildx (stderr): 11 | # Copy pyproject.toml to install dependencies
14:33:59 (build-backend) i [DBG] docker buildx (stderr): 12 | >>> COPY pyproject.toml /app/
14:33:59 (build-backend) i [DBG] docker buildx (stderr): 13 |
14:33:59 (build-backend) i [DBG] docker buildx (stderr): 14 | # Install dependencies and generate lock file
14:33:59 (build-backend) i [DBG] docker buildx (stderr): --------------------
14:33:59 (build-backend) i [DBG] docker buildx (stderr): ERROR: failed to build: failed to solve: failed to compute cache key: failed to
calculate checksum of ref ngtgltiej6cnsp6a6149o0sm2::dn1xmv6rxxc78of4i22k2fupl: "/pyproject.toml": not found
```
### Describe the solution you'd like
WithUv should support requirements.txt by calling `uv pip install -r requirements.txt` both at runtime and in the dockerfile.
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.