pants is issuing warnings about "cannot infer owne...
# general
p
pants is issuing warnings about "cannot infer owners" (pants 2.14 changed the
[python-infer].unowned_dependency_behavior
default from ignore to warn). But, in at least some of the cases, the indicated lines already have
# pylint: disable=import-error
, so how should I add
# pants: no-infer-dep
when there is already a disable comment for other tools?
h
you chain them together including the
#
So
# pylint: disable=import-error # pants: no-infer-dep
is what we had to do
👍 1
p
Well, that's ugly. I had to do this because of line length:
Copy code
from keyczar.keys import (  # pylint: disable=import-error
        AesKey as KeyczarAesKey,  # pants: no-infer-dep
    )
    from keyczar.keys import (  # pylint: disable=import-error
        HmacKey as KeyczarHmacKey,  # pants: no-infer-dep
    )
    from keyczar.keyinfo import (  # pylint: disable=import-error
        GetMode,  # pants: no-infer-dep
    )
Instead of this:
Copy code
from keyczar.keys import AesKey as KeyczarAesKey  # pylint: disable=import-error
    from keyczar.keys import HmacKey as KeyczarHmacKey  # pylint: disable=import-error
    from keyczar.keyinfo import GetMode  # pylint: disable=import-error
h
would it make sense for Pants to learn to understand the pylint comment?
p
Hmm. Maybe, but would that be surprising?
h
yeah, probably - and they're not necessarily the same thing