Skip to content

Commit e477c67

Browse files
authored
Check *_pb2.pyi files again (#10909)
1 parent f9f30cc commit e477c67

File tree

8 files changed

+20
-24
lines changed

8 files changed

+20
-24
lines changed

.flake8

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ per-file-ignores =
3737
# F811 redefinition of unused '...'
3838
stdlib/typing.pyi: B, E701, E741, F401, F403, F405, F811
3939
# Generated protobuf files include docstrings
40-
# *_pb2.pyi: B, E701, E741, F401, F403, F405, Y021, Y026, Y053, Y054
40+
*_pb2.pyi: B, E701, E741, F401, F403, F405, Y021, Y026, Y053, Y054
4141

42-
# TODO: Re-enable Flake8 on generated protobuf files
43-
# after https://github.com/nipunn1313/mypy-protobuf/issues/523 is resolved
44-
exclude = .venv*,.git,*_pb2.pyi
42+
exclude = .venv*,.git
4543
noqa_require_code = true

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ line-length = 130
6464
target-version = "py37"
6565
fix = true
6666
exclude = [
67-
# Ignore generated protobuf stubs
68-
"*_pb2.pyi",
6967
# virtual environment
7068
".env",
7169
".venv",

stubs/s2clientprotocol/s2clientprotocol/data_pb2.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class AbilityData(google.protobuf.message.Message):
6666
ValueType = typing.NewType("ValueType", builtins.int)
6767
V: typing_extensions.TypeAlias = ValueType
6868

69-
class _TargetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[AbilityData._Target.ValueType], builtins.type): # noqa: F821
69+
class _TargetEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[AbilityData._Target.ValueType], builtins.type):
7070
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
7171
Point: AbilityData._Target.ValueType # 2
7272
"""Requires a target position."""
@@ -183,7 +183,7 @@ class Weapon(google.protobuf.message.Message):
183183
ValueType = typing.NewType("ValueType", builtins.int)
184184
V: typing_extensions.TypeAlias = ValueType
185185

186-
class _TargetTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Weapon._TargetType.ValueType], builtins.type): # noqa: F821
186+
class _TargetTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Weapon._TargetType.ValueType], builtins.type):
187187
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
188188
Ground: Weapon._TargetType.ValueType # 1
189189
Air: Weapon._TargetType.ValueType # 2

stubs/s2clientprotocol/s2clientprotocol/debug_pb2.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ class DebugTestProcess(google.protobuf.message.Message):
337337
ValueType = typing.NewType("ValueType", builtins.int)
338338
V: typing_extensions.TypeAlias = ValueType
339339

340-
class _TestEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugTestProcess._Test.ValueType], builtins.type): # noqa: F821
340+
class _TestEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugTestProcess._Test.ValueType], builtins.type):
341341
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
342342
hang: DebugTestProcess._Test.ValueType # 1
343343
crash: DebugTestProcess._Test.ValueType # 2
@@ -387,7 +387,7 @@ class DebugEndGame(google.protobuf.message.Message):
387387
ValueType = typing.NewType("ValueType", builtins.int)
388388
V: typing_extensions.TypeAlias = ValueType
389389

390-
class _EndResultEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugEndGame._EndResult.ValueType], builtins.type): # noqa: F821
390+
class _EndResultEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugEndGame._EndResult.ValueType], builtins.type):
391391
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
392392
Surrender: DebugEndGame._EndResult.ValueType # 1
393393
"""Default if nothing is set. The current player admits defeat."""
@@ -418,7 +418,7 @@ class DebugSetUnitValue(google.protobuf.message.Message):
418418
ValueType = typing.NewType("ValueType", builtins.int)
419419
V: typing_extensions.TypeAlias = ValueType
420420

421-
class _UnitValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugSetUnitValue._UnitValue.ValueType], builtins.type): # noqa: F821
421+
class _UnitValueEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[DebugSetUnitValue._UnitValue.ValueType], builtins.type):
422422
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
423423
Energy: DebugSetUnitValue._UnitValue.ValueType # 1
424424
Life: DebugSetUnitValue._UnitValue.ValueType # 2

stubs/s2clientprotocol/s2clientprotocol/sc2api_pb2.pyi

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ class ResponseCreateGame(google.protobuf.message.Message):
542542
ValueType = typing.NewType("ValueType", builtins.int)
543543
V: typing_extensions.TypeAlias = ValueType
544544

545-
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseCreateGame._Error.ValueType], builtins.type): # noqa: F821
545+
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseCreateGame._Error.ValueType], builtins.type):
546546
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
547547
MissingMap: ResponseCreateGame._Error.ValueType # 1
548548
InvalidMapPath: ResponseCreateGame._Error.ValueType # 2
@@ -664,7 +664,7 @@ class ResponseJoinGame(google.protobuf.message.Message):
664664
ValueType = typing.NewType("ValueType", builtins.int)
665665
V: typing_extensions.TypeAlias = ValueType
666666

667-
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseJoinGame._Error.ValueType], builtins.type): # noqa: F821
667+
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseJoinGame._Error.ValueType], builtins.type):
668668
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
669669
MissingParticipation: ResponseJoinGame._Error.ValueType # 1
670670
InvalidObservedPlayerId: ResponseJoinGame._Error.ValueType # 2
@@ -741,7 +741,7 @@ class ResponseRestartGame(google.protobuf.message.Message):
741741
ValueType = typing.NewType("ValueType", builtins.int)
742742
V: typing_extensions.TypeAlias = ValueType
743743

744-
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseRestartGame._Error.ValueType], builtins.type): # noqa: F821
744+
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseRestartGame._Error.ValueType], builtins.type):
745745
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
746746
LaunchError: ResponseRestartGame._Error.ValueType # 1
747747

