uv
uv copied to clipboard
`uv pip compile|install` can't handle `--no-binary lxml` option in requirements file
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.
I should've searched better, this is related to #1332 and #977
Ah yeah, I think this is a separate issue. We don't support all flags in requirements.txt, only a subset. We could consider adding this one.
+1
All my projects with postgres I use a smaller lib from psycopg2 and uv doesn't support --no-binary yet
psycopg2==2.9.9 --no-binary psycopg2
@felipewove -- Just to clarify, we do support --no-binary on the command-line, like uv pip install psycopg2==2.9.9 --no-binary psycopg2. We just don't support it within a requirements file yet.
@charliermarsh got it, thanks!
I have it automated on my containers, so I'll make some workaround just for some env to test UV ;)
Hi is there any update on supporting --no-binary in a requirements file?
I can probably add support for this, it's come up multiple times now.