high-magician-46188
01/22/2024, 11:33 AM09:40:51.06 [ERROR] 1 Exception encountered:
UnownedDependencyError: Pants cannot infer owners for the following imports in the target path/to/file1.py:../../../my-package-sources:
* this.is.a.bad.import.to.something (line: 18)
...
I'd like to add to their pre-commit-hook some pants command which will check that.
Is there something that is fast that I can use? (something like pants lint ::
but that will catch this use-case)
I know that pants test ::
catches it, but it runs all of the tests, which is way too much...
(BTW, we currently use Pants 2.17)high-magician-46188
01/22/2024, 11:33 AMcurved-television-6568
01/22/2024, 11:54 AMerror
and run lint
?high-magician-46188
01/22/2024, 12:47 PMpants lint ::
doesn't catch it, not sure why.
I have black
and ruff
funning as linters, maybe I should add something else to trigger the check that I need?curved-television-6568
01/22/2024, 12:51 PMlint
doesn't examine dependencies.. so would need to run something that does.curved-television-6568
01/22/2024, 12:52 PMpants peek :: >/dev/null
? (assuming any error is sent to stderr
)high-magician-46188
01/22/2024, 3:44 PMcurved-television-6568
01/22/2024, 3:47 PMhigh-magician-46188
01/22/2024, 3:58 PMgit commit ...
, and it will block the command from finishing until the pants
command is done as well.high-magician-46188
01/22/2024, 3:59 PMgit commit ...
internally run pants lint [list of files] && pants peek [same list of files]
.happy-kitchen-89482
01/22/2024, 4:11 PMfresh-cat-90827
01/22/2024, 6:16 PMWe could add a fast "dependency lint" that just does dep inferenceinteresting, would this goal be doing what
pants dependencies :: > /dev/null
does? We'd still need to evaluate the whole dep graph, rightfresh-cat-90827
01/22/2024, 6:17 PMperhaps (as a brute force of way)yes, I've been running? (assuming any error is sent topants peek :: >/dev/null
)stderr
pants dependencies :: > /dev/null
myself exactly for the purposes of evaluating the dependency graph for any metadata related issuesnutritious-hair-72580
01/22/2024, 9:34 PMpants test ::
? I was wondering if there's a way to workaround that