fresh-cat-90827
01/03/2023, 6:57 PM# pants: no-infer-dep
to the import line. Do you think it would be sensible to add a new option to provide list of modules that should be ignored during the inference?
It is a nuisance to add # pants: no-infer-dep
in dozens of files that import a module that should be ignored:
18:45:50.19 [WARN] Pants cannot infer owners for the following imports in the target foo/bar/baz.py:
* some.odd.module.i.do.not.want.to.infer (line: 2)
I am pretty sure this is not currently configurable. If folks think that would be helpful, I'll take a look at the code to see if that would be possible to extend and what would be the effort likebitter-ability-32190
01/03/2023, 6:59 PMfresh-cat-90827
01/03/2023, 6:59 PMbitter-ability-32190
01/03/2023, 7:00 PMsite-packages
or dist-packages
?fresh-cat-90827
01/03/2023, 7:02 PMsrc/app/foo.py
) before the code is run in production.bitter-ability-32190
01/03/2023, 7:03 PMfresh-cat-90827
01/03/2023, 7:03 PMfresh-cat-90827
01/03/2023, 7:04 PMmake
magic and friends :)fresh-cat-90827
01/03/2023, 7:05 PMbitter-ability-32190
01/03/2023, 7:06 PM.pyi
files so you could typecheckfresh-cat-90827
01/03/2023, 7:17 PMTechnically you can do A LOT in Pants through pluginsyes, I know 😛 wanted to check if people think it's a common request to ignore modules like that so that it's worth making it a core feature of Pants. How much of an effort do you think it would be to add such an option?
Is the set of files self-contained?pardon me, do you mean if the generated file depend on anything else in the repo?
You could make empty files in-repo.an important detail - the file is also generated locally to be able to run apps locally during the bootstrap of the local dev env. Having empty files checked in would trigger local Git diffs.
Or Add .pyi files so you could typecheckI haven't realized having a stub would actually matter for the dep inference - I just created a copy of the file as
.pyi
and the inference didn't warn me this time. This may be worth investigating!curved-television-6568
01/03/2023, 7:50 PM.pyi
approach is a good one; great suggestion @bitter-ability-32190 🙂