aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-26 09:37:39 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-09-24 10:36:05 -0700
commit9795323b8649b8615e55cad981d235e432afef02 (patch)
tree4a53251558aca1906f776893604d45ff03cf74dc /mesonbuild
parent92b21a0045e32229f5b3b01429b683fbe1f33abe (diff)
downloadmeson-9795323b8649b8615e55cad981d235e432afef02.zip
meson-9795323b8649b8615e55cad981d235e432afef02.tar.gz
meson-9795323b8649b8615e55cad981d235e432afef02.tar.bz2
pylint: check for duplicate imports
I ran into one of these from LGTM, and it would be nice if pylint could warn me as part of my local development process instead of waiting for the CI to tell me.
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/build.py4
-rw-r--r--mesonbuild/cmake/executor.py1
-rw-r--r--mesonbuild/compilers/cpp.py2
-rw-r--r--mesonbuild/compilers/d.py3
-rw-r--r--mesonbuild/environment.py1
-rw-r--r--mesonbuild/modules/qt.py3
6 files changed, 6 insertions, 8 deletions
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 464b096..01d2719 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -33,7 +33,7 @@ from .mesonlib import (
extract_as_list, typeslistify, stringlistify, classify_unity_sources,
get_filenames_templates_dict, substitute_values, has_path_sep,
OptionKey, PerMachineDefaultable,
- MesonBugException, FileOrString,
+ MesonBugException,
)
from .compilers import (
Compiler, is_object, clink_langs, sort_clink, lang_suffixes,
@@ -902,7 +902,7 @@ class BuildTarget(Target):
if t in self.kwargs:
self.kwargs[t] = listify(self.kwargs[t], flatten=True)
- def extract_objects(self, srclist: T.List[FileOrString]) -> ExtractedObjects:
+ def extract_objects(self, srclist: T.List['FileOrString']) -> ExtractedObjects:
obj_src: T.List['File'] = []
sources_set = set(self.sources)
for src in srclist:
diff --git a/mesonbuild/cmake/executor.py b/mesonbuild/cmake/executor.py
index 7b06f26..65ff730 100644
--- a/mesonbuild/cmake/executor.py
+++ b/mesonbuild/cmake/executor.py
@@ -28,7 +28,6 @@ from ..mesonlib import PerMachine, Popen_safe, version_compare, MachineChoice, i
from ..programs import find_external_program, NonExistingExternalProgram
if T.TYPE_CHECKING:
- from ..environment import Environment
from ..programs import ExternalProgram
TYPE_result = T.Tuple[int, T.Optional[str], T.Optional[str]]
diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py
index 168ba7a..ecc911d 100644
--- a/mesonbuild/compilers/cpp.py
+++ b/mesonbuild/compilers/cpp.py
@@ -47,7 +47,7 @@ if T.TYPE_CHECKING:
from ..environment import Environment
from ..linkers import DynamicLinker
from ..programs import ExternalProgram
- from .mixins.clike import CLikeCompiler as CompilerMixinBase
+ CompilerMixinBase = CLikeCompiler
else:
CompilerMixinBase = object
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index 19706c5..18a5d68 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -33,11 +33,12 @@ from .compilers import (
from .mixins.gnu import GnuCompiler
if T.TYPE_CHECKING:
- from .compilers import Compiler as CompilerMixinBase
from ..programs import ExternalProgram
from ..envconfig import MachineInfo
from ..environment import Environment
from ..linkers import DynamicLinker
+
+ CompilerMixinBase = Compiler
else:
CompilerMixinBase = object
diff --git a/mesonbuild/environment.py b/mesonbuild/environment.py
index a509087..2369439 100644
--- a/mesonbuild/environment.py
+++ b/mesonbuild/environment.py
@@ -49,7 +49,6 @@ from mesonbuild import envconfig
if T.TYPE_CHECKING:
from configparser import ConfigParser
- from .dependencies import ExternalProgram
from .wrap.wrap import Resolver
build_filename = 'meson.build'
diff --git a/mesonbuild/modules/qt.py b/mesonbuild/modules/qt.py
index 19d9a63..7dafad7 100644
--- a/mesonbuild/modules/qt.py
+++ b/mesonbuild/modules/qt.py
@@ -13,7 +13,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from mesonbuild import coredata
import os
import shutil
import typing as T
@@ -21,10 +20,10 @@ import xml.etree.ElementTree as ET
from . import ModuleReturnValue, ExtensionModule
from .. import build
+from .. import coredata
from .. import mlog
from ..dependencies import find_external_dependency, Dependency, ExternalLibrary
from ..mesonlib import MesonException, File, FileOrString, version_compare, Popen_safe
-from . import ModuleReturnValue, ExtensionModule
from ..interpreter import extract_required_kwarg
from ..interpreter.type_checking import NoneType
from ..interpreterbase import ContainerTypeInfo, FeatureDeprecated, KwargInfo, noPosargs, FeatureNew, typed_kwargs