Skip to content

TypeError: mro() returned a non-class ('PydanticRecursiveRef') #102

Description

@kiryhay

I installed via pipx, but I get an error when running:

$ harbor --help
Traceback (most recent call last):
  File "/home/bot/.local/bin/harbor", line 5, in <module>
    from harbor_cli.main import main
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/harbor_cli/__init__.py", line 5, in <module>
    from ._patches import patch_all
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/harbor_cli/_patches/__init__.py", line 3, in <module>
    from harbor_cli._patches import click_repl
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/harbor_cli/_patches/click_repl.py", line 21, in <module>
    from harbor_cli.exceptions import handle_exception
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/harbor_cli/exceptions.py", line 14, in <module>
    from harborapi.exceptions import BadRequest
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/harborapi/__init__.py", line 4, in <module>
    from . import auth
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/harborapi/auth.py", line 10, in <module>
    from harborapi.models.models import Robot
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/harborapi/models/__init__.py", line 3, in <module>
    from . import scanner
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/harborapi/models/scanner.py", line 55, in <module>
    class ScannerProperties(StrDictRootModel[str]):
                            ~~~~~~~~~~~~~~~~^^^^^
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/pydantic/main.py", line 811, in __class_getitem__
    submodel = _generics.create_generic_submodel(model_name, origin, args, params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/pydantic/_internal/_generics.py", line 137, in create_generic_submodel
    created_model = meta(
                    ^^^^^
  File "/home/bot/.local/share/pipx/venvs/harbor-cli/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 137, in __new__
    cls = cast('type[BaseModel]', super().__new__(mcs, cls_name, bases, namespace, **kwargs))
                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen abc>", line 106, in __new__
TypeError: mro() returned a non-class ('PydanticRecursiveRef')

Activity

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