Hi! So in the `pants.toml` we can configure `resol...
# general
m
Hi! So in the
pants.toml
we can configure
resolves_to_no_binary
and
resolves_to_only_binary
. This is great, but I'm not getting my particular use case to work. Let's say I generally want only binaries to be resolved but in the rare cases of that there is no binary, then and only then, I want to allow sources. Unfortunately, setting the following didn't work:
Copy code
[python.resolves_to_only_binary]
__default__ = [":all:"]

[python.resolves_to_no_binary]
__default__ = ["stringcase"]
Is this possible at all?
b
These translate to
pip
, so if you can find the right answer for
pip
, you can find the right answer for Pants -> Pex -> pip
m
I can't seem to get that to work. Using plain pip this works:
Copy code
pip install --force --only-binary :all: --no-binary genson,mdutils genson==1.2.2 mdutils==1.6.0
It is building the source distributions as expected. However, with pants this is not working:
Copy code
[python.resolves_to_only_binary]
__default__ = [":all:"]

[python.resolves_to_no_binary]
__default__ = ["genson", "mdutils"]
At some point it fails with
ERROR: No matching distribution found for genson<2.0,>=1.2.1
b
Can you share your resolves inputs, and what's the full error?
m
It seems that ordering matters and pants/pex always put the no-binary first. I however solved this differently. It looked like our constraints were a bit loose and during dependency resolution pants was actually building wheels from sources (probably due to our recent update to Python 3.11). Tightening the constraints solved this issue for us.
🙌 1
b
Oh the ordering thing is interesting. Might be worth seeing if an issue exists on GitHub for that (for us) and if not, opening one
👍 1
m
In any case thank you for your support @bitter-ability-32190! Your input made me look in the right place for the issue. Much appreciated!
❤️ 1