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

Doesn't work with pylint 1.5.0 / astroid 1.4.0 #51

Closed
jribbens opened this issue Nov 29, 2015 · 6 comments
Closed

Doesn't work with pylint 1.5.0 / astroid 1.4.0 #51

jribbens opened this issue Nov 29, 2015 · 6 comments

Comments

@jribbens
Copy link

  File "lib/python3.4/site-packages/pylint_django/utils.py", line 3, in <module>
    from astroid.bases import YES, Instance
ImportError: cannot import name 'YES'

If I fix that then:

  File "lib/python3.4/site-packages/pylint/lint.py", line 486, in load_plugin_modules
    module.register(self)
  File "lib/python3.4/site-packages/pylint_django/plugin.py", line 34, in register
    apply_augmentations(linter)
  File "lib/python3.4/site-packages/pylint_django/augmentations/__init__.py", line 300, in apply_augmentations
    augment_visit(linter, TypeChecker.visit_getattr, foreign_key_sets)
AttributeError: type object 'TypeChecker' has no attribute 'visit_getattr'
@carlio
Copy link
Collaborator

carlio commented Nov 30, 2015

Seems this is an upstream bug in pylint, I created an issue here: https://bitbucket.org/logilab/pylint/issues/711/new-node-visit-methods-not-backwards

@carlio
Copy link
Collaborator

carlio commented Nov 30, 2015

Well, not entirely true - pylint methods were renamed but the backwards-compatability logic seems to have a bug. I have updated this plugin to use the new names but will wait a little to see if it's possible to keep using the old ones too, as otherwise the next pylint-django release will only be compatible with pylint>=1.5

@carlio
Copy link
Collaborator

carlio commented Dec 1, 2015

The latest version on the master branch is working now for Python 2.7. For Python 3.x there seems to be a bug in astroid/pylint which I'm tracking down now.

@carlio
Copy link
Collaborator

carlio commented Dec 1, 2015

0.7 just released on pypi, should have all these issues fixed.

@carlio carlio closed this as completed Dec 1, 2015
@jribbens
Copy link
Author

jribbens commented Dec 2, 2015

Thanks, it seems much better, however the following test script produces an error when linted and it seems to me that it should not:

"""Test case."""
from django.contrib.auth.models import User
User.objects.get(email="hello", password="there")

E: 3, 0: Instance of 'UserManager' has no 'get' member (no-member)

(This is with Python 3.4.3, Django 1.8.7, django-cms 3.2.0, pylint 1.5.0, astroid 1.4.1, pylint-django 0.7.)

@abaldwin1
Copy link

I also see an error similar to what jribbens describes.

pylint --load-plugins=pylint_django -E ./

[... pylint output]
Instance of 'User' has no 'filter' member (no-member)

(Python 2.7.6, Django 1.6.11, pylint 1.5.2, astroid 1.4.3, pylint-django 0.7.1)

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

No branches or pull requests

3 participants