Skip to content
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

CLI interface broken due to circular import #1852

Closed
5 tasks done
jemrobinson opened this issue May 2, 2024 · 0 comments · Fixed by #1853
Closed
5 tasks done

CLI interface broken due to circular import #1852

jemrobinson opened this issue May 2, 2024 · 0 comments · Fixed by #1853
Labels
bug Problem when deploying a Data Safe Haven.

Comments

@jemrobinson
Copy link
Member

✅ Checklist

  • I have searched open and closed issues for duplicates.
  • This is a problem observed when deploying a Data Safe Haven.
  • I can reproduce this with the latest version.
  • I have read through the documentation.
  • This isn't an open-ended question (open a discussion if it is).

💻 System information

  • Operating System: macOS
  • Data Safe Haven version: develop @ 1cbb819

🚫 Describe the problem

dsh CLI operations do not work (see log message below). This is likely due to a circular import.

🌳 Log messages

Relevant log messages
╰─ dsh --help
Traceback (most recent call last):
  File "/Users/jrobinson/.pyenv/versions/dsh-jemrobinson-old/bin/dsh", line 7, in <module>
    from data_safe_haven.cli import main
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/cli.py", line 9, in <module>
    from data_safe_haven.commands import (
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/commands/__init__.py", line 1, in <module>
    from .admin import admin_command_group
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/commands/admin.py", line 8, in <module>
    from .admin_add_users import admin_add_users
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/commands/admin_add_users.py", line 5, in <module>
    from data_safe_haven.administration.users import UserHandler
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/administration/users/__init__.py", line 1, in <module>
    from .user_handler import UserHandler
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/administration/users/user_handler.py", line 5, in <module>
    from data_safe_haven.config import Config, DSHPulumiConfig, DSHPulumiProject
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/config/__init__.py", line 1, in <module>
    from .config import Config
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/config/config.py", line 15, in <module>
    from data_safe_haven.serialisers import AzureSerialisableModel
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/serialisers/__init__.py", line 1, in <module>
    from .azure_serialisable_model import AzureSerialisableModel
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/serialisers/azure_serialisable_model.py", line 5, in <module>
    from data_safe_haven.context.context import Context
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/context/__init__.py", line 2, in <module>
    from .context_settings import ContextSettings
  File "/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/context/context_settings.py", line 17, in <module>
    from data_safe_haven.serialisers import YAMLSerialisableModel
ImportError: cannot import name 'YAMLSerialisableModel' from partially initialized module 'data_safe_haven.serialisers' (most likely due to a circular import) (/Users/jrobinson/Developer/data-safe-haven/code/dsh-jemrobinson-old/data_safe_haven/serialisers/__init__.py)

♻️ To reproduce

  • Run any dsh CLI command
@jemrobinson jemrobinson added the bug Problem when deploying a Data Safe Haven. label May 2, 2024
@jemrobinson jemrobinson added this to the Release 5.0.0rc2 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Problem when deploying a Data Safe Haven.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant