-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Updated source for Pylint 1.5. #1248
Conversation
Pylint 1.5 was released yesterday (Nov. 29, 2015). This broke our latest build: Pylint 1.4.4 was released on June 30, 2015 and the maintainers mentioned
|
@@ -340,7 +340,7 @@ def handle_http_exceptions(retry_args): | |||
logging.debug('Response returned a retry-after header, retrying') | |||
retry_after = retry_args.exc.retry_after | |||
else: | |||
raise | |||
raise # pylint: disable=misplaced-bare-raise |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
ae1518f
to
1944ab5
Compare
@@ -106,7 +106,11 @@ def __ne__(self, other): | |||
:rtype: boolean | |||
:returns: False if the entities compare equal, else True. | |||
""" | |||
return not self == other | |||
eq_val = self.__eq__(other) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
1944ab5
to
3073d32
Compare
@tseaver I addressed the |
Seems like we're good except the issue of returning |
Pylint 1.5 brought with it much more than pylint.extensions.check_docs The changes for this PR are - checking import order - checking self._foo is set in __init__ - complaining about methods that don't use self - complaining about not calling super().__init__ (for the virtual base class we used) - complaining about not (self == other) in __ne__, suggested (self != other) instead - complaining about unit tests checking None result from methods which are known (by static analysis?) to return None - complaining about not over-riding virtual method in storage _PropertyMixin - aggressively checking `redefined-variable-type` when variables can be optionally float/int/Entity/Key/etc. - checking that GCloudError constructor is called correctly in unit tests - checking that subclass method overrides use the same arguments (this occurred in BigQuery test_job with _makeResource)
3073d32
to
0c88da4
Compare
@tseaver PTAL. Folded in the Only open question left is local vs. global disabling of |
We can let the current local disabling go, I think: I don't know what it would take to get a "conforming" version in place (one which wouldn't require the local disable). So, LGTM to merge. |
Updated source for Pylint 1.5.
It's impossible to get a conforming version in place. You've inspired me to file an issue with the Pylint folks. The issue was that using try:
import foo
except ImportError:
...
import bar makes the But for some pairs of import bar
try:
import foo
except ImportError:
... makes Pylint angry that the import of |
@tseaver Maybe our |
With the current order (and no ignores): diff --git a/gcloud/_helpers.py b/gcloud/_helpers.py
index b784042..2d44b99 100644
--- a/gcloud/_helpers.py
+++ b/gcloud/_helpers.py
@@ -27,12 +27,10 @@ from six.moves.http_client import HTTPConnection # pylint: disable=F0401
from gcloud.environment_vars import PROJECT
-# pylint: disable=wrong-import-position
try:
from google.appengine.api import app_identity
except ImportError:
app_identity = None
-# pylint: enable=wrong-import-position
_NOW = datetime.datetime.utcnow # To be replaced by tests.
diff --git a/gcloud/credentials.py b/gcloud/credentials.py
index bfe8926..cd61b7f 100644
--- a/gcloud/credentials.py
+++ b/gcloud/credentials.py
@@ -32,7 +32,6 @@ except ImportError:
class _GAECreds(object):
"""Dummy class if not in App Engine environment."""
-# pylint: disable=wrong-import-position
try:
from google.appengine.api import app_identity
except ImportError:
@@ -41,7 +40,6 @@ except ImportError:
from gcloud._helpers import UTC
from gcloud._helpers import _NOW
from gcloud._helpers import _microseconds_from_datetime
-# pylint: enable=wrong-import-position
def get_credentials(): we get the following errors:
Trying to swap the order: diff --git a/gcloud/_helpers.py b/gcloud/_helpers.py
index b784042..2d44b99 100644
--- a/gcloud/_helpers.py
+++ b/gcloud/_helpers.py
@@ -27,12 +27,10 @@ from six.moves.http_client import HTTPConnection # pylint: disable=F0401
from gcloud.environment_vars import PROJECT
-# pylint: disable=wrong-import-position
try:
from google.appengine.api import app_identity
except ImportError:
app_identity = None
-# pylint: enable=wrong-import-position
_NOW = datetime.datetime.utcnow # To be replaced by tests.
diff --git a/gcloud/credentials.py b/gcloud/credentials.py
index bfe8926..11d7227 100644
--- a/gcloud/credentials.py
+++ b/gcloud/credentials.py
@@ -26,23 +26,22 @@ from oauth2client import client
from oauth2client.client import _get_application_default_credential_from_file
from oauth2client import crypt
from oauth2client import service_account
+
+from gcloud._helpers import UTC
+from gcloud._helpers import _NOW
+from gcloud._helpers import _microseconds_from_datetime
+
try:
from oauth2client.appengine import AppAssertionCredentials as _GAECreds
except ImportError:
class _GAECreds(object):
"""Dummy class if not in App Engine environment."""
-# pylint: disable=wrong-import-position
try:
from google.appengine.api import app_identity
except ImportError:
app_identity = None
-from gcloud._helpers import UTC
-from gcloud._helpers import _NOW
-from gcloud._helpers import _microseconds_from_datetime
-# pylint: enable=wrong-import-position
-
def get_credentials():
"""Gets credentials implicitly from the current environment. we get the following errors
|
Filed: https://bitbucket.org/logilab/pylint/issues/714/ It seems if our |
@@ -75,8 +75,7 @@ commands = | |||
python run_pylint.py | |||
deps = | |||
pep8 | |||
-ehg+https://bitbucket.org/logilab/pylint@33e334be064c#egg=pylint | |||
logilab-common<=0.63.0 # Hack for pylint upstream | |||
pylint | |||
unittest2 |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Also filed: https://bitbucket.org/logilab/pylint/issues/716/ |
Pylint 1.5 brought with it much more than
The changes for this PR are
self._foo
is set in__init__
self
super().__init__
(forthe virtual base class we used)
not (self == other)
in__ne__
,suggested
(self != other)
insteadNone
result from methodswhich are known (by static analysis?) to return
None
_PropertyMixin
redefined-variable-type
when variablescan be optionally
float
/int
/Entity
/Key
/ etc.GCloudError
constructor is called correctlyin unit tests
(this occurred in BigQuery
test_job
with_makeResource
)