From cd5dba5358e8a4f7a9d4a1ebf315db1f65c87180 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Sat, 3 Mar 2018 15:56:33 +0000 Subject: [PATCH] Fix flake8 'imported but unused' reports $ flake8 | grep F401 ./meson.py:17:1: F401 'mesonbuild.mesonlib' imported but unused ./meson.py:18:1: F401 'locale' imported but unused ./run_unittests.py:24:1: F401 'sys' imported but unused ./mesonbuild/minit.py:2:1: F401 'pyclbr.Function' imported but unused ./mesonbuild/minit.py:18:1: F401 'os' imported but unused ./mesonbuild/backend/vs2010backend.py:15:1: F401 'sys' imported but unused ./mesonbuild/backend/xcodebackend.py:19:1: F401 'sys' imported but unused ./mesonbuild/dependencies/ui.py:20:1: F401 'shutil' imported but unused ./mesonbuild/modules/python3.py:15:1: F401 'sys' imported but unused ./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..compilers' imported but unused ./mesonbuild/modules/unstable_icestorm.py:15:1: F401 '..mlog' imported but unused ./test cases/common/98 gen extra/srcgen3.py:3:1: F401 'os' imported but unused --- meson.py | 4 ++-- mesonbuild/backend/vs2010backend.py | 2 +- mesonbuild/backend/xcodebackend.py | 2 +- mesonbuild/dependencies/ui.py | 1 - mesonbuild/minit.py | 3 +-- mesonbuild/modules/python3.py | 1 - mesonbuild/modules/unstable_icestorm.py | 2 +- run_unittests.py | 1 - test cases/common/98 gen extra/srcgen3.py | 1 - 9 files changed, 6 insertions(+), 11 deletions(-) diff --git a/meson.py b/meson.py index 13bc870e6..abbac6f4a 100755 --- a/meson.py +++ b/meson.py @@ -14,8 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from mesonbuild import mesonmain, mesonlib -import sys, os, locale +from mesonbuild import mesonmain +import sys, os def main(): # Always resolve the command path so Ninja can find it for regen, tests, etc. diff --git a/mesonbuild/backend/vs2010backend.py b/mesonbuild/backend/vs2010backend.py index 057e7c9e9..7f4c2ef95 100644 --- a/mesonbuild/backend/vs2010backend.py +++ b/mesonbuild/backend/vs2010backend.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import os, sys +import os import pickle import xml.dom.minidom import xml.etree.ElementTree as ET diff --git a/mesonbuild/backend/xcodebackend.py b/mesonbuild/backend/xcodebackend.py index 3ae31e4c5..fae58898a 100644 --- a/mesonbuild/backend/xcodebackend.py +++ b/mesonbuild/backend/xcodebackend.py @@ -16,7 +16,7 @@ from . import backends from .. import build from .. import dependencies from .. import mesonlib -import uuid, os, sys +import uuid, os from ..mesonlib import MesonException diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py index 3e2d1707b..a84decfcf 100644 --- a/mesonbuild/dependencies/ui.py +++ b/mesonbuild/dependencies/ui.py @@ -17,7 +17,6 @@ import os import re -import shutil import subprocess from collections import OrderedDict diff --git a/mesonbuild/minit.py b/mesonbuild/minit.py index 98817cba4..62e2639ae 100644 --- a/mesonbuild/minit.py +++ b/mesonbuild/minit.py @@ -1,5 +1,4 @@ # Copyright 2017 The Meson development team -from pyclbr import Function # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -15,7 +14,7 @@ from pyclbr import Function """Code that creates simple startup projects.""" -import os, sys, argparse, re +import sys, argparse, re from glob import glob lib_h_template = '''#pragma once diff --git a/mesonbuild/modules/python3.py b/mesonbuild/modules/python3.py index 989e839a9..9fd9f8098 100644 --- a/mesonbuild/modules/python3.py +++ b/mesonbuild/modules/python3.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys import sysconfig from .. import mesonlib, dependencies diff --git a/mesonbuild/modules/unstable_icestorm.py b/mesonbuild/modules/unstable_icestorm.py index 0b7b33959..761d583d9 100644 --- a/mesonbuild/modules/unstable_icestorm.py +++ b/mesonbuild/modules/unstable_icestorm.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .. import mesonlib, compilers, mlog +from .. import mesonlib from . import ExtensionModule diff --git a/run_unittests.py b/run_unittests.py index b69aaae2c..a6d28c850 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -21,7 +21,6 @@ import tempfile import textwrap import os import shutil -import sys import unittest from unittest import mock from configparser import ConfigParser diff --git a/test cases/common/98 gen extra/srcgen3.py b/test cases/common/98 gen extra/srcgen3.py index ad0a5cb09..b7371143a 100644 --- a/test cases/common/98 gen extra/srcgen3.py +++ b/test cases/common/98 gen extra/srcgen3.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 -import os import sys import argparse