Skip to content

Commit ba3e688

Browse files
renovate-botnicopauss
authored andcommitted
chore(deps): update dependency mypy to v1.19.1 (2024.6)
Notes: * Some hack for Waf decorators where not working anymore => do more hack (we should really make a stub module for Waf). * Some changes in assignment warning required the IOP python stubs generation to be modified. ##### [\`v1.19.1\`](https://github.com/python/mypy/blob/HEAD/CHANGELOG.md#Mypy-1191) - Fix noncommutative joins with bounded TypeVars (Shantanu, PR [20345](python/mypy#20345)) - Respect output format for cached runs by serializing raw errors in cache metas (Ivan Levkivskyi, PR [20372](python/mypy#20372)) - Allow `types.NoneType` in match cases (A5rocks, PR [20383](python/mypy#20383)) - Fix mypyc generator regression with empty tuple (BobTheBuidler, PR [20371](python/mypy#20371)) - Fix crash involving Unpack-ed TypeVarTuple (Shantanu, PR [20323](python/mypy#20323)) - Fix crash on star import of redefinition (Ivan Levkivskyi, PR [20333](python/mypy#20333)) - Fix crash on typevar with forward ref used in other module (Ivan Levkivskyi, PR [20334](python/mypy#20334)) - Fail with an explicit error on PyPy (Ivan Levkivskyi, PR [20389](python/mypy#20389)) ##### [\`v1.19.0\`](python/mypy@v1.18.2...v1.19.0) ##### [\`v1.18.2\`](https://github.com/python/mypy/blob/HEAD/CHANGELOG.md#Mypy-1182) - Fix crash on recursive alias (Ivan Levkivskyi, PR [19845](python/mypy#19845)) - Add additional guidance for stubtest errors when runtime is `object.__init__` (Stephen Morton, PR [19733](python/mypy#19733)) - Fix handling of None values in f-string expressions in mypyc (BobTheBuidler, PR [19846](python/mypy#19846)) ##### [\`v1.18.1\`](python/mypy@v1.17.1...v1.18.1) ##### [\`v1.17.1\`](https://github.com/python/mypy/blob/HEAD/CHANGELOG.md#Mypy-1171) - Retain `None` as constraints bottom if no bottoms were provided (Stanislav Terliakov, PR [19485](python/mypy#19485)) - Fix "ignored exception in `hasattr`" in dmypy (Stanislav Terliakov, PR [19428](python/mypy#19428)) - Prevent a crash when InitVar is redefined with a method in a subclass (Stanislav Terliakov, PR [19453](python/mypy#19453)) ##### [\`v1.17.0\`](python/mypy@v1.16.1...v1.17.0) ##### [\`v1.16.1\`](python/mypy@v1.16.0...v1.16.1) ##### [\`v1.16.0\`](python/mypy@v1.15.0...v1.16.0) ##### [\`v1.15.0\`](python/mypy@v1.14.1...v1.15.0) Renovate-Branch: renovate/2024.6-mypy-1.x Change-Id: Ia7e97fad5a38b3d70e91e29306ab43163528d181 Priv-Id: ab17c4243b73a1088ddad90bdda33a3d77c1d319
1 parent ba64140 commit ba3e688

8 files changed

Lines changed: 233 additions & 116 deletions

File tree

build/waftools/backend.py

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,15 @@
6363
T = TypeVar('T')
6464
def task_gen_decorator(*args: str) -> Callable[[T], T]:
6565
...
66-
TaskGen.feature = task_gen_decorator
67-
TaskGen.before_method = task_gen_decorator
68-
TaskGen.after_method = task_gen_decorator
69-
TaskGen.extension = task_gen_decorator
66+
task_gen_feature = task_gen_decorator
67+
task_gen_before_method = task_gen_decorator
68+
task_gen_after_method = task_gen_decorator
69+
task_gen_extension = task_gen_decorator
70+
else:
71+
task_gen_feature = TaskGen.feature
72+
task_gen_before_method = TaskGen.before_method
73+
task_gen_after_method = TaskGen.after_method
74+
task_gen_extension = TaskGen.extension
7075

