diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2017-09-21 11:49:00 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2017-09-21 13:41:03 -0400 |
commit | 4dbbb4884c205a1b82ac0deb9c751161a44534fd (patch) | |
tree | 7f07b1623688aaa99998ad3f4678cce26f62f1ae | |
parent | bb25260f001c741d419f5732da4431a548b0749d (diff) | |
download | meson-4dbbb4884c205a1b82ac0deb9c751161a44534fd.zip meson-4dbbb4884c205a1b82ac0deb9c751161a44534fd.tar.gz meson-4dbbb4884c205a1b82ac0deb9c751161a44534fd.tar.bz2 |
flake8: Clean up complained-about unused imports
This also adds a "# noqa: F401" comment on an unused "import lzma",
which we are using it in a try/except block that is being used to
check if the lzma module is importable; of course it is unused.
v2: This turned out to be a little tricky.
mesonbuild/modules/__init__.py had the "unused" import:
from ..interpreterbase import permittedKwargs, noKwargs
However, that meant that the various modules could do things like:
from . import noKwargs # "." is "mesonbuild.modules"
Which breaks when you remove __init__.py's "unused" import. I
could have tagged that import with "# noqa: F401", but instead I
chose to have each of the module import directly from
"..interpreterbase" instead of ".".
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 2 | ||||
-rw-r--r-- | mesonbuild/backend/vs2010backend.py | 1 | ||||
-rw-r--r-- | mesonbuild/modules/__init__.py | 1 | ||||
-rw-r--r-- | mesonbuild/modules/gnome.py | 3 | ||||
-rw-r--r-- | mesonbuild/modules/i18n.py | 3 | ||||
-rw-r--r-- | mesonbuild/modules/modtest.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/pkgconfig.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/python3.py | 3 | ||||
-rw-r--r-- | mesonbuild/modules/qt4.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/qt5.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/rpm.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/windows.py | 2 | ||||
-rw-r--r-- | mesonbuild/wrap/wrap.py | 2 | ||||
-rwxr-xr-x | mesonrewriter.py | 2 |
14 files changed, 13 insertions, 16 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index cd2f053..e9fc041 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, pickle, re, shlex, shutil, subprocess, sys +import os, pickle, re, shlex, subprocess, sys from collections import OrderedDict from . import backends diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 1c87b05..88bab36 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -22,7 +22,6 @@ from .. import build from .. import dependencies from .. import mlog from .. import compilers -from ..build import BuildTarget from ..compilers import CompilerArgs from ..mesonlib import MesonException, File from ..environment import Environment diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index 8b5b210..364bc45 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -4,7 +4,6 @@ from .. import build from .. import dependencies from .. import mlog from ..mesonlib import MesonException -from ..interpreterbase import permittedKwargs, noKwargs class permittedSnippetKwargs: diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 12d3f90..1ab075b 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -17,7 +17,6 @@ functionality such as gobject-introspection, gresources and gtk-doc''' from .. import build import os -import sys import copy import subprocess from . import ModuleReturnValue @@ -30,7 +29,7 @@ from .. import interpreter from . import GResourceTarget, GResourceHeaderTarget, GirTarget, TypelibTarget, VapiTarget from . import find_program, get_include_args from . import ExtensionModule -from . import noKwargs, permittedKwargs +from ..interpreterbase import noKwargs, permittedKwargs # gresource compilation is broken due to the way # the resource compiler and Ninja clash about it diff --git a/mesonbuild/modules/i18n.py b/mesonbuild/modules/i18n.py index 76edb72..d8d539c 100644 --- a/mesonbuild/modules/i18n.py +++ b/mesonbuild/modules/i18n.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys import shutil from os import path @@ -20,7 +19,7 @@ from .. import coredata, mesonlib, build from ..mesonlib import MesonException from . import ModuleReturnValue from . import ExtensionModule -from . import permittedKwargs +from ..interpreterbase import permittedKwargs PRESET_ARGS = { 'glib': [ diff --git a/mesonbuild/modules/modtest.py b/mesonbuild/modules/modtest.py index dd2f215..758eeae 100644 --- a/mesonbuild/modules/modtest.py +++ b/mesonbuild/modules/modtest.py @@ -14,7 +14,7 @@ from . import ModuleReturnValue from . import ExtensionModule -from . import noKwargs +from ..interpreterbase import noKwargs class TestModule(ExtensionModule): diff --git a/mesonbuild/modules/pkgconfig.py b/mesonbuild/modules/pkgconfig.py index 824ba78..aaed820 100644 --- a/mesonbuild/modules/pkgconfig.py +++ b/mesonbuild/modules/pkgconfig.py @@ -19,7 +19,7 @@ from .. import mesonlib from .. import mlog from . import ModuleReturnValue from . import ExtensionModule -from . import permittedKwargs +from ..interpreterbase import permittedKwargs class PkgConfigModule(ExtensionModule): diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py index 94db75c..4fae88b 100644 --- a/mesonbuild/modules/python3.py +++ b/mesonbuild/modules/python3.py @@ -18,7 +18,8 @@ from .. import mesonlib, dependencies from . import ExtensionModule from mesonbuild.modules import ModuleReturnValue -from . import noKwargs, permittedSnippetKwargs +from . import permittedSnippetKwargs +from ..interpreterbase import noKwargs from ..interpreter import shlib_kwargs mod_kwargs = set() diff --git a/mesonbuild/modules/qt4.py b/mesonbuild/modules/qt4.py index 37e630b..a63aff8 100644 --- a/mesonbuild/modules/qt4.py +++ b/mesonbuild/modules/qt4.py @@ -20,7 +20,7 @@ from ..dependencies import Qt4Dependency from . import ExtensionModule import xml.etree.ElementTree as ET from . import ModuleReturnValue -from . import permittedKwargs +from ..interpreterbase import permittedKwargs class Qt4Module(ExtensionModule): tools_detected = False diff --git a/mesonbuild/modules/qt5.py b/mesonbuild/modules/qt5.py index ef3d52f..08ce662 100644 --- a/mesonbuild/modules/qt5.py +++ b/mesonbuild/modules/qt5.py @@ -20,7 +20,7 @@ from ..dependencies import Qt5Dependency from . import ExtensionModule import xml.etree.ElementTree as ET from . import ModuleReturnValue -from . import permittedKwargs +from ..interpreterbase import permittedKwargs class Qt5Module(ExtensionModule): tools_detected = False diff --git a/mesonbuild/modules/rpm.py b/mesonbuild/modules/rpm.py index b0a8db9..dbb01f7 100644 --- a/mesonbuild/modules/rpm.py +++ b/mesonbuild/modules/rpm.py @@ -22,7 +22,7 @@ from .. import mlog from . import GirTarget, TypelibTarget from . import ModuleReturnValue from . import ExtensionModule -from . import noKwargs +from ..interpreterbase import noKwargs import os diff --git a/mesonbuild/modules/windows.py b/mesonbuild/modules/windows.py index ab215dc..c16d7a8 100644 --- a/mesonbuild/modules/windows.py +++ b/mesonbuild/modules/windows.py @@ -20,7 +20,7 @@ from ..mesonlib import MesonException, extract_as_list from . import get_include_args from . import ModuleReturnValue from . import ExtensionModule -from . import permittedKwargs +from ..interpreterbase import permittedKwargs class WindowsModule(ExtensionModule): diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index ac84d0e..933bbd5 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -299,7 +299,7 @@ class Resolver: def extract_package(self, package): if sys.version_info < (3, 5): try: - import lzma + import lzma # noqa: F401 del lzma except ImportError: pass diff --git a/mesonrewriter.py b/mesonrewriter.py index c8af3a8..e6f2637 100755 --- a/mesonrewriter.py +++ b/mesonrewriter.py @@ -23,7 +23,7 @@ # - move targets # - reindent? -from mesonbuild import mesonmain, mlog +from mesonbuild import mesonmain import sys if __name__ == '__main__': |