Skip to content

[master] Circular importΒ #3362

Closed
Closed

Description

@Torxed
# archinstall --config-url https://hvornum.se/user_configuration.json --creds-url https://hvornum.se/user_credentials.json --silent
Traceback (most recent call last):
  File "/usr/bin/archinstall", line 5, in <module>
    from archinstall import run_as_a_module
  File "/usr/lib/python3.13/site-packages/archinstall/__init__.py", line 10, in <module>
    from archinstall.lib.args import arch_config_handler
  File "/usr/lib/python3.13/site-packages/archinstall/lib/args.py", line 421, in <module>
    arch_config_handler: ArchConfigHandler = ArchConfigHandler()
                                             ~~~~~~~~~~~~~~~~~^^
  File "/usr/lib/python3.13/site-packages/archinstall/lib/args.py", line 210, in __init__
    self._config = ArchConfig.from_config(config)
                   ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
  File "/usr/lib/python3.13/site-packages/archinstall/lib/args.py", line 137, in from_config
    arch_config.profile_config = ProfileConfiguration.parse_arg(profile_config)
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/site-packages/archinstall/lib/models/profile_model.py", line 36, in parse_arg
    from ..profile.profiles_handler import profile_handler
  File "/usr/lib/python3.13/site-packages/archinstall/lib/profile/__init__.py", line 1, in <module>
    from .profile_menu import ProfileMenu, select_greeter, select_profile
  File "/usr/lib/python3.13/site-packages/archinstall/lib/profile/profile_menu.py", line 11, in <module>
    from ..interactions.system_conf import select_driver
  File "/usr/lib/python3.13/site-packages/archinstall/lib/interactions/__init__.py", line 1, in <module>
    from .disk_conf import (
    ...<6 lines>...
    )
  File "/usr/lib/python3.13/site-packages/archinstall/lib/interactions/disk_conf.py", line 4, in <module>
    from archinstall.lib.args import arch_config_handler
ImportError: cannot import name 'arch_config_handler' from partially initialized module 'archinstall.lib.args' (most likely due to a circular import) (/usr/lib/python3.13/site-packages/archinstall/lib/args.py)

The line numbers doesn't add up with master for some reason. Despite me just building a clean ISO.

Activity

  1. svartkanin commented on Apr 9, 2025

    @svartkanin
    Collaborator

    Running that command in master resulted in a different circular dependency error for me which I was able to fix with #3377. Does that fix it for you too?

  2. Torxed commented on Apr 9, 2025

    @Torxed
    MemberAuthor

    I can give it a go tomorrow :)

  3. svartkanin commented on May 3, 2025

    @svartkanin
    Collaborator

    @Torxed is this still happening for you?

  4. Torxed commented on May 6, 2025

    @Torxed
    MemberAuthor

    This might be solved, but I am being blocked by:

    Traceback (most recent call last):
      File "/usr/bin/archinstall", line 4, in <module>
        from archinstall import run_as_a_module
      File "/usr/lib/python3.13/site-packages/archinstall/__init__.py", line 10, in <module>
        from archinstall.lib.args import arch_config_handler
      File "/usr/lib/python3.13/site-packages/archinstall/lib/args.py", line 500, in <module>
        arch_config_handler: ArchConfigHandler = ArchConfigHandler()
                                                 ~~~~~~~~~~~~~~~~~^^
      File "/usr/lib/python3.13/site-packages/archinstall/lib/args.py", line 227, in __init__
        config = self._parse_config()
      File "/usr/lib/python3.13/site-packages/archinstall/lib/args.py", line 417, in _parse_config
        json_data = self._process_creds_data(creds_data)
      File "/usr/lib/python3.13/site-packages/archinstall/lib/args.py", line 426, in _process_creds_data
        if creds_data.startswith('$'):  # encrypted data
           ~~~~~~~~~~~~~~~~~~~~~^^^^^
    TypeError: startswith first arg must be bytes or a tuple of bytes, not str
    

    When running --config-url with --silent.
    But just as I post this, I realize I'm running with a semi-old JSON config from about 2 weeks ago.. will generate a new one in the morning.

  5. svartkanin commented on May 6, 2025

    @svartkanin
    Collaborator

    Hmm this should be backwards compatible though so might be a bug

  6. Torxed commented on May 7, 2025

    @Torxed
    MemberAuthor

    If that's the case, I'm happy the test framework caught it correctly :D

    These were the test parameters:

    --silent \
    --creds-url https://hvornum.se/user_credentials.json \
    --config-url https://hvornum.se/user_configuration.json
    
  7. svartkanin commented on May 7, 2025

    @svartkanin
    Collaborator

    You mind throwing this in a separate issue, I'll have a look at it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions