Skip to content

Commit e55ecb0

Browse files
committed
improve type checking for Package.files
1 parent e8bbbe6 commit e55ecb0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/poetry/core/packages/package.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from typing import TYPE_CHECKING
66
from typing import ClassVar
7+
from typing import TypedDict
78
from typing import TypeVar
89

910
from packaging.utils import canonicalize_name
@@ -36,6 +37,11 @@
3637
T = TypeVar("T", bound="Package")
3738

3839

40+
class PackageFile(TypedDict):
41+
file: str
42+
hash: str
43+
44+
3945
class Package(PackageSpecification):
4046
AVAILABLE_PYTHONS: ClassVar[set[str]] = {
4147
"2",
@@ -112,7 +118,7 @@ def __init__(
112118

113119
self._dependency_groups: Mapping[NormalizedName, DependencyGroup] = {}
114120

115-
self.files: Sequence[Mapping[str, str]] = []
121+
self.files: Sequence[PackageFile] = []
116122
self.optional = False
117123

118124
self.classifiers: Sequence[str] = []

0 commit comments

Comments
 (0)