Commit Graph

28 Commits

Author SHA1 Message Date
correctmost 3e5f879d52
Remove remaining bare _ translation references (#3485)
This helps simplify the linter configs and improves compatibility
with type checkers.
2025-05-20 18:44:25 +10:00
Daniel Girtler c67ac97f18
Ruff formatting (#3459)
* Update

* Update
2025-05-15 14:26:41 +02:00
correctmost f100e5110d
Use __all__ in __init__.py files to fix unused-import warnings (#3252)
This commit allows ruff and flake8 ignores to be removed. It also
allows mypy to be run in strict mode by default.
2025-03-13 14:19:05 +11:00
correctmost e7ca4f56d5
Remove unneeded flake8 ignore for __init__.py files (#3250) 2025-03-13 08:28:44 +11:00
correctmost 60842bd1cf
Enable bare-except linter rules and fix warnings (#2988) 2024-12-01 18:34:51 +11:00
correctmost 7776f82cbc
Reduce the max line length from 220 to 160 by wrapping some lines (#2867)
This will make it easier to auto-format import sections.
2024-11-19 07:50:53 +11:00
correctmost 2408b597be
Enable the E128 flake8 rule for all code except for __init__.py (#2827)
This commit also fixes a few files that had non-uniform indentation.
2024-11-16 19:34:29 +11:00
correctmost 6102a08c6d
Enable the W504 binary operator rule in flake8 (#2825) 2024-11-16 18:57:08 +11:00
correctmost c682ddf391
Enable the E123 closing bracket rule in flake8 (#2812) 2024-11-16 18:23:52 +11:00
correctmost 35c8eb3394
Fix unnecessary f-strings and enable flake8 rule (#2653) 2024-08-29 03:01:55 +10:00
correctmost 62b4099c8d
Fix whitespace issues detected by flake8 (#2652)
This commit also removes exclusions that are no longer needed.
2024-08-29 01:40:53 +10:00
Anton Hvornum 98518e444a
Use `/mirrors/status/json/` instead of `/mirrorlist/` to get mirror lists (#2599)
* Using JSON endpoint instead of ASCII endpoint for mirror listing, as the JSON endpoint is cached and easier to parse

* Added a TODO to handle unknown regional mirrors (which lacks info in the backend)

* Filtered out 'bad' mirrors. Also added a sorting mechanism that uses the mirrors 'score' rather than just the URL name. This will emulate the reflector.service/rankmirrors behavior and thus reducing the need to re-rank the mirrors.

* Added the ability to sort mirrors via latency or download speed using sorted(mirror_list, key=lambda mirror: (mirror.score, mirror.speed)) - but I have not implemented the sorting via the menu yet, and I have not integrated the new MirrorStatus model into the handling of URL's. I still need to figure out where the {region: [url, url]} is being used, so that i can convert to {region: [mirror.url, mirror.url]} logic.

* Converting MirrorStatus model to {mirror: [url, url]}

* Added debug information for /var/log/archinstall/install.log

* Fixing flake8

* Fixed issue where 'dead' mirrors have no score, and thus can't be round():ed

* Forgot to return model validation data after validation

* Improving debug/info output

* Reverting change in #2350 - Writing over instead of appending to mirrorlist

* Mirror URL's reported by the JSON endpoint does not contain the repo format, only the base location for the mirror. So we have to adjust for this.

* pydantic did not honor 'private' variables in 'before' model validator, had to change to 'after' instead.

* Sorted out mypy typing matching the new MirrorStatus model

* Added pydantic as a dependency, it's time!

* Updated workflow to include pydantic

* Added return values from model @property decorators.
2024-08-02 15:24:44 +02:00
Daniel Girtler 5c180f0741
New menu implementation with curses (#2506)
* TUI

* Fix menu iterating

* Add help menu

* Add column menu

* Fix filter

* Tweaked import statement

---------

Co-authored-by: Anton Hvornum <torxed@archlinux.org>
2024-06-06 22:31:15 +02:00
Anton Hvornum 493cccc18f
Added a HSM menu entry (#1196)
* Added a HSM menu entry, but also a safety check to make sure a FIDO device is connected

* flake8 complaints

* Adding FIDO lookup using cryptenroll listing

* Added systemd-cryptenroll --fido2-device=list

* Removed old _select_hsm call

* Fixed flake8 complaints

* Added support for locking and unlocking with a HSM

* Removed hardcoded paths in favor of PR merge

* Removed hardcoded paths in favor of PR merge

* Fixed mypy complaint

* Flake8 issue

* Added sd-encrypt for HSM and revert back to encrypt when HSM is not used (stability reason)

* Added /etc/vconsole.conf and tweaked fido2_enroll() to use the proper paths

* Spelling error

* Using UUID instead of PARTUUID when using HSM. I can't figure out how to get sd-encrypt to use PARTUUID instead. Added a Partition().part_uuid function. Actually renamed .uuid to .part_uuid and created a .uuid instead.

* Adding missing package libfido2 and removed tpm2-device=auto as it overrides everything and forces password prompt to be used over FIDO2, no matter the order of the options.

* Added some notes to clarify some choices.

* Had to move libfido2 package install to later in the chain, as there's not even a base during mounting :P
2022-05-18 11:28:59 +02:00
Anton Hvornum 12b5e2e4e9
Adding compression as an option (#1084)
* Adding compression as an option

* Ignore 'misaligned' ending parenthathese

* Moved the 'mark compressed' logic into the sub block within manual disk operations.

* Fixed flake8 complaints

* Muting a complextion warning on manage_new_and_existing_partitions(). It is too complex, but not something that we'll bother with for v2.4.0. As this whole function could be replaced with a new and improved menu system split into tasks rather than one huge if/else.
2022-04-26 13:17:40 +02:00
Anton Hvornum f61bce3fbc
Moved order in .flake8 2022-02-28 17:14:09 +01:00
Anton Hvornum 04e3880d8f
Added back _ as a builtin 2022-02-28 16:48:42 +01:00
Daniel 537b9cab03
Rework network config (#1001)
* Update network configuration

* Rework network configuration

* Update documentation

* Fix flake8

* Update

Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Co-authored-by: Anton Hvornum <anton.feeds@gmail.com>
2022-02-28 15:57:57 +01:00
komeil Parseh 7e19bf6e2e
Add password strength check (#983)
* Add password strength check

* Delete time.sleep and log, use the select class instead

* Ignore W503 in flake8

* Solve some problems of the password strength check algorithm

Part of the code was written by @phisch. This code tries to measure the strength of the user's password and suggests that the password is weak.

* rename function

* Restore the flake8 configuration file to its previous state
2022-02-28 15:33:09 +01:00
Daniel f6d133804b
Provide nationalization (#893)
* Nationalization

* Add _ as builtins to flake8

* Removing conflict hash tag

Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Co-authored-by: Anton Hvornum <anton@hvornum.se>
2022-02-05 00:27:29 +01:00
Anton Hvornum ffa29e2cd4
Ignoring complex-functions in guided.py (couldn't find a way to specifically ignore C901 for ask_user_questions() alone) 2021-12-31 16:08:27 +01:00
Daniel 908c7b8cc0
Add simple menu for better UX (#660)
* Add simple menu for better UX
* Add remove external dependency
* Fix harddisk return value on skip
* Table output for partitioning process
* Switch partitioning to simple menu
* fixup! Switch partitioning to simple menu
* Ignoring complexity and binary operator issues
Only in simple_menu.py
* Added license text to the MIT licensed file
* Added in versioning information
* Fixed some imports and removed the last generic_select() from user_interaction. Also fixed a revert/merged fork of ask_for_main_filesystem_format()
* Update color scheme to match Arch style better
* Use cyan as default cursor color
* Leave simple menu the same

Co-authored-by: Daniel Girtler <girtler.daniel@gmail.com>
Co-authored-by: Anton Hvornum <anton.feeds+github@gmail.com>
Co-authored-by: Dylan M. Taylor <dylan@dylanmtaylor.com>
2021-12-02 21:17:51 +01:00
Anton Hvornum 2fcd8198b2
Cleaned up all flake8 issues/warnings. Did some code cleaning as well, mostly how we called things in guided.py but also some SysCommand calls 2021-11-05 16:27:01 +01:00
Christian Clauss 566693c4f8
max-complexity = 40 2021-10-14 15:42:37 +02:00
Anton Hvornum 448917487a
Tweaked the ignores and made it less forgiving 2021-10-14 13:05:45 +00:00
Christian Clauss 52dbccea5e Tighten up flake8 tests used by lint_python GitHub Action 2021-10-04 11:08:21 +02:00
Dylan M. Taylor d8d700f949
Update .flake8 2021-05-15 09:52:47 -04:00
Dylan M. Taylor a79a582cfb
Create .flake8 2021-05-15 09:49:55 -04:00