fresh-cat-90827
04/21/2023, 3:19 PMfresh-cat-90827
04/21/2023, 3:19 PM❯ ./pants dependencies helloworld/greet/greeting.py
//:reqs#setuptools
//:reqs#types-setuptools
helloworld/greet:translations
helloworld/translator/translator.py:lib
Adding a patch:
diff --git a/helloworld/greet/greeting.py b/helloworld/greet/greeting.py
index 6a5eb1a..79d18f9 100644
--- a/helloworld/greet/greeting.py
+++ b/helloworld/greet/greeting.py
@@ -10,6 +10,7 @@ import pkg_resources
from helloworld.translator.translator import LanguageTranslator
+this.is.a.problem
class Greeter:
def __init__(
...
Pants only suggests dependencies on __init__.py
files and target (as per the BUILD file):
❯ ./pants dependencies helloworld/greet/greeting.py
helloworld/greet:translations
Is there a situation when you would want to proceed anyway ignore files with incorrect syntax? I've discovered this by accident when I noticed Pants wasn't reporting dependencies for a file that had many: I used python.interpreter_constraints = ["==3.9.*", "==3.10.*"]
and Python 3.9 was used for dependency inference on a file that contained Python 3.10 syntax.
I think this is a common situation enough (having mixed Python versions) so it perhaps deserves some thought.enough-analyst-54434
04/21/2023, 3:25 PM["==3.9.*", "==3.10.*"]
, you should use [">=3.9,<3.11"]
instead. The former is supported by Pants - sort of, but was never needed. The latter is Python-ecosystem standard and supported everywhere. Twitter added that non-standard-in-the-Python-ecosystem format when it was ignorant of !=
range excludes FWICT back in the day.happy-kitchen-89482
04/21/2023, 6:07 PMhappy-kitchen-89482
04/21/2023, 6:07 PMhappy-kitchen-89482
04/21/2023, 6:08 PMhappy-kitchen-89482
04/21/2023, 6:08 PMfresh-cat-90827
04/21/2023, 7:06 PM--fail-on-parse
or something, but to give only 2 dependencies for a file that has 20 is a huge surprise 🙂fresh-cat-90827
04/21/2023, 7:06 PM