https://pantsbuild.org/ logo
#general
Title
# general
p

proud-dentist-22844

10/31/2022, 7:42 PM
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

high-yak-85899

10/31/2022, 7:43 PM
you chain them together including the
#
So
# pylint: disable=import-error # pants: no-infer-dep
is what we had to do
👍 1
p

proud-dentist-22844

10/31/2022, 7:48 PM
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

hundreds-father-404

10/31/2022, 9:13 PM
would it make sense for Pants to learn to understand the pylint comment?
p

proud-dentist-22844

10/31/2022, 9:14 PM
Hmm. Maybe, but would that be surprising?
h

hundreds-father-404

10/31/2022, 9:37 PM
yeah, probably - and they're not necessarily the same thing
5 Views