@@ -818,7 +818,7 @@ class ResponseStartReplay(google.protobuf.message.Message):
818818
ValueType = typing.NewType("ValueType", builtins.int)
819819
V: typing_extensions.TypeAlias = ValueType
820820

821-
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseStartReplay._Error.ValueType], builtins.type): # noqa: F821
821+
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseStartReplay._Error.ValueType], builtins.type):
822822
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
823823
MissingReplay: ResponseStartReplay._Error.ValueType # 1
824824
InvalidReplayPath: ResponseStartReplay._Error.ValueType # 2
@@ -878,7 +878,7 @@ class ResponseMapCommand(google.protobuf.message.Message):
878878
ValueType = typing.NewType("ValueType", builtins.int)
879879
V: typing_extensions.TypeAlias = ValueType
880880

881-
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseMapCommand._Error.ValueType], builtins.type): # noqa: F821
881+
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseMapCommand._Error.ValueType], builtins.type):
882882
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
883883
NoTriggerError: ResponseMapCommand._Error.ValueType # 1
884884

@@ -1371,7 +1371,7 @@ class ResponseReplayInfo(google.protobuf.message.Message):
13711371
ValueType = typing.NewType("ValueType", builtins.int)
13721372
V: typing_extensions.TypeAlias = ValueType
13731373

1374-
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseReplayInfo._Error.ValueType], builtins.type): # noqa: F821
1374+
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseReplayInfo._Error.ValueType], builtins.type):
13751375
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
13761376
MissingReplay: ResponseReplayInfo._Error.ValueType # 1
13771377
InvalidReplayPath: ResponseReplayInfo._Error.ValueType # 2
@@ -1501,7 +1501,7 @@ class ResponseSaveMap(google.protobuf.message.Message):
15011501
ValueType = typing.NewType("ValueType", builtins.int)
15021502
V: typing_extensions.TypeAlias = ValueType
15031503

1504-
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseSaveMap._Error.ValueType], builtins.type): # noqa: F821
1504+
class _ErrorEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ResponseSaveMap._Error.ValueType], builtins.type):
15051505
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
15061506
InvalidMapData: ResponseSaveMap._Error.ValueType # 1
15071507

@@ -1897,7 +1897,7 @@ class ActionChat(google.protobuf.message.Message):
18971897
ValueType = typing.NewType("ValueType", builtins.int)
18981898
V: typing_extensions.TypeAlias = ValueType
18991899

1900-
class _ChannelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionChat._Channel.ValueType], builtins.type): # noqa: F821
1900+
class _ChannelEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionChat._Channel.ValueType], builtins.type):
19011901
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
19021902
Broadcast: ActionChat._Channel.ValueType # 1
19031903
Team: ActionChat._Channel.ValueType # 2

stubs/s2clientprotocol/s2clientprotocol/score_pb2.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Score(google.protobuf.message.Message):
2424
ValueType = typing.NewType("ValueType", builtins.int)
2525
V: typing_extensions.TypeAlias = ValueType
2626

27-
class _ScoreTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Score._ScoreType.ValueType], builtins.type): # noqa: F821
27+
class _ScoreTypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[Score._ScoreType.ValueType], builtins.type):
2828
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
2929
Curriculum: Score._ScoreType.ValueType # 1
3030
"""map generated score (from curriculum maps with special scoring)"""

stubs/s2clientprotocol/s2clientprotocol/spatial_pb2.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ class ActionSpatialUnitSelectionPoint(google.protobuf.message.Message):
376376
ValueType = typing.NewType("ValueType", builtins.int)
377377
V: typing_extensions.TypeAlias = ValueType
378378

379-
class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionSpatialUnitSelectionPoint._Type.ValueType], builtins.type): # noqa: F821
379+
class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionSpatialUnitSelectionPoint._Type.ValueType], builtins.type):
380380
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
381381
Select: ActionSpatialUnitSelectionPoint._Type.ValueType # 1
382382
"""Equivalent to normal click. Changes selection to unit."""

stubs/s2clientprotocol/s2clientprotocol/ui_pb2.pyi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class ActionControlGroup(google.protobuf.message.Message):
307307
ValueType = typing.NewType("ValueType", builtins.int)
308308
V: typing_extensions.TypeAlias = ValueType
309309

310-
class _ControlGroupActionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionControlGroup._ControlGroupAction.ValueType], builtins.type): # noqa: F821
310+
class _ControlGroupActionEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionControlGroup._ControlGroupAction.ValueType], builtins.type):
311311
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
312312
Recall: ActionControlGroup._ControlGroupAction.ValueType # 1
313313
"""Equivalent to number hotkey. Replaces current selection with control group."""
@@ -397,7 +397,7 @@ class ActionSelectIdleWorker(google.protobuf.message.Message):
397397
ValueType = typing.NewType("ValueType", builtins.int)
398398
V: typing_extensions.TypeAlias = ValueType
399399

400-
class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionSelectIdleWorker._Type.ValueType], builtins.type): # noqa: F821
400+
class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionSelectIdleWorker._Type.ValueType], builtins.type):
401401
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
402402
Set: ActionSelectIdleWorker._Type.ValueType # 1
403403
"""Equivalent to click with no modifiers. Replaces selection with single idle worker."""
@@ -438,7 +438,7 @@ class ActionMultiPanel(google.protobuf.message.Message):
438438
ValueType = typing.NewType("ValueType", builtins.int)
439439
V: typing_extensions.TypeAlias = ValueType
440440

441-
class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionMultiPanel._Type.ValueType], builtins.type): # noqa: F821
441+
class _TypeEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[ActionMultiPanel._Type.ValueType], builtins.type):
442442
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
443443
SingleSelect: ActionMultiPanel._Type.ValueType # 1
444444
"""Click on icon"""

0 commit comments

Comments
 (0)