Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

s2clientprotocol stubs #10372

Merged
merged 9 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stubs/s2clientprotocol/@tests/stubtest_allowlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# All modules ending with *_pb2 fail to import
# The error message is "TypeError: Descriptors cannot be create directly"
s2clientprotocol\..+_pb2
2 changes: 2 additions & 0 deletions stubs/s2clientprotocol/METADATA.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version = "5.*"
requires = ["types-protobuf"]
5 changes: 5 additions & 0 deletions stubs/s2clientprotocol/s2clientprotocol/build.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from subprocess import _CMD

def game_version() -> str: ...
def git_commit_hash() -> str: ...
def read_command_output(cmd: _CMD) -> list[str]: ...
199 changes: 199 additions & 0 deletions stubs/s2clientprotocol/s2clientprotocol/common_pb2.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
"""
@generated by mypy-protobuf. Do not edit manually!
isort:skip_file
"""
import builtins
import google.protobuf.descriptor
import google.protobuf.internal.enum_type_wrapper
import google.protobuf.message
import sys
import typing

if sys.version_info >= (3, 10):
import typing as typing_extensions
else:
import typing_extensions

DESCRIPTOR: google.protobuf.descriptor.FileDescriptor

class _Race:
ValueType = typing.NewType("ValueType", builtins.int)
V: typing_extensions.TypeAlias = ValueType

class _RaceEnumTypeWrapper(google.protobuf.internal.enum_type_wrapper._EnumTypeWrapper[_Race.ValueType], builtins.type):
DESCRIPTOR: google.protobuf.descriptor.EnumDescriptor
NoRace: _Race.ValueType # 0
Terran: _Race.ValueType # 1
Zerg: _Race.ValueType # 2
Protoss: _Race.ValueType # 3
Random: _Race.ValueType # 4

class Race(_Race, metaclass=_RaceEnumTypeWrapper): ...

NoRace: Race.ValueType # 0
Terran: Race.ValueType # 1
Zerg: Race.ValueType # 2
Protoss: Race.ValueType # 3
Random: Race.ValueType # 4
global___Race = Race

@typing_extensions.final
class AvailableAbility(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

ABILITY_ID_FIELD_NUMBER: builtins.int
REQUIRES_POINT_FIELD_NUMBER: builtins.int
ability_id: builtins.int
requires_point: builtins.bool
def __init__(
self,
*,
ability_id: builtins.int | None = ...,
requires_point: builtins.bool | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["ability_id", b"ability_id", "requires_point", b"requires_point"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["ability_id", b"ability_id", "requires_point", b"requires_point"]) -> None: ...

global___AvailableAbility = AvailableAbility

@typing_extensions.final
class ImageData(google.protobuf.message.Message):
DESCRIPTOR: google.protobuf.descriptor.Descriptor

BITS_PER_PIXEL_FIELD_NUMBER: builtins.int
SIZE_FIELD_NUMBER: builtins.int
DATA_FIELD_NUMBER: builtins.int
bits_per_pixel: builtins.int
"""Number of bits per pixel; 8 bits for a byte etc."""
@property
def size(self) -> global___Size2DI:
"""Dimension in pixels."""
data: builtins.bytes
"""Binary data; the size of this buffer in bytes is width * height * bits_per_pixel / 8."""
def __init__(
self,
*,
bits_per_pixel: builtins.int | None = ...,
size: global___Size2DI | None = ...,
data: builtins.bytes | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["bits_per_pixel", b"bits_per_pixel", "data", b"data", "size", b"size"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["bits_per_pixel", b"bits_per_pixel", "data", b"data", "size", b"size"]) -> None: ...

global___ImageData = ImageData

@typing_extensions.final
class PointI(google.protobuf.message.Message):
"""Point on the screen/minimap (e.g., 0..64).
Note: bottom left of the screen is 0, 0.
"""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

X_FIELD_NUMBER: builtins.int
Y_FIELD_NUMBER: builtins.int
x: builtins.int
y: builtins.int
def __init__(
self,
*,
x: builtins.int | None = ...,
y: builtins.int | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["x", b"x", "y", b"y"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["x", b"x", "y", b"y"]) -> None: ...

global___PointI = PointI

@typing_extensions.final
class RectangleI(google.protobuf.message.Message):
"""Screen space rectangular area."""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

P0_FIELD_NUMBER: builtins.int
P1_FIELD_NUMBER: builtins.int
@property
def p0(self) -> global___PointI: ...
@property
def p1(self) -> global___PointI: ...
def __init__(
self,
*,
p0: global___PointI | None = ...,
p1: global___PointI | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["p0", b"p0", "p1", b"p1"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["p0", b"p0", "p1", b"p1"]) -> None: ...

global___RectangleI = RectangleI

@typing_extensions.final
class Point2D(google.protobuf.message.Message):
"""Point on the game board, 0..255.
Note: bottom left of the screen is 0, 0.
"""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

X_FIELD_NUMBER: builtins.int
Y_FIELD_NUMBER: builtins.int
x: builtins.float
y: builtins.float
def __init__(
self,
*,
x: builtins.float | None = ...,
y: builtins.float | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["x", b"x", "y", b"y"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["x", b"x", "y", b"y"]) -> None: ...

global___Point2D = Point2D

@typing_extensions.final
class Point(google.protobuf.message.Message):
"""Point on the game board, 0..255.
Note: bottom left of the screen is 0, 0.
"""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

X_FIELD_NUMBER: builtins.int
Y_FIELD_NUMBER: builtins.int
Z_FIELD_NUMBER: builtins.int
x: builtins.float
y: builtins.float
z: builtins.float
def __init__(
self,
*,
x: builtins.float | None = ...,
y: builtins.float | None = ...,
z: builtins.float | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["x", b"x", "y", b"y", "z", b"z"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["x", b"x", "y", b"y", "z", b"z"]) -> None: ...

global___Point = Point

@typing_extensions.final
class Size2DI(google.protobuf.message.Message):
"""Screen dimensions."""

DESCRIPTOR: google.protobuf.descriptor.Descriptor

X_FIELD_NUMBER: builtins.int
Y_FIELD_NUMBER: builtins.int
x: builtins.int
y: builtins.int
def __init__(
self,
*,
x: builtins.int | None = ...,
y: builtins.int | None = ...,
) -> None: ...
def HasField(self, field_name: typing_extensions.Literal["x", b"x", "y", b"y"]) -> builtins.bool: ...
def ClearField(self, field_name: typing_extensions.Literal["x", b"x", "y", b"y"]) -> None: ...

global___Size2DI = Size2DI
Loading