Skip to content

AttributeError at ipywidget bump >= 7.0 #17

@antoinegaston

Description

@antoinegaston

Describe the bug
This bug appears on bumping ipywidgets to 7.0 or higer. The full trace is:

tests/services/test_compute_rule.py:13: in <module>
    from ..app import RootTest, TestingDBSessionLocal
tests/app.py:11: in <module>
    from run import app
run.py:5: in <module>
    from src.app.controllers import private_router, public_router
src/app/controllers/__init__.py:22: in <module>
    from .indication_prioritization import router as indication_prioritization_router
src/app/controllers/indication_prioritization.py:25: in <module>
    from ..utils.indication_prioritization import (
src/app/utils/indication_prioritization.py:8: in <module>
    from clustergrammer_widget import Network, clustergrammer_widget
.venv/lib/python3.7/site-packages/clustergrammer_widget/__init__.py:3: in <module>
    from .example import *
.venv/lib/python3.7/site-packages/clustergrammer_widget/example.py:10: in <module>
    @widgets.register('hello.Hello')
.venv/lib/python3.7/site-packages/ipywidgets/widgets/widget.py:264: in register
    w = widget.class_traits()
AttributeError: 'str' object has no attribute 'class_traits'

It is linked to a deprecation of the name parameter of register method of the WidgetRegistry object from ipywidgets. A simple fix would be to replace @widgets.register('hello.Hello') by @widgets.register in clustergrammer_widget/example.py:10.

To Reproduce
Steps to reproduce the behavior:

  1. Bump pytz to 7.0 or higher
  2. Import clustergrammer_widget from clustergrammer_widget in a dummy script
  3. Run it

Expected behavior
No errors.

Desktop (please complete the following information):

  • OS: macOs monterey 12.4
  • Version: python 3.7.9 64-bits, ipywidgets 8.0.2, clustergrammer-widget 1.13.3

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