Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sergei-maertens opened this issue Feb 16, 2024 · 7 comments · Fixed by #2680
Closed
Assignees
Labels
compatibility Compatibility with a specification or another tool enhancement New feature or improvement to existing functionality

Comments

@sergei-maertens
Copy link

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
Copy link
Author

I should've searched better, this is related to #1332 and #977

@charliermarsh
Copy link
Member

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.

@charliermarsh charliermarsh added enhancement New feature or improvement to existing functionality compatibility Compatibility with a specification or another tool labels Feb 16, 2024
@felipewove
Copy link

+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

@charliermarsh
Copy link
Member

@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.

@felipewove
Copy link

@charliermarsh got it, thanks!

I have it automated on my containers, so I'll make some workaround just for some env to test UV ;)

@feelmyears
Copy link

Hi is there any update on supporting --no-binary in a requirements file?

@charliermarsh
Copy link
Member

I can probably add support for this, it's come up multiple times now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants