Skip to content

Commit 7efe891

Browse files
committed
add mypy and coverage
1 parent 6700425 commit 7efe891

File tree

5 files changed

+235
-6
lines changed

5 files changed

+235
-6
lines changed

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ default:
77

88
# run tests
99
test:
10-
uv run pytest
10+
uv run pytest --cov=memobj
1111

1212
# does a version bump commit
1313
bump-commit type="minor": && create-tag

memobj/object.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ def __new__(
4242

4343

4444
class MemoryObject(metaclass=MemoryObjectMeta):
45-
__memory_object_instances__ = {}
45+
__memory_object_instances__: dict[str, type["MemoryObject"]] = {}
4646

47-
__memory_objects__ = {}
48-
__memory_properties__ = {}
47+
__memory_properties__: dict[str, MemoryProperty] = {}
4948

5049
def __init__(
5150
self,

memobj/process/windows/process.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ def allocate_memory(self, size: int, *, preferred_start: int | None = None) -> i
232232
)
233233

234234
else:
235-
preferred_start = 0 # type: ignore (null pointer)
235+
preferred_start = ctypes.c_void_p(0)
236236

237237
ctypes.windll.kernel32.VirtualAllocEx.restype = ctypes.c_size_t
238238

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ Issues = "https://github.com/StarrFox/memobj/issues"
2020

2121
[dependency-groups]
2222
tests = [
23+
"mypy>=1.18.2",
2324
"pytest>=8.4.2",
25+
"pytest-cov>=7.0.0",
26+
"types-regex>=2025.9.18.20250921",
2427
]
2528

2629

0 commit comments

Comments
 (0)