dry-analyst-73584
01/21/2022, 5:54 PM[python].interpreter_constraints
to CPython>=2.7,<3 and pants instructed me to generate a new lockfile for pytest. Running /v2pants generate-lockfiles --resolve=pytest
fails on what looks like a py2/3 compatibility error in parsing python imports.
ProcessExecutionFailure: Process 'Determine Python imports for src/python/fsluigi/main.py' failed with exit code 1.
stdout:
stderr:
Traceback (most recent call last):
File "./__parse_python_imports.py", line 114, in <module>
main(sys.argv[1])
File "./__parse_python_imports.py", line 105, in main
visitor.visit(tree)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
self.visit(item)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
self.visit(item)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
self.visit(item)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 249, in generic_visit
self.visit(item)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 251, in generic_visit
self.visit(value)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ast.py", line 241, in visit
return visitor(node)
File "./__parse_python_imports.py", line 57, in visit_Call
elif isinstance(node.args[0], ast.Constant):
AttributeError: 'module' object has no attribute 'Constant'
hundreds-father-404
01/21/2022, 5:56 PMflsuigi/main.py
to us, even if over DM? I'm curious if we can narrow down what's causing the parse error and fix it. That's a critical bugdry-analyst-73584
01/21/2022, 5:56 PMhundreds-father-404
01/21/2022, 5:57 PMPants itself still appears to be running python3.9, but maybe part of the import parsing is being affected by my new interpreter constraint?Yep, each file is parsed using the interpreter constraints you specify for that file
dry-analyst-73584
01/21/2022, 5:58 PMhundreds-father-404
01/21/2022, 6:00 PMDo you need the whole thing or only the imports?If you have the time, it would be super helpful to try to find the minimal reproduction. Meaning, delete some things and run again to see if it still fails. We want to find the specific line(s) that cause the parse error and remove all the other noise
dry-analyst-73584
01/21/2022, 6:02 PMgenerate-lockfiles
to only run on this file?hundreds-father-404
01/21/2022, 6:02 PM./pants dependencies path/to/fsluigi/main.py
-- it's failing at dependency inference timedry-analyst-73584
01/21/2022, 6:02 PMhundreds-father-404
01/21/2022, 6:08 PMdry-analyst-73584
01/21/2022, 6:08 PM__import__()
hundreds-father-404
01/21/2022, 6:08 PM__import__
, okaydry-analyst-73584
01/21/2022, 6:08 PMa61fb7681862 (Eric Arellano 2018-08-21 16:22:48 -0700 32) __import__("{}.{}".format(module_prefix, modname), fromlist="dummy")
😂hundreds-father-404
01/21/2022, 6:11 PMdry-analyst-73584
01/21/2022, 6:11 PMhundreds-father-404
01/21/2022, 6:11 PMdry-analyst-73584
01/21/2022, 6:11 PMcommit a61fb76818627a80c1865d0ab00af0b820c9904f
Author: Eric Arellano <ericarellano@me.com>
Date: Tue Aug 21 16:22:48 2018 -0700
Modernize/string interpolation luigi (#8312)
if profile_path:
import cProfile
which pants appears to handle correctly.src/fsluigi
to pants_ignore so I could keep going. I'm now running into a new error:
The current project's Python requirement (>=2.7,<3 || >=3.6,<4) is not compatible with some of the required packages Python requirement:
- pytest requires Python >=3.6, so it will not be satisfied for Python >=2.7,<3
My python requirement is only >=2,<3
, I'm not sure where the other version constraint is coming from, or why it claims pytest requires >=3.6.hundreds-father-404
01/21/2022, 6:56 PMdry-analyst-73584
01/21/2022, 6:57 PMhundreds-father-404
01/21/2022, 7:08 PMdry-analyst-73584
01/21/2022, 7:20 PMhundreds-father-404
01/21/2022, 7:29 PMdry-analyst-73584
01/21/2022, 7:33 PM==3.6
to <=4.6
and I have yet to see if that will break anything.happy-kitchen-89482
01/21/2022, 11:07 PMdry-analyst-73584
01/22/2022, 1:28 AMhappy-kitchen-89482
01/22/2022, 3:31 AMdry-analyst-73584
01/22/2022, 3:38 AMhappy-kitchen-89482
01/22/2022, 3:13 PMdry-analyst-73584
01/22/2022, 5:48 PM