7176
# Protocol is not available in Python 3.6 :(
7277
if TYPE_CHECKING:
@@ -80,8 +85,8 @@ def task_gen_decorator(*args: str) -> Callable[[T], T]:
8085
# These functions implement the use_whole attribute, allowing to link a
8186
# library with -whole-archive
8287

83-
@TaskGen.feature('c', 'cprogram', 'cstlib')
84-
@TaskGen.before_method('process_rule')
88+
@task_gen_feature('c', 'cprogram', 'cstlib')
89+
@task_gen_before_method('process_rule')
8590
def prepare_whole(self: TaskGen) -> None:
8691
use_whole = self.to_list(getattr(self, 'use_whole', []))
8792
if not use_whole:
@@ -99,8 +104,8 @@ def prepare_whole(self: TaskGen) -> None:
99104
self.use.append(uw)
100105

101106

102-
@TaskGen.feature('c', 'cprogram', 'cstlib')
103-
@TaskGen.after_method('process_use')
107+
@task_gen_feature('c', 'cprogram', 'cstlib')
108+
@task_gen_after_method('process_use')
104109
def process_whole(self: TaskGen) -> None:
105110
use_whole = self.to_list(getattr(self, 'use_whole', []))
106111
if not use_whole:
@@ -372,8 +377,8 @@ def compile_fuzzing_programs(ctx: BuildContext) -> None:
372377
ldflags=fuzzing_ldflags)
373378

374379

375-
@TaskGen.feature('fuzzing')
376-
@TaskGen.after_method('process_use')
380+
@task_gen_feature('fuzzing')
381+
@task_gen_after_method('process_use')
377382
def fuzzing_feature(ctx: TaskGen) -> None:
378383
# Avoid warning about fuzzing feature
379384
pass
@@ -442,8 +447,8 @@ def register_global_includes(self: BuildContext, includes: List[str]) -> None:
442447
# {{{ Patch tasks to build targets in the source directory
443448

444449

445-
@TaskGen.feature('cprogram', 'cxxprogram')
446-
@TaskGen.after_method('apply_link')
450+
@task_gen_feature('cprogram', 'cxxprogram')
451+
@task_gen_after_method('apply_link')
447452
def deploy_program(self: TaskGen) -> None:
448453
# Build programs in the corresponding source directory
449454
assert (len(self.link_task.outputs) == 1)
@@ -455,8 +460,8 @@ def deploy_program(self: TaskGen) -> None:
455460
self.link_task.hcode += str(self.env.CONFIGURE_TIME).encode('utf-8')
456461

457462

458-
@TaskGen.feature('cshlib')
459-
@TaskGen.after_method('apply_link')
463+
@task_gen_feature('cshlib')
464+
@task_gen_after_method('apply_link')
460465
def deploy_shlib(self: TaskGen) -> None:
461466
# Build C shared library in the corresponding source directory,
462467
# stripping the 'lib' prefix
@@ -477,8 +482,8 @@ def deploy_shlib(self: TaskGen) -> None:
477482
# }}}
478483
# {{{ remove_dynlibs: option to remove all dynamic libraries at link
479484

480-
@TaskGen.feature('cshlib', 'cprogram')
481-
@TaskGen.after_method('apply_link', 'process_use')
485+
@task_gen_feature('cshlib', 'cprogram')
486+
@task_gen_after_method('apply_link', 'process_use')
482487
def remove_dynamic_libs(self: TaskGen) -> None:
483488
if getattr(self, 'remove_dynlibs', False):
484489
self.link_task.env.LIB = []
@@ -907,16 +912,16 @@ def keyword(cls: Type['Blk2c']) -> str:
907912
return 'Rewriting'
908913

909914

910-
@TaskGen.feature('c')
911-
@TaskGen.before_method('process_source')
915+
@task_gen_feature('c')
916+
@task_gen_before_method('process_source')
912917
def init_c_ctx(self: TaskGen) -> None:
913918
self.blk2c_tasks = []
914919
self.clang_check_tasks = []
915920
self.env.CLANG_CFLAGS = self.to_list(getattr(self, 'cflags', []))
916921

917922

