-
-
Notifications
You must be signed in to change notification settings - Fork 741
Enable truthy-bool checks in mypy and fix related warnings #3528
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -511,18 +511,17 @@ def _create_user_account(self, preset: list[User] | None = None) -> list[User]: | |||||||
| users = ask_for_additional_users(defined_users=preset) | ||||||||
| return users | ||||||||
|
|
||||||||
| def _mirror_configuration(self, preset: MirrorConfiguration | None = None) -> MirrorConfiguration | None: | ||||||||
| def _mirror_configuration(self, preset: MirrorConfiguration | None = None) -> MirrorConfiguration: | ||||||||
| mirror_configuration = MirrorMenu(preset=preset).run() | ||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
archinstall/archinstall/lib/mirrors.py Lines 299 to 301 in 3df568d
|
||||||||
|
|
||||||||
| if mirror_configuration: | ||||||||
| if mirror_configuration.optional_repositories: | ||||||||
| # reset the package list cache in case the repository selection has changed | ||||||||
| list_available_packages.cache_clear() | ||||||||
| if mirror_configuration.optional_repositories: | ||||||||
| # reset the package list cache in case the repository selection has changed | ||||||||
| list_available_packages.cache_clear() | ||||||||
|
|
||||||||
| # enable the repositories in the config | ||||||||
| pacman_config = PacmanConfig(None) | ||||||||
| pacman_config.enable(mirror_configuration.optional_repositories) | ||||||||
| pacman_config.apply() | ||||||||
| # enable the repositories in the config | ||||||||
| pacman_config = PacmanConfig(None) | ||||||||
| pacman_config.enable(mirror_configuration.optional_repositories) | ||||||||
| pacman_config.apply() | ||||||||
|
|
||||||||
| return mirror_configuration | ||||||||
|
|
||||||||
|
|
||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1012,7 +1012,7 @@ def _get_kernel_params_partition( | |
| # TODO: We need to detect if the encrypted device is a whole disk encryption, | ||
| # or simply a partition encryption. Right now we assume it's a partition (and we always have) | ||
|
|
||
| if self._disk_encryption and self._disk_encryption.hsm_device: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Line 1011 already assumes |
||
| if self._disk_encryption.hsm_device: | ||
| debug(f'Root partition is an encrypted device, identifying by UUID: {root_partition.uuid}') | ||
| # Note: UUID must be used, not PARTUUID for sd-encrypt to work | ||
| kernel_parameters.append(f'rd.luks.name={root_partition.uuid}=root') | ||
|
|
@@ -1672,8 +1672,7 @@ def _create_user(self, user: User) -> None: | |
| if result := plugin.on_user_created(self, user): | ||
| handled_by_plugin = result | ||
|
|
||
| if user.password: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| self.set_user_password(user) | ||
| self.set_user_password(user) | ||
|
|
||
| for group in user.groups: | ||
| SysCommand(f'arch-chroot {self.target} gpasswd -a {user.username} {group}') | ||
|
|
@@ -1684,7 +1683,7 @@ def _create_user(self, user: User) -> None: | |
| def set_user_password(self, user: User) -> bool: | ||
| info(f'Setting password for {user.username}') | ||
|
|
||
| enc_password = user.password.enc_password if user.password else None | ||
| enc_password = user.password.enc_password | ||
|
|
||
| if not enc_password: | ||
| debug('User password is empty') | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,8 +45,7 @@ def perform_installation(mountpoint: Path) -> None: | |
| ) as installation: | ||
| # Mount all the drives to the desired mountpoint | ||
| # This *can* be done outside of the installation, but the installer can deal with it. | ||
| if disk_config: | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is an earlier check on line 34 |
||
| installation.mount_ordered_layout() | ||
| installation.mount_ordered_layout() | ||
|
|
||
| # to generate a fstab directory holder. Avoids an error on exit and at the same time checks the procedure | ||
| target = Path(f'{mountpoint}/etc/fstab') | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,7 +13,6 @@ | |||||||
|
|
||||||||
| from archinstall.lib.translationhandler import tr | ||||||||
|
|
||||||||
| from ..lib.output import debug | ||||||||
| from .help import Help | ||||||||
| from .menu_item import MenuItem, MenuItemGroup, MenuItemsState | ||||||||
| from .result import Result, ResultType | ||||||||
|
|
@@ -87,10 +86,6 @@ def help_entry(self) -> ViewportEntry: | |||||||
| return ViewportEntry(tr('Press Ctrl+h for help'), 0, 0, STYLE.NORMAL) | ||||||||
|
|
||||||||
| def _show_help(self) -> None: | ||||||||
| if not self._help_window: | ||||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
archinstall/archinstall/tui/curses_menu.py Lines 34 to 36 in 3df568d
|
||||||||
| debug('no help window set') | ||||||||
| return | ||||||||
|
|
||||||||
| help_text = Help.get_help_text() | ||||||||
| lines = help_text.split('\n') | ||||||||
|
|
||||||||
|
|
||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_prompt_partition_fs_typedoes not allow skipping or resetting:archinstall/archinstall/lib/disk/partitioning_menu.py
Lines 415 to 432 in 3df568d