villebro opened a new issue #9985:
URL: https://github.com/apache/incubator-superset/issues/9985
We're currently using `pylint==1.9.2` for checking syntax in the python
codebase of Superset. This version is fairly old (released in June 2018) and
fails to work properly with python 3.7 (see the error message below), and is
keeping us from officially moving from 3.6 to 3.7 and onwards. While bumping to
the latest version is done by simply replacing a single line in
`requirements-dev.txt`, fixing all the new errors will take some effort. This
would benefit the project greatly by both improving code quality and help us
officially upgrade to a newer version of Python.
# pylint 1.9.2 on Python 3.7.7
```
$ pylint superset
Using config file /Users/ville/src/incubator-superset/.pylintrc
internal error with sending report for module ['superset/__init__.py']
generator raised StopIteration
Traceback (most recent call last):
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/decorators.py",
line 89, in wrapped
res = next(generator)
StopIteration
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/decorators.py",
line 104, in wrapped
raise StopIteration
StopIteration
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/pylint/lint.py",
line 942, in get_ast
return MANAGER.ast_from_file(filepath, modname, source=True)
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/manager.py",
line 80, in ast_from_file
return AstroidBuilder(self).file_build(filepath, modname)
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/builder.py",
line 153, in file_build
return self._post_build(module, encoding)
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/builder.py",
line 173, in _post_build
self.delayed_assattr(delayed)
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/builder.py",
line 232, in delayed_assattr
for inferred in node.expr.infer():
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/decorators.py",
line 89, in wrapped
res = next(generator)
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/bases.py",
line 95, in _infer_stmts
for inferred in stmt.infer(context=context):
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/context.py",
line 71, in cache_generator
for result in generator:
RuntimeError: generator raised StopIteration
************* Module superset.stats_logger
internal error with sending report for module ['superset/config.py']
generator raised StopIteration
F: 1, 0: <class 'RuntimeError'>: generator raised StopIteration
(astroid-error)
internal error with sending report for module ['superset/legacy.py']
generator raised StopIteration
internal error with sending report for module ['superset/dataframe.py']
generator raised StopIteration
internal error with sending report for module ['superset/constants.py']
generator raised StopIteration
Traceback (most recent call last):
File
"/Users/ville/.pyenv/versions/3.7-dev/lib/python3.7/site-packages/astroid/decorators.py",
line 89, in wrapped
res = next(generator)
StopIteration
```
# pylint 2.5.2
```
$ pylint superset
************* Module superset
superset/__init__.py:18:0: E0401: Unable to import 'flask' (import-error)
superset/__init__.py:19:0: E0401: Unable to import 'werkzeug.local'
(import-error)
superset/__init__.py:18:0: E0401: Unable to import 'flask' (import-error)
superset/__init__.py:19:0: E0401: Unable to import 'werkzeug.local'
(import-error)
************* Module superset.stats_logger
superset/stats_logger.py:20:0: E0401: Unable to import 'colorama'
(import-error)
superset/stats_logger.py:71:4: E0401: Unable to import 'statsd'
(import-error)
superset/__init__.py:18:0: E0401: Unable to import 'flask' (import-error)
superset/__init__.py:19:0: E0401: Unable to import 'werkzeug.local'
(import-error)
superset/stats_logger.py:20:0: E0401: Unable to import 'colorama'
(import-error)
superset/stats_logger.py:71:4: E0401: Unable to import 'statsd'
(import-error)
superset/__init__.py:18:0: E0401: Unable to import 'flask' (import-error)
superset/__init__.py:19:0: E0401: Unable to import 'werkzeug.local'
(import-error)
superset/stats_logger.py:20:0: E0401: Unable to import 'colorama'
(import-error)
superset/stats_logger.py:71:4: E0401: Unable to import 'statsd'
(import-error)
superset/__init__.py:18:0: E0401: Unable to import 'flask' (import-error)
superset/__init__.py:19:0: E0401: Unable to import 'werkzeug.local'
(import-error)
superset/stats_logger.py:20:0: E0401: Unable to import 'colorama'
(import-error)
superset/stats_logger.py:71:4: E0401: Unable to import 'statsd'
(import-error)
superset/__init__.py:18:0: E0401: Unable to import 'flask' (import-error)
superset/__init__.py:19:0: E0401: Unable to import 'werkzeug.local'
(import-error)
superset/stats_logger.py:20:0: E0401: Unable to import 'colorama'
(import-error)
superset/stats_logger.py:71:4: E0401: Unable to import 'statsd'
(import-error)
************* Module superset.forms
superset/forms.py:20:0: E0401: Unable to import
'flask_appbuilder.fieldwidgets' (import-error)
superset/forms.py:21:0: E0401: Unable to import 'wtforms' (import-error)
superset/forms.py:24:0: R0903: Too few public methods (1/2)
(too-few-public-methods)
************* Module superset.config
superset/config.py:33:0: E0401: Unable to import 'cachelib.base'
(import-error)
superset/config.py:34:0: E0401: Unable to import 'celery.schedules'
(import-error)
superset/config.py:35:0: E0401: Unable to import 'dateutil' (import-error)
superset/config.py:36:0: E0401: Unable to import
'flask_appbuilder.security.manager' (import-error)
superset/config.py:49:4: E0401: Unable to import
'flask_appbuilder.security.sqla' (import-error)
superset/config.py:887:8: W1203: Use lazy % formatting in logging functions
(logging-fstring-interpolation)
superset/__init__.py:18:0: E0401: Unable to import 'flask' (import-error)
superset/__init__.py:19:0: E0401: Unable to import 'werkzeug.local'
(import-error)
superset/stats_logger.py:20:0: E0401: Unable to import 'colorama'
(import-error)
superset/stats_logger.py:71:4: E0401: Unable to import 'statsd'
(import-error)
superset/forms.py:20:0: E0401: Unable to import
'flask_appbuilder.fieldwidgets' (import-error)
superset/forms.py:21:0: E0401: Unable to import 'wtforms' (import-error)
superset/forms.py:24:0: R0903: Too few public methods (1/2)
(too-few-public-methods)
...
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]