add better comments for mypy suppressions

pull/11938/head
Eli Schwartz 1 year ago
parent 4fab71f481
commit 3171fc5338
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      mesonbuild/modules/gnome.py
  2. 1
      mesonbuild/modules/pkgconfig.py

@ -1744,7 +1744,7 @@ class GnomeModule(ExtensionModule):
'identifier_prefix', 'symbol_prefix',
'vhead', 'vprod', 'vtail']
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
cmd += ['--' + arg.replace('_', '-'), kwargs[arg]] # type: ignore
@ -1966,7 +1966,7 @@ class GnomeModule(ExtensionModule):
mlog.bold('https://github.com/mesonbuild/meson/pull/2049'),
once=True, fatal=False)
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
cmd.append(f'--{k.replace("_", "-")}')

@ -649,6 +649,7 @@ class PkgConfigModule(NewExtensionModule):
if dataonly:
default_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
raise mesonlib.MesonException(f'Cannot combine dataonly with any of {blocked_vars}')
default_install_dir = os.path.join(state.environment.get_datadir(), 'pkgconfig')

Loading…
Cancel
Save