Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent pylint import errors on six.moves #1609

Merged
merged 1 commit into from
Oct 24, 2018
Merged

Conversation

jeffwidman
Copy link
Collaborator

@jeffwidman jeffwidman commented Oct 24, 2018

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:


This change is Reviewable

`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
@jeffwidman jeffwidman merged commit 6380c1d into master Oct 24, 2018
@jeffwidman jeffwidman deleted the fix-pylint-tests branch October 24, 2018 20:16
@jeffwidman jeffwidman mentioned this pull request Oct 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant