-
Couldn't load subscription status.
- Fork 121
Internal updates caused by pylint/astroid 2.0. Fixes #182. #183
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
Conversation
|
More notes: For the failing test If I execute pylint-django only against this file everything seems fine: I don't know what is going on here. Update: this seems to work on Python 3.4 !!!! |
|
Excluding the conflict I now have only 1 failing test. If I apply the following diff: then I get only a subset of the tests executed (including the failing one) and this time it passes. This looks very strange. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks sane to me but I don't have enough context on pylint-django to understand more. If you have a particular use case we should look into, let me know!
|
@PCManticore any idea why I get varying results depending on how I execute one of the tests ? |
pylint_django/transforms/__init__.py
Outdated
|
|
||
| # TODO: no sure what to do with commented out code! It looks like | ||
| # we don't need these transforms anymore | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest either leave them in or just a comment with a commit hash and an explanation of 'we removed some transforms' in case new issues get opened wanting them back.
|
Code seems to make sense to me but we're still getting build failures. |
for checking if a module is named wsgi.py or includes 'migrations' in its name we take the first element of the list
According to this documentation http://pylint.pycqa.org/projects/astroid/en/latest/extending.html?highlight=MANAGER#module-extender-transforms the module transform function doesn't accept any parameters and returns a new Module node.
after the previous commit these transformation don't seem to be needed. Maybe the latest pylint/astroid is better at figuring out the internals of these Django classes. Additionally things like django_contrib_postgres_fields.py don't seem to be hooked up anywhere so remove them as well.
previous augmentation was not handling factory objects very well. This is an ammendment to that. I'm not exactly certain why we haven't seen other failures before.
|
@carlio I vote for merging this change if you don't mind. ATM I am at a total loss how to debug the failing test (IMO this is a flaky test) and I've posted the symptoms to code-quality ML hoping for some hints. |
The failing `func_noerror_foreignkeys` was caused by pylint_django
trying to infer a ForeignKey('Author') field by looking at the
astroid cache. In this case there was an Author model already
defined in `func_noerror_duplicate_except_doesnotexist` which
was inferred and of course this model didn't have the `author_name`
field hence we got a no-member error.
This commit tries to restrict where we load these models from
and also takes into account the quirk that Django allows specifying
'appname.Model' instead of 'path.to.python.module.models.Model'.
|
@carlio sorry for the noise. Finally figured out what was wrong with the test. See the last commit. I am up for a release tomorrow, any preferences for teh version number ? Should we also do 2.0 or keep it incremental (0.12 then). |
|
@atodorov Yes I think it's time to have a better version scheme. It just started as I used '0' to mean 'not quite sure this is done yet' and never changed it. I suppose it might as well follow pylint more closely but at least it could get a major version number now I think. |
|
@atodorov and if that number changes, could probably remove the beta classifier at the same time. |
Notes:
The first commit will clash with the latest commit on top of master. I rewrote the commit for a shorter implementation and then realized we had already merged the earlier implementation.
Take a look at the new way we apply transformations. I'm not quite certain this is what we need to be doing here but it fixed couple of failures, namely:
https://travis-ci.org/PyCQA/pylint-django/builds/405211436
func_noerror_model_fieldsandfunc_noerror_ugettext_lazy_format