Skip to content

Clarify when no fixture present in registry #369

@mathomp4

Description

@mathomp4

A simple task I can try and handle. To wit, recently there was a components.yaml that didn't have a fixture and the error was:

❯ mepo clone
Found partial clone type [blobless] in .mepoconfig
Traceback (most recent call last):
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/command/clone.py", line 78, in read_state
    allcomps = MepoState.read_state()
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/state.py", line 127, in read_state
    raise StateDoesNotExistError("Error! mepo state does not exist")
mepo.utilities.exceptions.StateDoesNotExistError: Error! mepo state does not exist

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mathomp4/.homebrew/brew/bin/mepo", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/__main__.py", line 15, in main
    cmd_module.run(args)
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/command/clone.py", line 41, in run
    allcomps = read_state(args.style, args.registry)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/command/clone.py", line 81, in read_state
    mepo_init(SimpleNamespace(style=arg_style, registry=registry))
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/command/init.py", line 20, in run
    _ = MepoState.initialize(args.registry, style)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/state.py", line 70, in initialize
    input_components = Registry(project_registry).read_file()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/registry.py", line 53, in read_file
    return getattr(self, "read_" + self.__filetype)()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/registry.py", line 61, in read_yaml
    self.__validate(d)
  File "/Users/mathomp4/.homebrew/brew/Cellar/mepo/2.4.0/libexec/lib/python3.12/site-packages/mepo/registry.py", line 49, in __validate
    assert num_fixtures == 1
           ^^^^^^^^^^^^^^^^^
AssertionError

I mean, it's saying what's wrong, but we can make it more plain. I'll make a quick fix.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions