Skip to content

Split out unicode_ljust and unicode_rjust to break import cycle - #3388

Merged
svartkanin merged 2 commits into
archlinux:masterfrom
correctmost:cm/break-unicode-cycle
Apr 13, 2025
Merged

svartkanin merged 2 commits into
archlinux:masterfrom
correctmost:cm/break-unicode-cycle

Conversation

@correctmost

Copy link
Copy Markdown
Contributor

PR Description:

Previously, there was an import cycle between tui.menu_item and lib.output:

archinstall/lib/output.py: error: Cycle detected in import chain
  archinstall/lib/output.py
  archinstall/tui/curses_menu.py
  archinstall/tui/menu_item.py (reportImportCycles)

@correctmost
correctmost requested a review from Torxed as a code owner April 12, 2025 09:01
@@ -0,0 +1,40 @@
import unicodedata

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@correctmost would it make sense to put this into the utils.py rather to avoid too many modules with utility functions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the code to lib/utils/util.py will introduce a different cycle:

  archinstall/lib/utils/util.py: error: Cycle detected in import chain
    archinstall/lib/utils/util.py
    archinstall/tui/curses_menu.py
    archinstall/tui/result.py
    archinstall/tui/menu_item.py (reportImportCycles)

Should I move lib/unicode.py to lib/utils/unicode.py to avoid some clutter at the top level?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah lets move it in there that will do

Previously, there was an import cycle between tui.menu_item and
lib.output.
@correctmost
correctmost force-pushed the cm/break-unicode-cycle branch from 435f074 to 2c9126f Compare April 13, 2025 05:37
@svartkanin
svartkanin merged commit 130d1a6 into archlinux:master Apr 13, 2025
@correctmost
correctmost deleted the cm/break-unicode-cycle branch April 13, 2025 05:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants