Skip to content

Commit 4711f7a

Browse files
authored
Fix Pydantic deprecation warnings (#3301)
This commit also enables mypy checks for deprecated calls.
1 parent d43482e commit 4711f7a

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

archinstall/lib/disk/device_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ def fetch_part_info(self, path: Path) -> LsblkInfo:
598598
debug(f'Unable to determine new uuid: {path}\n{lsblk_info}')
599599
raise DiskError(f'Unable to determine new uuid: {path}')
600600

601-
debug(f'partition information found: {lsblk_info.json()}')
601+
debug(f'partition information found: {lsblk_info.model_dump_json()}')
602602

603603
return lsblk_info
604604

archinstall/lib/models/packages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,12 @@ class AvailablePackage(BaseModel):
155155

156156
@cached_property
157157
def longest_key(self) -> int:
158-
return max(len(key) for key in self.dict().keys())
158+
return max(len(key) for key in self.model_dump().keys())
159159

160160
# return all package info line by line
161161
def info(self) -> str:
162162
output = ''
163-
for key, value in self.dict().items():
163+
for key, value in self.model_dump().items():
164164
key = key.replace('_', ' ').capitalize()
165165
key = key.ljust(self.longest_key)
166166
output += f'{key} : {value}\n'

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ disallow_any_explicit = false
7070
disallow_any_expr = false
7171
disallow_any_unimported = true
7272
enable_error_code = [
73+
"deprecated",
7374
"explicit-override",
7475
"ignore-without-code",
7576
"mutable-override",

0 commit comments

Comments
 (0)