add better comments for mypy suppressions
This commit is contained in:
parent
4fab71f481
commit
3171fc5338
|
@ -1744,7 +1744,7 @@ class GnomeModule(ExtensionModule):
|
||||||
'identifier_prefix', 'symbol_prefix',
|
'identifier_prefix', 'symbol_prefix',
|
||||||
'vhead', 'vprod', 'vtail']
|
'vhead', 'vprod', 'vtail']
|
||||||
for arg in known_kwargs:
|
for arg in known_kwargs:
|
||||||
# mypy can't figure this out
|
# Mypy can't figure out that this TypedDict index is correct, without repeating T.Literal for the entire list
|
||||||
if kwargs[arg]: # type: ignore
|
if kwargs[arg]: # type: ignore
|
||||||
cmd += ['--' + arg.replace('_', '-'), kwargs[arg]] # type: ignore
|
cmd += ['--' + arg.replace('_', '-'), kwargs[arg]] # type: ignore
|
||||||
|
|
||||||
|
@ -1966,7 +1966,7 @@ class GnomeModule(ExtensionModule):
|
||||||
mlog.bold('https://github.com/mesonbuild/meson/pull/2049'),
|
mlog.bold('https://github.com/mesonbuild/meson/pull/2049'),
|
||||||
once=True, fatal=False)
|
once=True, fatal=False)
|
||||||
for k in ['internal', 'nostdinc', 'skip_source', 'stdinc', 'valist_marshallers']:
|
for k in ['internal', 'nostdinc', 'skip_source', 'stdinc', 'valist_marshallers']:
|
||||||
# Mypy can't figure out that this is correct
|
# Mypy can't figure out that this TypedDict index is correct, without repeating T.Literal for the entire list
|
||||||
if kwargs[k]: # type: ignore
|
if kwargs[k]: # type: ignore
|
||||||
cmd.append(f'--{k.replace("_", "-")}')
|
cmd.append(f'--{k.replace("_", "-")}')
|
||||||
|
|
||||||
|
|
|
@ -649,6 +649,7 @@ class PkgConfigModule(NewExtensionModule):
|
||||||
if dataonly:
|
if dataonly:
|
||||||
default_subdirs = []
|
default_subdirs = []
|
||||||
blocked_vars = ['libraries', 'libraries_private', 'requires_private', 'extra_cflags', 'subdirs']
|
blocked_vars = ['libraries', 'libraries_private', 'requires_private', 'extra_cflags', 'subdirs']
|
||||||
|
# Mypy can't figure out that this TypedDict index is correct, without repeating T.Literal for the entire list
|
||||||
if any(kwargs[k] for k in blocked_vars): # type: ignore
|
if any(kwargs[k] for k in blocked_vars): # type: ignore
|
||||||
raise mesonlib.MesonException(f'Cannot combine dataonly with any of {blocked_vars}')
|
raise mesonlib.MesonException(f'Cannot combine dataonly with any of {blocked_vars}')
|
||||||
default_install_dir = os.path.join(state.environment.get_datadir(), 'pkgconfig')
|
default_install_dir = os.path.join(state.environment.get_datadir(), 'pkgconfig')
|
||||||
|
|
Loading…
Reference in New Issue