uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv pip compile|install` can't handle `--no-binary lxml` option in requirements file

Open sergei-maertens opened this issue 4 months ago • 5 comments

This obviously works on pip + pip-tools which we use.

Our relevant base.in:

# other dependencies

# see https://github.com/onelogin/python3-saml/issues/292 and
# https://bugs.launchpad.net/lxml/+bug/1960668 -> we can avoid this by compiling lxml
# against the system libxml2
--no-binary lxml
lxml

# other dependencies

which results in the base.txt:

#
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
#    ./bin/compile_dependencies.sh
#
--no-binary lxml

# ... actual dependencies

pip-tools can produce this file, but uv pip compile doesn't understand this option:

(open-forms) ➜  open-forms git:(chore/1052-remove-defusedxml) uv pip compile requirements/base.in                 
error: Unexpected '-', expected '-c', '-e', '-r' or the start of a requirement in `requirements/base.in` at position 306

Details

Repository is https://github.com/open-formulieren/open-forms so you can take a look at the requirements files yourself (and the ./bin/compile_dependencies.sh script).

$ python --version
Python 3.10.13
$ uv --version
uv 0.1.2

Running in a pre-existing virtualenv.

sergei-maertens avatar Feb 16 '24 09:02 sergei-maertens