Skip to content

Commit 2e5eb02

Browse files
committed
Improve mypy support
1 parent 0a7adbe commit 2e5eb02

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

angrmanagement/plugins/plugin_description.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import pathlib
22
from dataclasses import field
3-
from typing import Dict, List, Optional
3+
from typing import ClassVar, Dict, List, Optional, Type
44

55
import marshmallow.validate
66
import tomlkit
7+
from marshmallow import Schema
78
from marshmallow_dataclass import dataclass
89

910

1011
@dataclass
1112
class MetadataDescription:
13+
Schema: ClassVar[Type[Schema]] = Schema # placate mypy
14+
1215
version: int = field(metadata={"validate": marshmallow.validate.OneOf([0])})
1316

1417

@@ -18,6 +21,8 @@ class PackageDescription:
1821
Describes a plugin package.
1922
"""
2023

24+
Schema: ClassVar[Type[Schema]] = Schema # placate mypy
25+
2126
name: str = field()
2227
version: str = field()
2328
platforms: List[str] = field(default_factory=lambda: ["any"])
@@ -33,6 +38,8 @@ class PluginDescription:
3338
Describes an angr management plugin. Can be generated from plugin.toml.
3439
"""
3540

41+
Schema: ClassVar[Type[Schema]] = Schema # placate mypy
42+
3643
name: str = field()
3744
entrypoint: str = field()
3845
platforms: Optional[List[str]] = field(default=None)
@@ -46,6 +53,8 @@ class PluginConfigFileDescription:
4653
Describes a plugin config file.
4754
"""
4855

56+
Schema: ClassVar[Type[Schema]] = Schema # placate mypy
57+
4958
metadata: MetadataDescription = field()
5059
package: PackageDescription = field()
5160
plugins: Dict[str, PluginDescription] = field(default_factory=dict)

angrmanagement/py.typed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
PARTIAL

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ pyinstaller =
4949

5050
[options.package_data]
5151
angrmanagement =
52+
py.typed
5253
resources/fonts/*.ttf
5354
resources/images/*
5455
resources/themes/**/*

0 commit comments

Comments
 (0)