Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-qtconsole for
openSUSE:Factory checked in at 2024-09-09 14:45:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-qtconsole (Old)
and /work/SRC/openSUSE:Factory/.python-qtconsole.new.10096 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-qtconsole"
Mon Sep 9 14:45:30 2024 rev:34 rq:1199487 version:5.6.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-qtconsole/python-qtconsole.changes
2024-07-14 08:54:38.361534178 +0200
+++
/work/SRC/openSUSE:Factory/.python-qtconsole.new.10096/python-qtconsole.changes
2024-09-09 14:46:38.364175535 +0200
@@ -1,0 +2,11 @@
+Sun Sep 8 11:32:42 UTC 2024 - Ben Greiner <[email protected]>
+
+- Update to 5.6.0
+ * Use selected syntax highlighting style for tracebacks and
+ improve ANSI color codes support.
+ * Remove syntax highlighting support for Python 2.
+ * Fix handling of carriage return.
+ * Fix showing bold face characters in output when using ANSI
+ codes.
+
+-------------------------------------------------------------------
Old:
----
qtconsole-5.5.2.tar.gz
New:
----
qtconsole-5.6.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-qtconsole.spec ++++++
--- /var/tmp/diff_new_pack.Zr0OGh/_old 2024-09-09 14:46:38.808193941 +0200
+++ /var/tmp/diff_new_pack.Zr0OGh/_new 2024-09-09 14:46:38.808193941 +0200
@@ -22,7 +22,7 @@
%bcond_with libalternatives
%endif
Name: python-qtconsole
-Version: 5.5.2
+Version: 5.6.0
Release: 0
Summary: Jupyter Qt console
License: BSD-3-Clause
@@ -49,7 +49,6 @@
Requires: python-jupyter-client >= 4.1
Requires: python-jupyter-core
Requires: python-packaging
-Requires: python-pyzmq >= 17.1
Requires: python-traitlets
Conflicts: python-traitlets = 5.2.1
Conflicts: python-traitlets = 5.2.2
@@ -77,7 +76,6 @@
BuildRequires: %{python_module pytest-qt}
BuildRequires: %{python_module pytest-xvfb}
BuildRequires: %{python_module pytest}
-BuildRequires: %{python_module pyzmq >= 17.1}
BuildRequires: %{python_module qt5}
BuildRequires: %{python_module traitlets}
# /SECTION
++++++ qtconsole-5.5.2.tar.gz -> qtconsole-5.6.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/.github/workflows/linux-tests.yml
new/qtconsole-5.6.0/.github/workflows/linux-tests.yml
--- old/qtconsole-5.5.2/.github/workflows/linux-tests.yml 2024-05-05
03:53:54.000000000 +0200
+++ new/qtconsole-5.6.0/.github/workflows/linux-tests.yml 2024-08-28
20:01:04.000000000 +0200
@@ -23,6 +23,7 @@
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUNNER_OS: 'ubuntu'
COVERALLS_REPO_TOKEN: XWVhJf2AsO7iouBLuCsh0pPhwHy81Uz1v
+ COVERALLS_SERVICE_NAME: 'github-actions'
strategy:
fail-fast: false
matrix:
@@ -76,7 +77,7 @@
env:
QT_API: ${{ matrix.QT_LIB }}
PYTEST_QT_API: ${{ matrix.QT_LIB }}
- - name: Upload coverage to Codecov
+ - name: Upload coverage to coveralls
if: matrix.PYTHON_VERSION == '3.8'
shell: bash -l {0}
run: coveralls
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/.gitignore
new/qtconsole-5.6.0/.gitignore
--- old/qtconsole-5.5.2/.gitignore 2023-05-05 19:34:26.000000000 +0200
+++ new/qtconsole-5.6.0/.gitignore 2024-08-28 20:01:04.000000000 +0200
@@ -22,3 +22,4 @@
.coverage
.pytest_cache
.vscode
+.spyproject
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/PKG-INFO new/qtconsole-5.6.0/PKG-INFO
--- old/qtconsole-5.5.2/PKG-INFO 2024-05-05 17:55:09.689656500 +0200
+++ new/qtconsole-5.6.0/PKG-INFO 2024-08-28 20:20:33.893727500 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: qtconsole
-Version: 5.5.2
+Version: 5.6.0
Summary: Jupyter Qt console
Home-page: http://jupyter.org
Author: Jupyter Development Team
@@ -31,7 +31,6 @@
Requires-Dist: pygments
Requires-Dist: ipykernel>=4.1
Requires-Dist: qtpy>=2.4.0
-Requires-Dist: pyzmq>=17.1
Requires-Dist: packaging
Provides-Extra: test
Requires-Dist: flaky; extra == "test"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/docs/source/changelog.rst
new/qtconsole-5.6.0/docs/source/changelog.rst
--- old/qtconsole-5.5.2/docs/source/changelog.rst 2024-05-05
17:50:54.000000000 +0200
+++ new/qtconsole-5.6.0/docs/source/changelog.rst 2024-08-28
20:12:03.000000000 +0200
@@ -3,6 +3,29 @@
Changes in Jupyter Qt console
=============================
+.. _5.6:
+
+5.6
+~~~
+
+5.6.0
+-----
+
+`5.6.0 on GitHub <https://github.com/jupyter/qtconsole/milestones/5.6.0>`__
+
+Additions
++++++++++
+
+* Use selected syntax highlighting style for tracebacks and improve ANSI color
+ codes support.
+
+Changes
++++++++
+
+* Remove syntax highlighting support for Python 2.
+* Fix handling of carriage return.
+* Fix showing bold face characters in output when using ANSI codes.
+
.. _5.5:
5.5
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/qtconsole/_version.py
new/qtconsole-5.6.0/qtconsole/_version.py
--- old/qtconsole-5.5.2/qtconsole/_version.py 2024-05-05 17:53:42.000000000
+0200
+++ new/qtconsole-5.6.0/qtconsole/_version.py 2024-08-28 20:19:51.000000000
+0200
@@ -1,2 +1,2 @@
-version_info = (5, 5, 2)
+version_info = (5, 6, 0)
__version__ = '.'.join(map(str, version_info))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/qtconsole/ansi_code_processor.py
new/qtconsole-5.6.0/qtconsole/ansi_code_processor.py
--- old/qtconsole-5.5.2/qtconsole/ansi_code_processor.py 2021-11-14
19:48:23.000000000 +0100
+++ new/qtconsole-5.6.0/qtconsole/ansi_code_processor.py 2024-08-28
20:01:04.000000000 +0200
@@ -61,7 +61,7 @@
# Whether to increase intensity or set boldness for SGR code 1.
# (Different terminals handle this in different ways.)
- bold_text_enabled = False
+ bold_text_enabled = True
# We provide an empty default color map because subclasses will likely want
# to use a custom color format.
@@ -292,6 +292,31 @@
self.actions.append(ScrollAction('scroll', 'down', 'page', 1))
return ''
+ def _parse_ansi_color(self, color, intensity):
+ """
+ Map an ANSI color code to color name or a RGB tuple.
+ Based on:
https://gist.github.com/MightyPork/1d9bd3a3fd4eb1a661011560f6921b5b
+ """
+ parsed_color = None
+ if color < 16:
+ # Adjust for intensity, if possible.
+ if intensity > 0 and color < 8:
+ color += 8
+ parsed_color = self.color_map.get(color, None)
+ elif (color > 231):
+ s = int((color - 232) * 10 + 8)
+ parsed_color = (s, s, s)
+ else:
+ n = color - 16
+ b = n % 6
+ g = (n - b) / 6 % 6
+ r = (n - b - g * 6) / 36 % 6
+ r = int(r * 40 + 55) if r else 0
+ g = int(g * 40 + 55) if g else 0
+ b = int(b * 40 + 55) if b else 0
+ parsed_color = (r, g, b)
+ return parsed_color
+
class QtAnsiCodeProcessor(AnsiCodeProcessor):
""" Translates ANSI escape codes into QTextCharFormats.
@@ -302,7 +327,7 @@
0 : 'black', # black
1 : 'darkred', # red
2 : 'darkgreen', # green
- 3 : 'brown', # yellow
+ 3 : 'gold', # yellow
4 : 'darkblue', # blue
5 : 'darkviolet', # magenta
6 : 'steelblue', # cyan
@@ -323,12 +348,8 @@
""" Returns a QColor for a given color code or rgb list, or None if one
cannot be constructed.
"""
-
if isinstance(color, int):
- # Adjust for intensity, if possible.
- if color < 8 and intensity > 0:
- color += 8
- constructor = self.color_map.get(color, None)
+ constructor = self._parse_ansi_color(color, intensity)
elif isinstance(color, (tuple, list)):
constructor = color
else:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/qtconsole/console_widget.py
new/qtconsole-5.6.0/qtconsole/console_widget.py
--- old/qtconsole-5.5.2/qtconsole/console_widget.py 2023-11-06
01:26:20.000000000 +0100
+++ new/qtconsole-5.6.0/qtconsole/console_widget.py 2024-08-28
20:01:04.000000000 +0200
@@ -297,6 +297,10 @@
self._reading_callback = None
self._tab_width = 4
+ # Cursor position of where to insert text.
+ # Control characters allow this to move around on the current line.
+ self._insert_text_cursor = self._control.textCursor()
+
# List of strings pending to be appended as plain text in the widget.
# The text is not immediately inserted when available to not
# choke the Qt event loop with paint events for the widget in
@@ -695,6 +699,9 @@
# effect when using a QTextEdit. I believe this is a Qt bug.
self._control.moveCursor(QtGui.QTextCursor.End)
+ # Advance where text is inserted
+ self._insert_text_cursor.movePosition(QtGui.QTextCursor.End)
+
def export_html(self):
""" Shows a dialog to export HTML/XML in various formats.
"""
@@ -712,6 +719,9 @@
self._append_before_prompt_cursor.setPosition(
self._get_end_cursor().position())
+ self._insert_text_cursor.setPosition(
+ self._get_end_cursor().position())
+
# The maximum block count is only in effect during execution.
# This ensures that _prompt_pos does not become invalid due to
# text truncation.
@@ -841,12 +851,12 @@
self._insert_plain_text_into_buffer(cursor, dedent(text))
- def print_(self, printer = None):
+ def print_(self, printer=None):
""" Print the contents of the ConsoleWidget to the specified QPrinter.
"""
- if (not printer):
+ if not printer:
printer = QtPrintSupport.QPrinter()
- if(QtPrintSupport.QPrintDialog(printer).exec_() !=
QtPrintSupport.QPrintDialog.Accepted):
+ if QtPrintSupport.QPrintDialog(printer).exec_() !=
QtPrintSupport.QPrintDialog.Accepted:
return
self._control.print_(printer)
@@ -998,18 +1008,40 @@
current prompt, if there is one.
"""
# Determine where to insert the content.
- cursor = self._control.textCursor()
+ cursor = self._insert_text_cursor
if before_prompt and (self._reading or not self._executing):
self._flush_pending_stream()
- cursor._insert_mode=True
- cursor.setPosition(self._append_before_prompt_pos)
- else:
+
+ # Jump to before prompt, if there is one
+ if cursor.position() >= self._append_before_prompt_pos \
+ and self._append_before_prompt_pos != self._get_end_pos():
+ cursor.setPosition(self._append_before_prompt_pos)
+
+ # If we're appending on the same line as the prompt, use
insert mode.
+ # If so, the character at self._append_before_prompt_pos will
not be a newline
+ cursor.movePosition(QtGui.QTextCursor.Right,
+ QtGui.QTextCursor.KeepAnchor)
+ if cursor.selection().toPlainText() != '\n':
+ cursor._insert_mode = True
+ cursor.movePosition(QtGui.QTextCursor.Left)
+ else:
+ # Insert at current printing point.
+ # If cursor is before prompt jump to end, but only if there
+ # is a prompt (before_prompt_pos != end)
+ if cursor.position() <= self._append_before_prompt_pos \
+ and self._append_before_prompt_pos != self._get_end_pos():
+ cursor.movePosition(QtGui.QTextCursor.End)
+
if insert != self._insert_plain_text:
self._flush_pending_stream()
- cursor.movePosition(QtGui.QTextCursor.End)
# Perform the insertion.
result = insert(cursor, input, *args, **kwargs)
+
+ # Remove insert mode tag
+ if hasattr(cursor, '_insert_mode'):
+ del cursor._insert_mode
+
return result
def _append_block(self, block_format=None, before_prompt=False):
@@ -1045,7 +1077,7 @@
# Select and remove all text below the input buffer.
cursor = self._get_prompt_cursor()
prompt = self._continuation_prompt.lstrip()
- if(self._temp_buffer_filled):
+ if self._temp_buffer_filled:
self._temp_buffer_filled = False
while cursor.movePosition(QtGui.QTextCursor.NextBlock):
temp_cursor = QtGui.QTextCursor(cursor)
@@ -1657,16 +1689,18 @@
return False
def _on_flush_pending_stream_timer(self):
- """ Flush the pending stream output and change the
- prompt position appropriately.
+ """ Flush pending text into the widget on console timer trigger.
"""
- cursor = self._control.textCursor()
- cursor.movePosition(QtGui.QTextCursor.End)
self._flush_pending_stream()
- cursor.movePosition(QtGui.QTextCursor.End)
def _flush_pending_stream(self):
- """ Flush out pending text into the widget. """
+ """
+ Flush pending text into the widget.
+
+ It only applies to text that is pending when the console is in the
+ running state. Text printed when console is not running is shown
+ immediately, and does not wait to be flushed.
+ """
text = self._pending_insert_text
self._pending_insert_text = []
buffer_size = self._control.document().maximumBlockCount()
@@ -1674,7 +1708,7 @@
text = self._get_last_lines_from_list(text, buffer_size)
text = ''.join(text)
t = time.time()
- self._insert_plain_text(self._get_end_cursor(), text, flush=True)
+ self._insert_plain_text(self._insert_text_cursor, text, flush=True)
# Set the flush interval to equal the maximum time to update text.
self._pending_text_flush_interval.setInterval(
int(max(100, (time.time() - t) * 1000))
@@ -2093,12 +2127,12 @@
if (self._executing and not flush and
self._pending_text_flush_interval.isActive() and
- cursor.position() == self._get_end_pos()):
+ cursor.position() == self._insert_text_cursor.position()):
# Queue the text to insert in case it is being inserted at end
self._pending_insert_text.append(text)
if buffer_size > 0:
self._pending_insert_text = self._get_last_lines_from_list(
- self._pending_insert_text, buffer_size)
+ self._pending_insert_text, buffer_size)
return
if self._executing and not
self._pending_text_flush_interval.isActive():
@@ -2123,7 +2157,7 @@
cursor.select(QtGui.QTextCursor.Document)
remove = True
if act.area == 'line':
- if act.erase_to == 'all':
+ if act.erase_to == 'all':
cursor.select(QtGui.QTextCursor.LineUnderCursor)
remove = True
elif act.erase_to == 'start':
@@ -2137,7 +2171,7 @@
QtGui.QTextCursor.EndOfLine,
QtGui.QTextCursor.KeepAnchor)
remove = True
- if remove:
+ if remove:
nspace=cursor.selectionEnd()-cursor.selectionStart() if fill else 0
cursor.removeSelectedText()
if nspace>0: cursor.insertText(' '*nspace) #
replace text by space, to keep cursor position as specified
@@ -2174,15 +2208,17 @@
# simulate replacement mode
if substring is not None:
format = self._ansi_processor.get_format()
- if not (hasattr(cursor,'_insert_mode') and
cursor._insert_mode):
+
+ # Note that using _insert_mode means the \r ANSI sequence
will not swallow characters.
+ if not (hasattr(cursor, '_insert_mode') and
cursor._insert_mode):
pos = cursor.position()
cursor2 = QtGui.QTextCursor(cursor) #
self._get_line_end_pos() is the previous line, don't use it
cursor2.movePosition(QtGui.QTextCursor.EndOfLine)
remain = cursor2.position() - pos # number of
characters until end of line
n=len(substring)
swallow = min(n, remain) # number of
character to swallow
-
cursor.setPosition(pos+swallow,QtGui.QTextCursor.KeepAnchor)
- cursor.insertText(substring,format)
+ cursor.setPosition(pos + swallow,
QtGui.QTextCursor.KeepAnchor)
+ cursor.insertText(substring, format)
else:
cursor.insertText(text)
cursor.endEditBlock()
@@ -2399,7 +2435,7 @@
self._reading = True
if password:
- self._show_prompt('Warning: QtConsole does not support password
mode, '\
+ self._show_prompt('Warning: QtConsole does not support password
mode, '
'the text you type will be visible.',
newline=True)
if 'ipdb' not in prompt.lower():
@@ -2531,6 +2567,9 @@
if move_forward:
self._append_before_prompt_cursor.setPosition(
self._append_before_prompt_cursor.position() + 1)
+ else:
+ # cursor position was 0, set before prompt cursor
+ self._append_before_prompt_cursor.setPosition(0)
self._prompt_started()
#------ Signal handlers
----------------------------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/qtconsole/frontend_widget.py
new/qtconsole-5.6.0/qtconsole/frontend_widget.py
--- old/qtconsole-5.5.2/qtconsole/frontend_widget.py 2024-05-05
03:35:40.000000000 +0200
+++ new/qtconsole-5.6.0/qtconsole/frontend_widget.py 2024-08-28
20:01:04.000000000 +0200
@@ -728,7 +728,7 @@
def append_stream(self, text):
"""Appends text to the output stream."""
- self._append_plain_text(text, before_prompt=True)
+ self._append_plain_text(text, before_prompt = True)
def flush_clearoutput(self):
"""If a clearoutput is pending, execute it."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/qtconsole/jupyter_widget.py
new/qtconsole-5.6.0/qtconsole/jupyter_widget.py
--- old/qtconsole-5.5.2/qtconsole/jupyter_widget.py 2023-11-06
00:26:17.000000000 +0100
+++ new/qtconsole-5.6.0/qtconsole/jupyter_widget.py 2024-08-28
20:01:04.000000000 +0200
@@ -14,7 +14,7 @@
from qtpy import QtCore, QtGui
-from IPython.lib.lexers import IPythonLexer, IPython3Lexer
+from IPython.lib.lexers import IPython3Lexer
from pygments.lexers import get_lexer_by_name
from pygments.util import ClassNotFound
from qtconsole import __version__
@@ -303,8 +303,6 @@
# added here by hand.
if pygments_lexer == 'ipython3':
lexer = IPython3Lexer()
- elif pygments_lexer == 'ipython2':
- lexer = IPythonLexer()
else:
lexer = get_lexer_by_name(self.language_name)
self._highlighter._lexer = lexer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/qtconsole/mainwindow.py
new/qtconsole-5.6.0/qtconsole/mainwindow.py
--- old/qtconsole-5.5.2/qtconsole/mainwindow.py 2022-05-29 18:43:26.000000000
+0200
+++ new/qtconsole-5.6.0/qtconsole/mainwindow.py 2024-08-28 20:01:04.000000000
+0200
@@ -801,6 +801,7 @@
colors='nocolor'
elif styles.dark_style(syntax_style):
colors='linux'
+
else:
colors='lightbg'
self.active_frontend.syntax_style = syntax_style
@@ -809,7 +810,18 @@
self.active_frontend._syntax_style_changed()
self.active_frontend._style_sheet_changed()
self.active_frontend.reset(clear=True)
- self.active_frontend._execute("%colors linux", True)
+ self.active_frontend._execute(
+f"""
+from IPython.core.ultratb import VerboseTB
+if getattr(VerboseTB, 'tb_highlight_style', None) is not None:
+ VerboseTB.tb_highlight_style = '{syntax_style}'
+elif getattr(VerboseTB, '_tb_highlight_style', None) is not None:
+ VerboseTB._tb_highlight_style = '{syntax_style}'
+else:
+ get_ipython().run_line_magic('colors', '{colors}')
+""",
+ True)
+
def close_active_frontend(self):
self.close_tab(self.active_frontend)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-5.5.2/qtconsole/tests/test_00_console_widget.py
new/qtconsole-5.6.0/qtconsole/tests/test_00_console_widget.py
--- old/qtconsole-5.5.2/qtconsole/tests/test_00_console_widget.py
2023-03-28 23:52:03.000000000 +0200
+++ new/qtconsole-5.6.0/qtconsole/tests/test_00_console_widget.py
2024-08-28 20:01:04.000000000 +0200
@@ -371,6 +371,44 @@
# clear all the text
cursor.insertText('')
+ def test_print_carriage_return(self):
+ """ Test that overwriting the current line works as intended,
+ before and after the cursor prompt.
+ """
+ w = ConsoleWidget()
+
+ # Show a prompt
+ w._prompt = "prompt>"
+ w._prompt_sep = "\n"
+
+ w._show_prompt()
+ self.assert_text_equal(w._get_cursor(), '\u2029prompt>')
+
+ test_inputs = ['Hello\n', 'World\r',
+ '*' * 10, '\r',
+ '0', '1', '2', '3', '4',
+ '5', '6', '7', '8', '9',
+ '\r\n']
+
+ for text in test_inputs:
+ w._append_plain_text(text, before_prompt=True)
+ w._flush_pending_stream() # emulate text being flushed
+
+ self.assert_text_equal(w._get_cursor(),
+ "Hello\u20290123456789\u2029\u2029prompt>")
+
+ # Print after prompt
+ w._executing = True
+ test_inputs = ['\nF', 'o', 'o',
+ '\r', 'Bar', '\n']
+
+ for text in test_inputs:
+ w._append_plain_text(text, before_prompt=False)
+ w._flush_pending_stream() # emulate text being flushed
+
+ self.assert_text_equal(w._get_cursor(),
+ "Hello\u20290123456789\u2029\u2029prompt>\u2029Bar\u2029")
+
def test_link_handling(self):
noButton = QtCore.Qt.NoButton
noButtons = QtCore.Qt.NoButton
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-5.5.2/qtconsole/tests/test_ansi_code_processor.py
new/qtconsole-5.6.0/qtconsole/tests/test_ansi_code_processor.py
--- old/qtconsole-5.5.2/qtconsole/tests/test_ansi_code_processor.py
2021-11-14 19:48:23.000000000 +0100
+++ new/qtconsole-5.6.0/qtconsole/tests/test_ansi_code_processor.py
2024-08-28 20:01:04.000000000 +0200
@@ -2,13 +2,14 @@
import unittest
# Local imports
-from qtconsole.ansi_code_processor import AnsiCodeProcessor
+from qtconsole.ansi_code_processor import AnsiCodeProcessor,
QtAnsiCodeProcessor
class TestAnsiCodeProcessor(unittest.TestCase):
def setUp(self):
self.processor = AnsiCodeProcessor()
+ self.qt_processor = QtAnsiCodeProcessor()
def test_clear(self):
""" Do control sequences for clearing the console work?
@@ -37,7 +38,7 @@
def test_colors(self):
""" Do basic controls sequences for colors work?
"""
- string = 'first\x1b[34mblue\x1b[0mlast'
+ string = 'first\x1b[34mblue\x1b[0mlast\033[33mYellow'
i = -1
for i, substring in enumerate(self.processor.split_string(string)):
if i == 0:
@@ -49,9 +50,14 @@
elif i == 2:
self.assertEqual(substring, 'last')
self.assertEqual(self.processor.foreground_color, None)
+ elif i == 3:
+ foreground_color = self.processor.foreground_color
+ self.assertEqual(substring, 'Yellow')
+ self.assertEqual(foreground_color, 3)
+
self.assertEqual(self.qt_processor.get_color(foreground_color).name(),
'#ffd700')
else:
self.fail('Too many substrings.')
- self.assertEqual(i, 2, 'Too few substrings.')
+ self.assertEqual(i, 3, 'Too few substrings.')
def test_colors_xterm(self):
""" Do xterm-specific control sequences for colors work?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/qtconsole/tests/test_comms.py
new/qtconsole-5.6.0/qtconsole/tests/test_comms.py
--- old/qtconsole-5.5.2/qtconsole/tests/test_comms.py 2024-05-05
17:45:27.000000000 +0200
+++ new/qtconsole-5.6.0/qtconsole/tests/test_comms.py 2024-08-28
20:01:04.000000000 +0200
@@ -1,3 +1,4 @@
+import os
import time
from queue import Empty
import unittest
@@ -11,6 +12,9 @@
def setUp(self):
"""Open a kernel."""
+ # Prevent tests assertions related with message type from failing
+ # due to a debug warning
+ os.environ['PYDEVD_DISABLE_FILE_VALIDATION'] = '1'
self.kernel_manager = QtKernelManager()
self.kernel_manager.start_kernel()
self.kernel_client = self.kernel_manager.client()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-5.5.2/qtconsole/tests/test_jupyter_widget.py
new/qtconsole-5.6.0/qtconsole/tests/test_jupyter_widget.py
--- old/qtconsole-5.5.2/qtconsole/tests/test_jupyter_widget.py 2023-03-07
01:10:49.000000000 +0100
+++ new/qtconsole-5.6.0/qtconsole/tests/test_jupyter_widget.py 2024-08-28
20:01:04.000000000 +0200
@@ -36,9 +36,15 @@
# By default, the background is light. White text is rendered as black
self.assertEqual(w._ansi_processor.get_color(15).name(), '#000000')
+ # Color code 40
+ self.assertEqual(w._ansi_processor.get_color(40).name(), '#00d700')
+
# Change to a dark colorscheme. White text is rendered as white
w.syntax_style = 'monokai'
self.assertEqual(w._ansi_processor.get_color(15).name(), '#ffffff')
+
+ # Color code 40 with monokai
+ self.assertEqual(w._ansi_processor.get_color(40).name(), '#00d700')
@pytest.mark.skipif(not sys.platform.startswith('linux'),
reason="Works only on Linux")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/qtconsole.egg-info/PKG-INFO
new/qtconsole-5.6.0/qtconsole.egg-info/PKG-INFO
--- old/qtconsole-5.5.2/qtconsole.egg-info/PKG-INFO 2024-05-05
17:55:09.000000000 +0200
+++ new/qtconsole-5.6.0/qtconsole.egg-info/PKG-INFO 2024-08-28
20:20:33.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: qtconsole
-Version: 5.5.2
+Version: 5.6.0
Summary: Jupyter Qt console
Home-page: http://jupyter.org
Author: Jupyter Development Team
@@ -31,7 +31,6 @@
Requires-Dist: pygments
Requires-Dist: ipykernel>=4.1
Requires-Dist: qtpy>=2.4.0
-Requires-Dist: pyzmq>=17.1
Requires-Dist: packaging
Provides-Extra: test
Requires-Dist: flaky; extra == "test"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/qtconsole.egg-info/requires.txt
new/qtconsole-5.6.0/qtconsole.egg-info/requires.txt
--- old/qtconsole-5.5.2/qtconsole.egg-info/requires.txt 2024-05-05
17:55:09.000000000 +0200
+++ new/qtconsole-5.6.0/qtconsole.egg-info/requires.txt 2024-08-28
20:20:33.000000000 +0200
@@ -4,7 +4,6 @@
pygments
ipykernel>=4.1
qtpy>=2.4.0
-pyzmq>=17.1
packaging
[doc]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/requirements/environment.yml
new/qtconsole-5.6.0/requirements/environment.yml
--- old/qtconsole-5.5.2/requirements/environment.yml 2023-10-19
16:46:51.000000000 +0200
+++ new/qtconsole-5.6.0/requirements/environment.yml 2024-08-28
20:01:04.000000000 +0200
@@ -9,7 +9,6 @@
- jupyter_client
- pygments
- ipykernel
-- pyzmq >=17.1
# For testing
- coveralls
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-5.5.2/setup.py new/qtconsole-5.6.0/setup.py
--- old/qtconsole-5.5.2/setup.py 2023-10-19 17:09:05.000000000 +0200
+++ new/qtconsole-5.6.0/setup.py 2024-08-28 20:01:04.000000000 +0200
@@ -71,7 +71,6 @@
'pygments',
'ipykernel>=4.1', # not a real dependency, but require the reference
kernel
'qtpy>=2.4.0',
- 'pyzmq>=17.1',
'packaging'
],
extras_require = {