Is there a way to explicitly enable `PIP_NO_BINARY...
# general
r
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
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
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
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
Thanks for the issue comment!
@hundreds-father-404 that would set
--no-binary
for just a single requirement?
h
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