https://pantsbuild.org/ logo
#general
Title
# general
r

rapid-exabyte-76685

03/27/2022, 8:24 AM
Is there a way to explicitly enable
PIP_NO_BINARY
for a single dependency, via an
override
key on
poetry_requirements
etc? I'm currently developing on an M1 and there is currently an issue with the grpc package and the way its binary is shipped (see https://groups.google.com/g/grpc-io/c/9iM4SPpOyC8 for a great summary).
And it doesn't look like
PIP_NO_BINARY=grpcio ./pants <goal> <target>
seems to work either for me, whereas it does with
pipenv
h

happy-kitchen-89482

03/28/2022, 5:55 AM
Today there is not, but it's being tracked in this issue: https://github.com/pantsbuild/pants/issues/14685
If you could comment on that issue with your use case it would help with prioritizing it. And also with the potential solution. E.g., the suggestion there is to use flags in requirements.txt, but it sounds like you have poetry requirements, not requirements.txt, and we'd need to check how that specifies such options
r

rapid-exabyte-76685

03/28/2022, 6:20 AM
It appears that poetry doesn't support this, there is an open issue https://github.com/python-poetry/poetry/issues/365
I don't have to use
poetry_requirements
if this support was going to be landed in
python_requirements
first.
h

hundreds-father-404

03/28/2022, 2:55 PM
Re poetry, we can still get this working with poetry through something like this
Copy code
poetry_requirements(
   overrides={"req": {"pip_options": ["--no-binary"]}},
)
h

happy-kitchen-89482

03/28/2022, 3:48 PM
Thanks for the issue comment!
@hundreds-father-404 that would set
--no-binary
for just a single requirement?
h

hundreds-father-404

03/28/2022, 5:50 PM
yeah, but John has explained before iirc that that option applies to the whole requirements.txt. There are a few pip options like that. So we'd need to do something fancy like group all
--no-binary
targets into the same reqs.txt
Reminder that Pants works on in-memory
python_requirement
targets; the input
requirements.txt
is only to generate those targets. We never tell Pants
-r my_reqs.txt
. And that's important so that inline targets & Poetry continue to work properly I think the modeling must live on
python_requirement
targets