insitro / redun

Yet another redundant workflow engine
https://insitro.github.io/redun/
Apache License 2.0
510 stars 43 forks source link

ImportError: Package 'textual.widgets' has no class 'TextLog' #81

Closed gabriel-v closed 12 months ago

gabriel-v commented 12 months ago

This happens on the tests on main branch, here is a recent re-run of the CI and another run with the patch

After installing dev packages on a fresh venv, then running pytest, one gets this error:

================================================================== ERRORS ===================================================================
___________________________________________ ERROR collecting redun/tests/test_static_analysis.py ____________________________________________
ImportError while importing test module '/work/redun/redun/tests/test_static_analysis.py'.
Hint: make sure your test modules/packages have valid Python names.                                                                          
Traceback:                                                                                                                                   
/usr/lib/python3.11/importlib/__init__.py:126: in import_module                                                                              
    return _bootstrap._gcd_import(name[level:], package, level)                                                                              
redun/tests/test_static_analysis.py:21: in <module>                                                                                              for module in import_all_modules(redun)                
redun/tests/utils.py:466: in import_all_modules                                                                                                  modules.extend(import_all_modules(module))                                                                                               
redun/tests/utils.py:464: in import_all_modules
    module = importlib.import_module(full_name)
/usr/lib/python3.11/importlib/__init__.py:126: in import_module                                                                              
    return _bootstrap._gcd_import(name[level:], package, level)                                                                              redun/console/app.py:16: in <module>                               
    from redun.console.screens import (                                                                                                      redun/console/screens.py:17: in <module>                                                                                                     
    from textual.widgets import Footer, Input, Label, Static, TextLog
/home/gabriel/.local/share/virtualenvs/redun-gyVl-7AX/lib/python3.11/site-packages/textual/widgets/__init__.py:98: in __getattr__
    raise ImportError(f"Package 'textual.widgets' has no class '{widget_class}'")                                     
E   ImportError: Package 'textual.widgets' has no class 'TextLog'    

A quick google shows this: https://textual.textualize.io/FAQ/#no-widget-called-textlog

No widget called TextLog The TextLog widget was renamed to RichLog in Textual 0.32.0.

The dev requirements don't explicitly list textual as a dependency, and pip installed version 0.36.0 for me. I added a pinned version of textual=0.31.0 to avoid this issue - see PR

I also had another error with pip trying out and rejecting all versions of pygraphviz -- so I pinned version 1.11 which was installed in the last test execution on github actions. But now tox complains about that version, it wants versions <=1.8 on the older python versions.

mattrasmus commented 12 months ago

Thanks for posting this. We have fixed this in a our dev branch, but I forgot to push it to our public one.

Commit with a fix for the textual change: https://github.com/insitro/redun/commit/bf82ef819fcda0ba7a85f5b2fc8fa2d8821e57eb#diff-2b9f88b7d249ad141e9647d11d2a514071b5917a14367dc3f083cb9a849fa5adR200