Is it possible to set the following setting to a d...
# general
t
Is it possible to set the following setting to a different value for a specific source root (except for using the corresponding CLI flag for running targets in that source asthat does not scale well)?
Copy code
[python-infer]
string_imports_min_dots = 0
πŸ‘€ 1
I would like to add some background information: I need to set this to 0 for my django application as a lot of dependencies do not get inferred otherwise. Here I have
django/app1
for exmaple. In another application, source files include something like
tag="app1"
which is totally unrelated but not django/app1 gets automatically inferred which I is not desired. The problem is that I cannot add a wildcard exclude statemement in the dependencies field.
c
Currently, I think the answer is no, you can’t. But it is an interesting problem to solve πŸ˜‰
t
Can you think of another solution? πŸ˜„ I.e. to exclude all of django for the interference part
c
hmm.. not without writing some custom plugin I think.
also, this issue could be relevant here https://github.com/pantsbuild/pants/pull/17631
πŸ‘€ 1
t
Is it possible to add
# pants: no-infer-dep
to those lines with string imports??
c
Ah.. yes I believe you can. Good find!
that completely slipped my mind πŸ˜…
t
Just tried and does not work 😞
c
oh..
that seems like a missing feature πŸ€”
t
with DAG('dag_name', default_args=default_args, schedule_interval=None, tags=["app1"]) as dag: # pants: no-infer-dep
This is what I tried
c
yea, I looked in the tests, and not seeing any tests for ignoring string deps makes me think this is a case that wasn’t considered yet.. https://github.com/pantsbuild/pants/blob/8384c5cfa73b148a761d6229b34b4205cb24e19d/[…]d/python/dependency_inference/parse_python_dependencies_test.py
t
Okay, I think I am just going to rename that tag
πŸ‘ 1