Skip to content

Commit c0e3d42

Browse files
Use python3.8 compatible type annotations (#207)
Needed for subordinate VM charm
1 parent a5a4bc9 commit c0e3d42

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/upgrade.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,15 @@ def is_compatible(self) -> bool:
6868
"""Whether upgrade is supported from previous versions"""
6969
assert self.versions_set
7070
try:
71-
previous_version_strs: dict[str, str] = json.loads(self._app_databag["versions"])
71+
previous_version_strs: typing.Dict[str, str] = json.loads(
72+
self._app_databag["versions"]
73+
)
7274
except KeyError as exception:
7375
logger.debug("`versions` missing from peer relation", exc_info=exception)
7476
return False
7577
# TODO charm versioning: remove `.split("+")` (which removes git hash before comparing)
7678
previous_version_strs["charm"] = previous_version_strs["charm"].split("+")[0]
77-
previous_versions: dict[str, poetry_version.Version] = {
79+
previous_versions: typing.Dict[str, poetry_version.Version] = {
7880
key: poetry_version.Version.parse(value)
7981
for key, value in previous_version_strs.items()
8082
}
@@ -177,7 +179,7 @@ def upgrade_resumed(self) -> bool:
177179

178180
@property
179181
@abc.abstractmethod
180-
def _unit_workload_versions(self) -> dict[str, str]:
182+
def _unit_workload_versions(self) -> typing.Dict[str, str]:
181183
"""{Unit name: unique identifier for unit's workload version}
182184
183185
If and only if this version changes, the workload will restart (during upgrade or

0 commit comments

Comments
 (0)