spyder-ide / spyder-terminal

Run system terminals inside Spyder. Works on Linux, macOS and Windows.
MIT License
232 stars 77 forks source link

Compatibility with Spyder 6 #345

Open dalthviz opened 1 year ago

dalthviz commented 1 year ago

Description of your problem

What steps will reproduce the problem?

  1. Install spyder-terminal
  2. Use Spyder 6 from source (e6140b132conda l)

What is the expected output? What do you see instead?

Launch normally and have the plugin available. Instead:

<class 'spyder_terminal.terminalplugin.TerminalPlugin'>: get_font() missing 1 required positional argument: 'font_type'
Traceback (most recent call last):
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\app\mainwindow.py", line 795, in setup
    plugin_instance = PLUGIN_REGISTRY.register_plugin(
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\api\plugin_registration\registry.py", line 345, in register_plugin
    instance = self._instantiate_spyder5_plugin(
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\api\plugin_registration\registry.py", line 196, in _instantiate_spyder5_plugin
    plugin_instance.initialize()
  File "e:\acer\documentos\spyder\spyder otros\carlos\spyder\spyder\api\plugins\new_api.py", line 679, in initialize
    self.on_initialize()
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\spyder_terminal\terminalplugin.py", line 74, in on_initialize
    self.update_font()
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\spyder_terminal\terminalplugin.py", line 106, in update_font
    font = self.get_font()
TypeError: get_font() missing 1 required positional argument: 'font_type'
Traceback (most recent call last):
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\spyder_terminal\widgets\main_widget.py", line 304, in __wait_server_to_start
    self.create_new_term(give_focus=False)
  File "C:\Users\dalth\anaconda3\envs\spyder-dev\lib\site-packages\spyder_terminal\widgets\main_widget.py", line 364, in create_new_term
    self, self.port, path=path, font=self.font.family(),
AttributeError: 'NoneType' object has no attribute 'family'

Versions and main components

Should we try to fix this setting a default value over the Spyder side or changing things here @ccordoba12 ?

ccordoba12 commented 1 year ago

Things need to be fixed here. It seems this is related to the changes I introduced in https://github.com/spyder-ide/spyder/pull/20933, but the fix doesn't seem hard: just use the SpyderFontType enum to select the appropriate font in self.get_font.