918-
@TaskGen.feature('c')
919-
@TaskGen.after_method('propagate_uselib_vars')
923+
@task_gen_feature('c')
924+
@task_gen_after_method('propagate_uselib_vars')
920925
def update_blk2c_envs(self: TaskGen) -> None:
921926
if not self.blk2c_tasks:
922927
return
@@ -931,7 +936,7 @@ def update_blk2c_envs(self: TaskGen) -> None:
931936
task.env.CLANG_EXTRA_CFLAGS = extra_cflags
932937

933938

934-
@TaskGen.extension('.blk')
939+
@task_gen_extension('.blk')
935940
def process_blk(self: TaskGen, node: Node) -> None:
936941
if self.env.COMPILER_CC == 'clang':
937942
# clang is our C compiler -> directly compile the file
@@ -968,14 +973,14 @@ def keyword(cls: Type['Blkk2cc']) -> str:
968973
return 'Rewriting'
969974

970975

971-
@TaskGen.feature('cxx')
972-
@TaskGen.before_method('process_source')
976+
@task_gen_feature('cxx')
977+
@task_gen_before_method('process_source')
973978
def init_cxx_ctx(self: TaskGen) -> None:
974979
self.blkk2cc_tasks = []
975980

976981

977-
@TaskGen.feature('cxx')
978-
@TaskGen.after_method('propagate_uselib_vars')
982+
@task_gen_feature('cxx')
983+
@task_gen_after_method('propagate_uselib_vars')
979984
def update_blk2cc_envs(self: TaskGen) -> None:
980985
if self.blkk2cc_tasks:
981986
# Compute clang extra cflags from g++ flags
@@ -987,7 +992,7 @@ def update_blk2cc_envs(self: TaskGen) -> None:
987992
task.env.CLANGXX_EXTRA_CFLAGS = extra_flags
988993

989994

990-
@TaskGen.extension('.blkk')
995+
@task_gen_extension('.blkk')
991996
def process_blkk(self: TaskGen, node: Node) -> None:
992997
if self.env.COMPILER_CXX == 'clang++':
993998
# clang++ is our C++ compiler -> directly compile the file
@@ -1022,7 +1027,7 @@ def keyword(cls: Type['Perf2c']) -> str:
10221027
return 'Generating'
10231028

10241029

1025-
@TaskGen.extension('.perf')
1030+
@task_gen_extension('.perf')
10261031
def process_perf(self: TaskGen, node: Node) -> None:
10271032
c_node = node.change_ext_src('.c')
10281033

@@ -1045,7 +1050,7 @@ def keyword(cls: Type['Lex2c']) -> str:
10451050
return 'Generating'
10461051

10471052

1048-
@TaskGen.extension('.l')
1053+
@task_gen_extension('.l')
10491054
def process_lex(self: TaskGen, node: Node) -> None:
10501055
c_node = node.change_ext_src('.c')
10511056

@@ -1100,7 +1105,7 @@ def scan(self) -> Tuple[Optional[List[str]], Optional[List[str]]]:
11001105
return (deps, None)
11011106

11021107

1103-
@TaskGen.extension('.fc')
1108+
@task_gen_extension('.fc')
11041109
def process_fc(self: TaskGen, node: Node) -> None:
11051110
ctx = self.bld
11061111

@@ -1142,7 +1147,7 @@ def keyword(cls: Type['Tokens2c']) -> str:
11421147
return 'Generating'
11431148

11441149

1145-
@TaskGen.extension('.tokens')
1150+
@task_gen_extension('.tokens')
11461151
def process_tokens(self: TaskGen, node: Node) -> None:
11471152
c_node = node.change_ext_src('tokens.c')
11481153
h_node = node.change_ext_src('tokens.h')
@@ -1366,7 +1371,7 @@ def iop_get_package_path(self: BuildContext, node: Node) -> str:
13661371
return match.group(1).replace('.', '/')
13671372

13681373

1369-
@TaskGen.extension('.iop')
1374+
@task_gen_extension('.iop')
13701375
def process_iop(self: TaskGen, node: Node) -> None:
13711376
ctx = self.bld
13721377

@@ -1425,7 +1430,7 @@ def process_iop(self: TaskGen, node: Node) -> None:
14251430
# {{{ LD
14261431

14271432

