diff --git a/.travis.yml b/.travis.yml index 491ab8d3..1588ee1b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,8 +30,7 @@ matrix: install: - 'pip install .[qa]' script: - # Ignore F401, which are unused imports. flake8 is a primitive tool and is sometimes wrong. - - 'flake8 --extend-ignore F401 jedi setup.py' + - 'flake8 jedi setup.py' - 'mypy jedi sith.py' install: - sudo apt-get -y install python3-venv diff --git a/jedi/inference/compiled/__init__.py b/jedi/inference/compiled/__init__.py index f4a8691e..09ac19f9 100644 --- a/jedi/inference/compiled/__init__.py +++ b/jedi/inference/compiled/__init__.py @@ -1,23 +1,10 @@ +# This file also re-exports symbols for wider use. We configure mypy and flake8 +# to be aware that this file does this. + from jedi.inference.compiled.value import CompiledValue, CompiledName, \ CompiledValueFilter, CompiledValueName, create_from_access_path from jedi.inference.base_value import LazyValueWrapper -__all__ = ( - 'CompiledValue', - 'CompiledName', - 'CompiledValueFilter', - 'CompiledValueName', - 'create_from_access_path', - - 'LazyValueWrapper', - - 'builtin_from_name', - 'ExactValue', - 'create_simple_object', - 'get_string_value_set', - 'load_module', -) - def builtin_from_name(inference_state, string): typing_builtins_module = inference_state.builtins_module diff --git a/jedi/inference/value/__init__.py b/jedi/inference/value/__init__.py index d35f0647..62164215 100644 --- a/jedi/inference/value/__init__.py +++ b/jedi/inference/value/__init__.py @@ -1,21 +1,9 @@ +# Re-export symbols for wider use. We configure mypy and flake8 to be aware that +# this file does this. + from jedi.inference.value.module import ModuleValue from jedi.inference.value.klass import ClassValue from jedi.inference.value.function import FunctionValue, \ MethodValue from jedi.inference.value.instance import AnonymousInstance, BoundMethod, \ CompiledInstance, AbstractInstanceValue, TreeInstance - -__all__ = ( - 'ModuleValue', - - 'ClassValue', - - 'FunctionValue', - 'MethodValue', - - 'AnonymousInstance', - 'BoundMethod', - 'CompiledInstance', - 'AbstractInstanceValue', - 'TreeInstance', -) diff --git a/setup.cfg b/setup.cfg index 0186cfe8..bc1f1399 100644 --- a/setup.cfg +++ b/setup.cfg @@ -15,6 +15,12 @@ ignore = W503, # Single letter loop variables are often fine E741, +per-file-ignores = + # Ignore apparently unused imports in files where we're (implicitly) + # re-exporting them. + jedi/__init__.py:F401 + jedi/inference/compiled/__init__.py:F401 + jedi/inference/value/__init__.py:F401 exclude = jedi/third_party/* .tox/* [pycodestyle] @@ -48,8 +54,8 @@ implicit_reexport = False strict_equality = True -[mypy-jedi] -# jedi/__init__.py contains only re-exports. +[mypy-jedi,jedi.inference.compiled,jedi.inference.value] +# Various __init__.py files which contain re-exports we want to implicitly make. implicit_reexport = True [mypy-jedi.debug]