Skip to content

Commit

Permalink
Prevent pylint import errors on six.moves
Browse files Browse the repository at this point in the history
`six.moves` is a dynamically-created namespace that doesn't actually
exist and therefore `pylint` can't statically analyze it.

By default, `pylint` is smart enough to realize that and ignore the
import errors.

However, because we vendor it, the location changes to
`kafka.vendor.six.moves` so `pylint` doesn't realize it should be
ignored.

So this explicitly ignores it.

`pylint` documentation of this feature:
http://pylint.pycqa.org/en/1.9/technical_reference/features.html?highlight=ignored-modules#id34

More background:
* pylint-dev/pylint#1640
* pylint-dev/pylint#223
  • Loading branch information
jeffwidman committed Oct 24, 2018
1 parent a7e28ae commit 6380c1d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pylint.rc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[TYPECHECK]
ignored-classes=SyncManager,_socketobject
ignored-modules=kafka.vendor.six.moves
generated-members=py.*

[MESSAGES CONTROL]
Expand Down

0 comments on commit 6380c1d

Please sign in to comment.