1428-
@TaskGen.extension('.ld')
1433+
@task_gen_extension('.ld')
14291434
def process_ld(self: TaskGen, node: Node) -> None:
14301435
self.env.append_value('LDFLAGS',
14311436
['-Xlinker', '--version-script',
@@ -1450,7 +1455,7 @@ def keyword(cls: Type['Pxc2Pxd']) -> str:
14501455
return 'Pxcc'
14511456

14521457

1453-
@TaskGen.extension('.pxc')
1458+
@task_gen_extension('.pxc')
14541459
def process_pxcc(self: TaskGen, node: Node) -> None:
14551460
ctx = self.bld
14561461

@@ -1487,8 +1492,8 @@ def keyword(cls: Type['ClangCheck']) -> str:
14871492
return 'Checking'
14881493

14891494

1490-
@TaskGen.feature('c')
1491-
@TaskGen.after_method('propagate_uselib_vars')
1495+
@task_gen_feature('c')
1496+
@task_gen_after_method('propagate_uselib_vars')
14921497
def update_clang_check_envs(self: TaskGen) -> None:
14931498
if self.clang_check_tasks:
14941499
# Compute clang extra cflags from gcc flags
@@ -1498,7 +1503,7 @@ def update_clang_check_envs(self: TaskGen) -> None:
14981503
task.env.CLANG_EXTRA_CFLAGS = extra_flags
14991504

15001505

1501-
@TaskGen.extension('.c')
1506+
@task_gen_extension('.c')
15021507
def process_c_for_check(self: TaskGen, node: Node) -> None:
15031508
# Call standard C hook
15041509
c_task = c_tool.c_hook(self, node)
@@ -1555,8 +1560,8 @@ def __str__(self) -> str:
15551560
return node_path
15561561

15571562

1558-
@TaskGen.feature('cshlib')
1559-
@TaskGen.after_method('apply_link', 'deploy_shlib')
1563+
@task_gen_feature('cshlib')
1564+
@task_gen_after_method('apply_link', 'deploy_shlib')
15601565
def make_dso_pystub(self: TaskGen) -> None:
15611566
# Only consider shlib that specify pystub_path
15621567
pystub_path = getattr(self, 'pystub_path', None)

build/waftools/common.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,17 @@
4848
T = TypeVar('T')
4949
def task_gen_decorator(*args: str) -> Callable[[T], T]:
5050
...
51-
TaskGen.feature = task_gen_decorator
52-
TaskGen.after = task_gen_decorator
53-
TaskGen.before_method = task_gen_decorator
54-
TaskGen.after_method = task_gen_decorator
55-
TaskGen.extension = task_gen_decorator
56-
51+
task_gen_feature = task_gen_decorator
52+
task_gen_after = task_gen_decorator
53+
task_gen_before_method = task_gen_decorator
54+
task_gen_after_method = task_gen_decorator
55+
task_gen_extension = task_gen_decorator
56+
else:
57+
task_gen_feature = TaskGen.feature
58+
task_gen_after = TaskGen.after
59+
task_gen_before_method = TaskGen.before_method
60+
task_gen_after_method = TaskGen.after_method
61+
task_gen_extension = TaskGen.extension
5762

5863
# {{{ depends_on
5964

@@ -92,8 +97,8 @@ def check_circular_dependencies(self: TaskGen, tgen: TaskGen,
9297
path.pop()
9398

9499

95-
@TaskGen.feature('*')
96-
@TaskGen.before_method('process_rule')
100+
@task_gen_feature('*')
101+
@task_gen_before_method('process_rule')
97102
def post_depends_on(self: TaskGen) -> None:
98103
"""
99104
Post the depends_on dependencies of the "self" task generator.
@@ -135,8 +140,8 @@ def check_used(self: TaskGen, name: str) -> None:
135140
f'`{name}`')
136141

137142

138-
@TaskGen.feature('*')
139-
@TaskGen.before_method('process_rule')
143+
@task_gen_feature('*')
144+
@task_gen_before_method('process_rule')
140145
def check_libs(self: TaskGen) -> None:
141146
"""
142147
Check that each element listed in "use" exists either as a task generator
@@ -371,8 +376,8 @@ def add_scan_in_signature(ctx: BuildContext) -> None:
371376
# The environment variable ${PREFIX} is controlled by the configuration
372377
# argument `--prefix` (default is '/usr/local/')
373378

374-
@TaskGen.feature('*')
375-
@TaskGen.after('process_subst', 'process_rule', 'process_source')
379+
@task_gen_feature('*')
380+
@task_gen_after('process_subst', 'process_rule', 'process_source')
376381
def remove_default_install_tasks(self: TaskGen) -> None:
377382
"""Remove all default install tasks"""
378383
for i, t in enumerate(self.tasks):
@@ -424,8 +429,8 @@ def run(self) -> int:
424429
return 0
425430

426431

427-
@TaskGen.feature('*')
428-
@TaskGen.after('process_rule', 'process_source')
432+
@task_gen_feature('*')
433+
@task_gen_after('process_rule', 'process_source')
429434
def add_custom_install(self: TaskGen) -> None:
430435
commands = getattr(self, 'custom_install', None)
431436
if not commands:

build/waftools/cython_intersec.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@
4444
# Add type hinting for TaskGen decorators
4545
if TYPE_CHECKING:
4646
T = TypeVar('T')
47-
def task_gen_decorator(*args: str) -> Callable[[T], T]:
47+
def task_gen_extension(*args: str) -> Callable[[T], T]:
4848
...
49-
TaskGen.extension = task_gen_decorator
49+
else:
50+
task_gen_extension = TaskGen.extension
5051

5152

5253
ScanRes = Tuple[Optional[List[str]], Optional[List[str]]]
@@ -55,7 +56,7 @@ def task_gen_decorator(*args: str) -> Callable[[T], T]:
5556
# {{{ .pyx extension handler
5657

5758

58-
@TaskGen.extension('.pyx')
59+
@task_gen_extension('.pyx')
5960
def add_cython_file(self: BuildContext, node: Node) -> None:
6061
"""
6162
Process a *.pyx* file given in the list of source files. No additional

build/waftools/rust.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,15 @@
5050

5151
def task_gen_decorator(*args: str) -> Callable[[T], T]: ...
5252

53-
TaskGen.feature = task_gen_decorator
54-
TaskGen.before_method = task_gen_decorator
55-
TaskGen.after_method = task_gen_decorator
56-
TaskGen.extension = task_gen_decorator
53+
task_gen_feature = task_gen_decorator
54+
task_gen_before_method = task_gen_decorator
55+
task_gen_after_method = task_gen_decorator
56+
task_gen_extension = task_gen_decorator
57+
else:
58+
task_gen_feature = TaskGen.feature
59+
task_gen_before_method = TaskGen.before_method
60+
task_gen_after_method = TaskGen.after_method
61+
task_gen_extension = TaskGen.extension
5762

5863

5964
# Copy USELIB_VARS for `cprogram` and `cshlib` to be used by `rust` task gens
@@ -358,8 +363,8 @@ class CargoBuildStlinkTask(CargoBuildBase, waflib_stlink_task): # type: ignore[
358363
"""Class for building a static library"""
359364

360365

361-
@TaskGen.feature('rust')
362-
@TaskGen.before_method('process_use')
366+
@task_gen_feature('rust')
367+
@task_gen_before_method('process_use')
363368
def rust_create_task(self: TaskGen) -> None:
364369
ctx = self.bld
365370

@@ -490,8 +495,8 @@ def rust_create_task(self: TaskGen) -> None:
490495
tsk.env.USE_PIC = use_pic
491496

492497

493-
@TaskGen.feature('rust')
494-
@TaskGen.after_method('process_use')
498+
@task_gen_feature('rust')
499+
@task_gen_after_method('process_use')
495500
def rust_add_dep_task(self: TaskGen) -> None:
496501
"""
497502
Add task dependencies between rust task gen even if the waf rust task gen

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dev = [
3838
"ruff==0.14.14",
3939

4040
# static typing for Python
41-
"mypy==1.14.1",
41+
"mypy==1.19.1",
4242

4343
# Linter that uses the AST of languages. Its configuration
4444
# resides in `ast-grep/` and sgconfig.yml.

0 commit comments

Comments
 (0)