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

important-librarian-62877

06/04/2020, 2:04 AM
Hi there, I am currently upgrading from pants 1.8 to 1.28 (yay), but am running into a slight issue with a requirement library. Most of our code is python3, but we do have a requirement on the old futures python2 backport. When I try to build with pants, it attempts to pull the futures module from the python3 repositories. I have tried these two things: 1. Setting the
interpreter_constraints
to include CPython2.7 2. Adding compatibility to the python_requirement_library like so:
Copy code
python_requirement_library(
  name='futures',
  requirements=[python_requirement(name='futures', requirement='futures==3.2.0', compatibility='CPython>=2.7,<3')])
Any suggestions on how to pull that requirement from the python2 repositories or can you point me to some relevant documentation? Thanks in advance 🙂
❤️ 1
h

happy-kitchen-89482

06/04/2020, 3:04 AM
Hi! Happy to help if I can. What did you set
interpreter_constraints
to? And what interpreter do you use to run your code?
I'll also cc @hundreds-father-404 who is more likely to know what's going on
h

hundreds-father-404

06/04/2020, 3:39 AM
Hello! I don’t think I follow what you mean by repositories. Do you mean a private host for dependencies (aka “cheeseshop”)? (Also, please @ me when responding. I’m afk tomorrow and not actively checking Slack, but want to help as best I can)
i

important-librarian-62877

06/04/2020, 2:56 PM
I had set
interpreter_constraints
to
['CPython>=2.7,<=3.6.9']
. Our interpreter for a majority of the code is 3.6.9. @hundreds-father-404 by repository, I just mean it's using pip3 instead of pip. We do not setup our own to pull from.
h

happy-kitchen-89482

06/04/2020, 11:40 PM
pip3 and pip pull from regular pypi, AFAIK. But Pants uses pex, which vendors pip, so I'm not sure in what context you're seeing pip3 being invoked. Can you send the command you're running and the full output you're seeing? (redacting anything necessary) Thanks
i

important-librarian-62877

06/05/2020, 5:04 PM
I've worked around this by changing the version of futures. If this causes problems I will circle back to this.
h

hundreds-father-404

06/05/2020, 9:24 PM
Okay, glad that that works around it. Please let us know if this is still an issue and if we can help!
5 Views