big-xylophone-43403
05/21/2021, 7:20 PMpackage
goal in Pants 2.4.0 🧵big-xylophone-43403
05/21/2021, 7:21 PM[python-setup]
interpreter_constraints = [">=3.7,<=3.8.5"]
interpreter_search_paths = ["<PYENV_LOCAL>", "<PYENV>", "<PATH>"]
big-xylophone-43403
05/21/2021, 7:21 PM./pants package ::
, I’m getting a ERROR: No matching distribution found for setuptools<54.0,>=50.3.0
big-xylophone-43403
05/21/2021, 7:22 PMERROR: Could not find a version that satisfies the requirement setuptools<54.0,>=50.3.0
ERROR: No matching distribution found for setuptools<54.0,>=50.3.0
pid 59496 -> /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
happy-kitchen-89482
05/21/2021, 7:44 PMhappy-kitchen-89482
05/21/2021, 7:46 PM-ldebug
?happy-kitchen-89482
05/21/2021, 7:46 PMhundreds-father-404
05/21/2021, 7:52 PM./pants --backend-packages=pants.backend.python.mixed_interpreter_constraints py-constraints path/to:python_distribution_tgt
? That will confirm this isn't coming from somewhere in your repo and it's a Pants issuebig-xylophone-43403
05/21/2021, 7:56 PM14:55:47.50 [WARN] No Python files/targets matched for the `py-constraints` goal. All target types with Python interpreter constraints: pex_binary, python_library, python_tests
for my distribution targethundreds-father-404
05/21/2021, 8:03 PMpython_distribution
target to have interpreter_constraints
, like we now have for pex_binary
and python_awslambda
?
I think it will still take the transitive closure of your constraints, not just what you set on that distribution
But that way you can set additional constraints + use py-constraints
goalbig-xylophone-43403
05/21/2021, 8:03 PMhundreds-father-404
05/21/2021, 8:03 PMI think it will still take the transitive closure of your constraintsHm, although that does seem desirable to let you override constraints for binary types...and that's how v1 did things iirc
happy-kitchen-89482
05/21/2021, 8:35 PMpython_distribution
having constraints is pertinent here, it seems to me that the global constraints should still apply in this case?hundreds-father-404
05/21/2021, 8:39 PM./pants --backend-packages=pants.backend.python.mixed_interpreter_constraints py-constraints ::
?hundreds-father-404
05/21/2021, 8:42 PMpy-constraints
command doesn't come back showing Py2 is somehow being set as a constraint, then it's unclear what's going onbig-xylophone-43403
05/21/2021, 9:00 PMFinal merged constraints: CPython<=3.8.5,>=3.7
(These are the constraints used if you were to depend on all of the input
files/targets together, even though they may end up never being used together in
the real world. Consider using a more precise query or running `./pants py-
constraints --summary`.)
CPython<=3.8.5,>=3.7
pants-plugins/internal_plugins/packaging/__init__.py
pants-plugins/internal_plugins/packaging/register.py
src/python/gh/core/__init__.py... ..
big-xylophone-43403
05/24/2021, 8:13 PMhundreds-father-404
05/24/2021, 8:22 PMbig-xylophone-43403
05/24/2021, 8:57 PM2.3.0
and see if it still breakshundreds-father-404
05/24/2021, 8:59 PMbig-xylophone-43403
05/24/2021, 9:19 PM2.3.0
and the >=3.7,<=3.8.5
interpreter constraintshundreds-father-404
05/24/2021, 9:22 PM[setuptools]
interpreter_constraints == [">=3.7,<=3.8.5"]
?
That option went away in 2.4.0, but I want to see if that fixes it and gives you a workaroundbig-xylophone-43403
05/24/2021, 9:26 PMhundreds-father-404
05/24/2021, 9:27 PMbig-xylophone-43403
06/07/2021, 10:16 PMhundreds-father-404
06/08/2021, 8:34 PM-ldebug
? Want to make sure it doesn't get lost in this threadhundreds-father-404
06/15/2021, 8:26 PM./pants dependencies path/to:python_distribution_tgt
show? I want to double check there's output, particularly first-party dependencies like python_library
targetshundreds-father-404
06/15/2021, 8:59 PMpython_distribution
is:
python_library(name="debug", sources=[])
Then add :debug
to the dependencies
field of your python_distribution
. Remove [setuptools].interpreter_constraints
from pants.toml
and run ./pants package
- does it work?big-xylophone-43403
06/16/2021, 2:16 PM./pants dependencies path/to:python_distribution_tgt
correctly show all first-party python files.hundreds-father-404
06/16/2021, 2:50 PMbig-xylophone-43403
06/16/2021, 3:24 PMdependencies=[]
field 🤦 Sorry for the false alarm. The CI process executes the package goal for targets that changed since our main branch. And we only ran into the issue when there were changes to the target with missing dependency declaration. Sorry for the false alarm. I confirm everything works with 2.4.0
hundreds-father-404
06/16/2021, 3:26 PMhundreds-father-404
06/16/2021, 5:47 PM