Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Fix traitlets deprecation warning #17076

Merged
merged 2 commits into from
Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ def run(self):
'spyder-kernels>=2.2.0,<2.3.0',
'textdistance>=4.2.0',
'three-merge>=0.1.1',
'traitlets>=4.1',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'traitlets>=4.1',

trailets is a transitive dependency, so we don't need to depend on it directly:

spyder -> spyder-kernels -> ipykernel -> traitlets

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is true, though the remainder of the patch does explicitly import it. I guess it's a matter of style to a great extent; this explicit listing just makes the version requirements explicit, though ipykernel does that anyway. I'm not particularly bothered either way; happy to make that change or let you do it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make it. We already have a lot of dependencies to add one more for such a simple change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

'watchdog>=0.10.3'
]

Expand Down
4 changes: 3 additions & 1 deletion spyder/plugins/ipythonconsole/widgets/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from qtpy.QtCore import Signal, QThread
from qtpy.QtWidgets import QMessageBox
from qtpy import QtCore, QtWidgets, QtGui
from traitlets import observe

# Local imports
from spyder.config.base import (
Expand Down Expand Up @@ -933,7 +934,8 @@ def _handle_kernel_restarted(self, *args, **kwargs):
super(ShellWidget, self)._handle_kernel_restarted(*args, **kwargs)
self.sig_kernel_restarted.emit()

def _syntax_style_changed(self):
@observe('syntax_style')
def _syntax_style_changed(self, changed=None):
"""Refresh the highlighting with the current syntax style by class."""
if self._highlighter is None:
# ignore premature calls
Expand Down