uv icon indicating copy to clipboard operation
uv copied to clipboard

Question: How to use uv with poetry on CI?

Open Warchant opened this issue 1 year ago • 4 comments

Is it possible to use uv to speed-up poetry install on CI?

Warchant avatar Feb 18 '24 09:02 Warchant

for now:

poetry export > requirements.txt
uv venv
uv pip install -r requirements
poetry install

woutervh avatar Feb 18 '24 13:02 woutervh

We'd need to add support for reading Poetry's dependency format, I'm not sure if we will.

Related:

  • #1650

zanieb avatar Feb 18 '24 17:02 zanieb

for now:

poetry export > requirements.txt
uv venv
uv pip install -r requirements
poetry install

This works, but poetry export > requirements.txt creates UTF16-LE file, while uv pip install -r requirements.txt expects UTF-8, so I manually need to re-save it in UTF8. It is not a problem, but would be cool if uv would detect input file encoding...

uv pip install -r .\requirements.txt
error: failed to read from file `.\requirements.txt`
  Caused by: stream did not contain valid UTF-8

Warchant avatar Feb 18 '24 18:02 Warchant

for now:

poetry export > requirements.txt
uv venv
uv pip install -r requirements
poetry install

Do not redirect stream from poetry export, use -o flag to specify output file (it properly handles user messages and the actual dependency output).

Secrus avatar Feb 19 '24 00:02 Secrus

As of https://github.com/astral-sh/uv/pull/2633 we support reading this directly.

zanieb avatar Mar 25 '24 20:03 zanieb