Hello community,
here is the log from the commit of package python-jupyter_qtconsole for
openSUSE:Factory checked in at 2019-01-08 12:27:54
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jupyter_qtconsole (Old)
and /work/SRC/openSUSE:Factory/.python-jupyter_qtconsole.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jupyter_qtconsole"
Tue Jan 8 12:27:54 2019 rev:8 rq:662838 version:4.4.3
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-jupyter_qtconsole/python-jupyter_qtconsole.changes
2018-09-15 15:35:08.977028431 +0200
+++
/work/SRC/openSUSE:Factory/.python-jupyter_qtconsole.new.28833/python-jupyter_qtconsole.changes
2019-01-08 12:30:28.400141657 +0100
@@ -1,0 +2,9 @@
+Sat Dec 22 07:09:10 UTC 2018 - Todd R <[email protected]>
+
+- Update to version 4.4.3
+ * Fix complete statements check inside indented block for Python after the
IPython 7 release.
+ * Improve auto-scrolling during execution.
+- Update to version 4.4.2
+ * Fix incompatibility with PyQt5 5.11.
+
+-------------------------------------------------------------------
Old:
----
qtconsole-4.4.1.tar.gz
New:
----
qtconsole-4.4.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-jupyter_qtconsole.spec ++++++
--- /var/tmp/diff_new_pack.k7DO66/_old 2019-01-08 12:30:32.464137233 +0100
+++ /var/tmp/diff_new_pack.k7DO66/_new 2019-01-08 12:30:32.468137228 +0100
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-jupyter_qtconsole
-Version: 4.4.1
+Version: 4.4.3
Release: 0
Summary: Jupyter Qt console
License: BSD-3-Clause
@@ -44,6 +44,7 @@
BuildRequires: %{python_module jupyter_ipykernel >= 4.1}
BuildRequires: %{python_module nose}
BuildRequires: %{python_module pexpect}
+BuildRequires: %{python_module pytest}
BuildRequires: %{python_module qt5}
BuildRequires: %{python_module sip}
BuildRequires: %{python_module traitlets}
@@ -98,7 +99,12 @@
popd
%check
-%python_expand nosetests-%{$python_bin_suffix}
+rm -rf build
+rm -rf _build.*
+%{python_expand rm -rf build
+rm -rf _build.*
+pytest-%{$python_bin_suffix}
+}
%files %{python_files}
%doc README.md
++++++ qtconsole-4.4.1.tar.gz -> qtconsole-4.4.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/CONTRIBUTING.md
new/qtconsole-4.4.3/CONTRIBUTING.md
--- old/qtconsole-4.4.1/CONTRIBUTING.md 2015-12-20 15:40:14.000000000 +0100
+++ new/qtconsole-4.4.3/CONTRIBUTING.md 2018-11-10 04:10:20.000000000 +0100
@@ -1,3 +1,33 @@
# Contributing
We follow the [IPython Contributing
Guide](https://github.com/ipython/ipython/blob/master/CONTRIBUTING.md).
+
+## To set up a development environment
+
+Fork the repository and clone the forked repository locally.
+
+Use Conda to install dependencies and activate the development environment.
+
+```
+conda create -n qtdev python=3
+conda activate qtdev
+conda install pyqt
+```
+
+To run after the changes have been made to source (preferred):
+
+```
+pip install -e .
+```
+
+**or,** for running immediate changes:
+
+```
+python setup.py develop
+```
+
+Finally, to run the tests:
+
+```
+pytest
+```
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/PKG-INFO new/qtconsole-4.4.3/PKG-INFO
--- old/qtconsole-4.4.1/PKG-INFO 2018-08-19 05:00:33.000000000 +0200
+++ new/qtconsole-4.4.3/PKG-INFO 2018-11-10 19:27:15.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: qtconsole
-Version: 4.4.1
+Version: 4.4.3
Summary: Jupyter Qt console
Home-page: http://jupyter.org
Author: Jupyter Development Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/README.md
new/qtconsole-4.4.3/README.md
--- old/qtconsole-4.4.1/README.md 2018-08-19 04:50:08.000000000 +0200
+++ new/qtconsole-4.4.3/README.md 2018-10-12 22:41:34.000000000 +0200
@@ -51,10 +51,12 @@
used.
**Note:** Additional information about using a system package manager may be
-found in the [qtconsole documentation](https://qtconsole.readthedocs.io). For
-example, on Linux Debian/Ubuntu, use ``sudo apt-get install python3-pyqt5`` to
-install PyQt5, ``sudo apt-get install python-qt4`` or
-``sudo apt-get install python3-pyqt4`` to install PyQt4.
+found in the [qtconsole documentation](https://qtconsole.readthedocs.io).
+
+More installation instructions for PyQT can be found in the [PyQt5
documentation](http://pyqt.sourceforge.net/Docs/PyQt5/installation.html) and
[PyQt4 documentation](http://pyqt.sourceforge.net/Docs/PyQt4/installation.html)
+
+Source packages for Windows/Linux/MacOS can be found here:
[PyQt5](https://www.riverbankcomputing.com/software/pyqt/download5) and
[PyQt4](https://riverbankcomputing.com/software/pyqt/download).
+
## Usage
To run the Qt console:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/docs/source/changelog.rst
new/qtconsole-4.4.3/docs/source/changelog.rst
--- old/qtconsole-4.4.1/docs/source/changelog.rst 2018-08-19
04:57:02.000000000 +0200
+++ new/qtconsole-4.4.3/docs/source/changelog.rst 2018-11-10
19:22:49.000000000 +0100
@@ -3,6 +3,20 @@
Changes in Jupyter Qt console
=============================
+.. _4.4.3:
+
+`4.4.3 on GitHub <https://github.com/jupyter/qtconsole/milestones/4.4.3>`__
+
+- Fix complete statements check inside indented block for Python after
+ the IPython 7 release.
+- Improve auto-scrolling during execution.
+
+.. _4.4.2:
+
+`4.4.2 on GitHub <https://github.com/jupyter/qtconsole/milestones/4.4.2>`__
+
+- Fix incompatibility with PyQt5 5.11.
+
.. _4.4.1:
`4.4.1 on GitHub <https://github.com/jupyter/qtconsole/milestones/4.4.1>`__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/_version.py
new/qtconsole-4.4.3/qtconsole/_version.py
--- old/qtconsole-4.4.1/qtconsole/_version.py 2018-08-19 04:59:51.000000000
+0200
+++ new/qtconsole-4.4.3/qtconsole/_version.py 2018-11-10 19:24:05.000000000
+0100
@@ -1,2 +1,2 @@
-version_info = (4, 4, 1)
+version_info = (4, 4, 3)
__version__ = '.'.join(map(str, version_info))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/console_widget.py
new/qtconsole-4.4.3/qtconsole/console_widget.py
--- old/qtconsole-4.4.1/qtconsole/console_widget.py 2018-08-12
00:38:18.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/console_widget.py 2018-11-10
19:18:36.000000000 +0100
@@ -625,10 +625,6 @@
# Decide what to execute.
if source is None:
source = self.input_buffer
- if not hidden:
- # A newline is appended later, but it should be considered part
- # of the input buffer.
- source += '\n'
elif not hidden:
self.input_buffer = source
@@ -1908,7 +1904,7 @@
def _indent(self, dedent=True):
""" Indent/Dedent current line or current text selection.
"""
- num_newlines = self._get_cursor().selectedText().count("\u2029")
+ num_newlines = self._get_cursor().selectedText().count(u"\u2029")
save_cur = self._get_cursor()
cur = self._get_cursor()
@@ -2024,6 +2020,13 @@
if buffer_size > 0:
text = self._get_last_lines(text, buffer_size)
+ if self._executing:
+ viewport = self._control.viewport()
+ end_scroll_pos = self._control.cursorForPosition(
+ QtCore.QPoint(viewport.width()-1, viewport.height()-1)
+ ).position()
+ end_doc_pos = self._get_end_pos()
+
cursor.beginEditBlock()
if self.ansi_codes:
for substring in self._ansi_processor.split_string(text):
@@ -2084,6 +2087,9 @@
cursor.insertText(text)
cursor.endEditBlock()
+ if self._executing and end_doc_pos - end_scroll_pos <= 1:
+ self._control.moveCursor(QtGui.QTextCursor.End)
+
def _insert_plain_text_into_buffer(self, cursor, text):
""" Inserts text into the input buffer using the specified cursor
(which
must be in the input buffer), ensuring that continuation prompts
are
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/frontend_widget.py
new/qtconsole-4.4.3/qtconsole/frontend_widget.py
--- old/qtconsole-4.4.1/qtconsole/frontend_widget.py 2018-08-12
00:38:18.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/frontend_widget.py 2018-11-09
22:01:10.000000000 +0100
@@ -162,18 +162,19 @@
_local_kernel = False
_highlighter = Instance(FrontendHighlighter, allow_none=True)
-
#---------------------------------------------------------------------------
- # 'object' interface
-
#---------------------------------------------------------------------------
+ # -------------------------------------------------------------------------
+ # 'Object' interface
+ # -------------------------------------------------------------------------
- def __init__(self, *args, **kw):
+ def __init__(self, local_kernel=_local_kernel, *args, **kw):
super(FrontendWidget, self).__init__(*args, **kw)
# FIXME: remove this when PySide min version is updated past 1.0.7
# forcefully disable calltips if PySide is < 1.0.7, because they crash
if qt.QT_API == qt.QT_API_PYSIDE:
import PySide
- if PySide.__version_info__ < (1,0,7):
- self.log.warn("PySide %s < 1.0.7 detected, disabling calltips"
% PySide.__version__)
+ if PySide.__version_info__ < (1, 0, 7):
+ self.log.warning("PySide %s < 1.0.7 found; disabling calltips",
+ PySide.__version__)
self.enable_calltips = False
# FrontendWidget protected variables.
@@ -212,8 +213,7 @@
document.contentsChange.connect(self._document_contents_change)
# Set flag for whether we are connected via localhost.
- self._local_kernel = kw.get('local_kernel',
- FrontendWidget._local_kernel)
+ self._local_kernel = local_kernel
# Whether or not a clear_output call is pending new output.
self._pending_clearoutput = False
@@ -484,7 +484,7 @@
def _handle_kernel_died(self, since_last_heartbeat):
"""Handle the kernel's death (if we do not own the kernel).
"""
- self.log.warn("kernel died: %s", since_last_heartbeat)
+ self.log.warning("kernel died: %s", since_last_heartbeat)
if self.custom_restart:
self.custom_restart_kernel_died.emit(since_last_heartbeat)
else:
@@ -496,7 +496,7 @@
There's nothing to do but show a message.
"""
- self.log.warn("kernel restarted")
+ self.log.warning("kernel restarted")
self._kernel_restarted_message(died=died)
self.reset()
@@ -681,7 +681,6 @@
# widget's tab width.
text = text.expandtabs(8)
self._append_plain_text(text, before_prompt=True)
- self._control.moveCursor(QtGui.QTextCursor.End)
def flush_clearoutput(self):
"""If a clearoutput is pending, execute it."""
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/ipython_widget.py
new/qtconsole-4.4.3/qtconsole/ipython_widget.py
--- old/qtconsole-4.4.1/qtconsole/ipython_widget.py 2015-12-20
15:40:14.000000000 +0100
+++ new/qtconsole-4.4.3/qtconsole/ipython_widget.py 2018-11-09
21:59:15.000000000 +0100
@@ -1,3 +1,4 @@
import warnings
-warnings.warn("qtconsole.ipython_widget is deprecated. use
qtconsole.jupyter_widget", DeprecationWarning)
+warnings.warn("qtconsole.ipython_widget is deprecated; "
+ "use qtconsole.jupyter_widget", DeprecationWarning)
from .jupyter_widget import *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/jupyter_widget.py
new/qtconsole-4.4.3/qtconsole/jupyter_widget.py
--- old/qtconsole-4.4.1/qtconsole/jupyter_widget.py 2018-08-12
00:38:18.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/jupyter_widget.py 2018-11-09
21:59:15.000000000 +0100
@@ -13,6 +13,7 @@
import sys
import time
from textwrap import dedent
+from warnings import warn
from qtconsole.qt import QtCore, QtGui
@@ -585,11 +586,11 @@
return "Jupyter QtConsole {version}\n".format(version=__version__)
-# clobber IPythonWidget above:
+# Clobber IPythonWidget above:
class IPythonWidget(JupyterWidget):
- """Deprecated class. Use JupyterWidget"""
+ """Deprecated class; use JupyterWidget."""
def __init__(self, *a, **kw):
- warn("IPythonWidget is deprecated, use JupyterWidget")
+ warn("IPythonWidget is deprecated; use JupyterWidget",
+ DeprecationWarning)
super(IPythonWidget, self).__init__(*a, **kw)
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/qt_loaders.py
new/qtconsole-4.4.3/qtconsole/qt_loaders.py
--- old/qtconsole-4.4.1/qtconsole/qt_loaders.py 2018-08-12 00:38:18.000000000
+0200
+++ new/qtconsole-4.4.3/qtconsole/qt_loaders.py 2018-10-12 22:41:34.000000000
+0200
@@ -267,10 +267,11 @@
ImportErrors rasied within this function are non-recoverable
"""
- import sip
from PyQt5 import QtCore, QtSvg, QtWidgets, QtGui, QtPrintSupport
+ import sip
+
# Alias PyQt-specific functions for PySide compatibility.
QtCore.Signal = QtCore.pyqtSignal
QtCore.Slot = QtCore.pyqtSlot
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/qtconsoleapp.py
new/qtconsole-4.4.3/qtconsole/qtconsoleapp.py
--- old/qtconsole-4.4.1/qtconsole/qtconsoleapp.py 2018-08-12
00:38:18.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/qtconsoleapp.py 2018-11-09
21:59:15.000000000 +0100
@@ -363,11 +363,14 @@
self._sigint_timer = timer
def _deprecate_config(self, cfg, old_name, new_name):
- """Warn about deprecated config"""
+ """Warn about deprecated config."""
if old_name in cfg:
- self.log.warn("Use %s in config, not %s. Outdated config:\n %s",
+ self.log.warning(
+ "Use %s in config, not %s. Outdated config:\n %s",
new_name, old_name,
- '\n '.join('{name}.{key} = {value!r}'.format(key=key,
value=value, name=old_name)
+ '\n '.join(
+ '{name}.{key} = {value!r}'.format(key=key, value=value,
+ name=old_name)
for key, value in self.config[old_name].items()
)
)
@@ -410,13 +413,14 @@
class IPythonQtConsoleApp(JupyterQtConsoleApp):
def __init__(self, *a, **kw):
- warn("IPythonQtConsoleApp is deprecated, use JupyterQtConsoleApp")
+ warn("IPythonQtConsoleApp is deprecated; use JupyterQtConsoleApp",
+ DeprecationWarning)
super(IPythonQtConsoleApp, self).__init__(*a, **kw)
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
# Main entry point
-#-----------------------------------------------------------------------------
+# -----------------------------------------------------------------------------
def main():
JupyterQtConsoleApp.launch_instance()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/rich_ipython_widget.py
new/qtconsole-4.4.3/qtconsole/rich_ipython_widget.py
--- old/qtconsole-4.4.1/qtconsole/rich_ipython_widget.py 2015-12-20
15:40:14.000000000 +0100
+++ new/qtconsole-4.4.3/qtconsole/rich_ipython_widget.py 2018-11-09
21:59:15.000000000 +0100
@@ -1,3 +1,4 @@
import warnings
-warnings.warn("qtconsole.rich_ipython_widget is deprecated. use
qtconsole.rich_jupyter_widget", DeprecationWarning)
+warnings.warn("qtconsole.rich_ipython_widget is deprecated; "
+ "use qtconsole.rich_jupyter_widget", DeprecationWarning)
from .rich_jupyter_widget import *
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/rich_jupyter_widget.py
new/qtconsole-4.4.3/qtconsole/rich_jupyter_widget.py
--- old/qtconsole-4.4.1/qtconsole/rich_jupyter_widget.py 2018-08-19
04:01:58.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/rich_jupyter_widget.py 2018-11-09
21:59:15.000000000 +0100
@@ -1,7 +1,7 @@
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
-from base64 import decodestring
+from base64 import b64decode
import os
import re
from warnings import warn
@@ -131,13 +131,15 @@
self._append_html(self.output_sep2, True)
elif 'image/png' in data:
self._pre_image_append(msg, prompt_number)
- png = decodestring(data['image/png'].encode('ascii'))
- self._append_png(png, True, metadata=metadata.get('image/png',
None))
+ png = b64decode(data['image/png'].encode('ascii'))
+ self._append_png(png, True, metadata=metadata.get('image/png',
+ None))
self._append_html(self.output_sep2, True)
elif 'image/jpeg' in data and self._jpg_supported:
self._pre_image_append(msg, prompt_number)
- jpg = decodestring(data['image/jpeg'].encode('ascii'))
- self._append_jpg(jpg, True,
metadata=metadata.get('image/jpeg', None))
+ jpg = b64decode(data['image/jpeg'].encode('ascii'))
+ self._append_jpg(jpg, True, metadata=metadata.get('image/jpeg',
+ None))
self._append_html(self.output_sep2, True)
elif 'text/latex' in data:
self._pre_image_append(msg, prompt_number)
@@ -166,10 +168,10 @@
elif 'image/png' in data:
# PNG data is base64 encoded as it passes over the network
# in a JSON structure so we decode it.
- png = decodestring(data['image/png'].encode('ascii'))
+ png = b64decode(data['image/png'].encode('ascii'))
self._append_png(png, True, metadata=metadata.get('image/png',
None))
elif 'image/jpeg' in data and self._jpg_supported:
- jpg = decodestring(data['image/jpeg'].encode('ascii'))
+ jpg = b64decode(data['image/jpeg'].encode('ascii'))
self._append_jpg(jpg, True,
metadata=metadata.get('image/jpeg', None))
elif 'text/latex' in data and latex_to_png:
try:
@@ -406,10 +408,11 @@
image.save(filename, format)
-# clobber RichIPythonWidget above:
+# Clobber RichIPythonWidget above:
class RichIPythonWidget(RichJupyterWidget):
- """Deprecated class. Use RichJupyterWidget"""
+ """Deprecated class. Use RichJupyterWidget."""
def __init__(self, *a, **kw):
- warn("RichIPythonWidget is deprecated, use RichJupyterWidget")
+ warn("RichIPythonWidget is deprecated, use RichJupyterWidget",
+ DeprecationWarning)
super(RichIPythonWidget, self).__init__(*a, **kw)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/tests/__init__.py
new/qtconsole-4.4.3/qtconsole/tests/__init__.py
--- old/qtconsole-4.4.1/qtconsole/tests/__init__.py 2015-12-20
15:40:14.000000000 +0100
+++ new/qtconsole-4.4.3/qtconsole/tests/__init__.py 2018-11-10
04:10:20.000000000 +0100
@@ -0,0 +1,6 @@
+
+import os
+import sys
+
+no_display = (sys.platform not in ('darwin', 'win32') and
+ os.environ.get('DISPLAY', '') == '')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/tests/test_app.py
new/qtconsole-4.4.3/qtconsole/tests/test_app.py
--- old/qtconsole-4.4.1/qtconsole/tests/test_app.py 2016-02-01
15:39:32.000000000 +0100
+++ new/qtconsole-4.4.3/qtconsole/tests/test_app.py 2018-11-10
04:10:20.000000000 +0100
@@ -4,27 +4,28 @@
# Distributed under the terms of the Modified BSD License.
import os
-import shutil
import sys
-import tempfile
from subprocess import check_output
+from jupyter_core import paths
+import pytest
from traitlets.tests.utils import check_help_all_output
-from ipython_genutils.testing.decorators import skip_if_no_x11
-@skip_if_no_x11
+from . import no_display
+
+
[email protected](no_display, reason="Doesn't work without a display")
def test_help_output():
"""jupyter qtconsole --help-all works"""
check_help_all_output('qtconsole')
-@skip_if_no_x11
+
[email protected](no_display, reason="Doesn't work without a display")
[email protected](os.environ.get('CI', None) is None,
+ reason="Doesn't work outside of our CIs")
def test_generate_config():
"""jupyter qtconsole --generate-config"""
- td = tempfile.mkdtemp()
- try:
- check_output([sys.executable, '-m', 'qtconsole', '--generate-config'],
- env={'JUPYTER_CONFIG_DIR': td},
- )
- assert os.path.isfile(os.path.join(td, 'jupyter_qtconsole_config.py'))
- finally:
- shutil.rmtree(td)
+ config_dir = paths.jupyter_config_dir()
+ check_output([sys.executable, '-m', 'qtconsole', '--generate-config'])
+ assert os.path.isfile(os.path.join(config_dir,
+ 'jupyter_qtconsole_config.py'))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-4.4.1/qtconsole/tests/test_completion_widget.py
new/qtconsole-4.4.3/qtconsole/tests/test_completion_widget.py
--- old/qtconsole-4.4.1/qtconsole/tests/test_completion_widget.py
2017-03-29 14:34:25.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/tests/test_completion_widget.py
2018-11-10 04:10:20.000000000 +0100
@@ -1,18 +1,19 @@
# -*- coding: utf-8 -*-
import unittest
+import pytest
+
from qtconsole.qt import QtCore, QtGui
from qtconsole.qt_loaders import load_qtest
-
from qtconsole.console_widget import ConsoleWidget
from qtconsole.completion_widget import CompletionWidget
-import ipython_genutils.testing.decorators as dec
+from . import no_display
-QTest = load_qtest()
-setup = dec.skip_file_no_x11(__name__)
+QTest = load_qtest()
[email protected](no_display, reason="Doesn't work without a display")
class TestCompletionWidget(unittest.TestCase):
@classmethod
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-4.4.1/qtconsole/tests/test_console_widget.py
new/qtconsole-4.4.3/qtconsole/tests/test_console_widget.py
--- old/qtconsole-4.4.1/qtconsole/tests/test_console_widget.py 2018-08-12
00:38:18.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/tests/test_console_widget.py 2018-11-10
19:18:36.000000000 +0100
@@ -1,14 +1,22 @@
+import sys
import unittest
+import pytest
+if sys.version[0] == '2': # Python 2
+ from IPython.core.inputsplitter import InputSplitter as TransformerManager
+else:
+ from IPython.core.inputtransformer2 import TransformerManager
+
from qtconsole.qt import QtCore, QtGui
from qtconsole.qt_loaders import load_qtest
-
from qtconsole.console_widget import ConsoleWidget
-import ipython_genutils.testing.decorators as dec
+from . import no_display
+
-setup = dec.skip_file_no_x11(__name__)
QTest = load_qtest()
+
[email protected](no_display, reason="Doesn't work without a display")
class TestConsoleWidget(unittest.TestCase):
@classmethod
@@ -376,3 +384,33 @@
dict(parent_header=dict(msg_id=msg_id),
content=dict(status="complete", indent="###")))
self.assertEqual(calls, [])
+
+ def test_complete_python(self):
+ """Test that is_complete is working correctly for Python."""
+ # Kernel client to test the responses of is_complete
+ class TestIPyKernelClient(object):
+ def is_complete(self, source):
+ tm = TransformerManager()
+ check_complete = tm.check_complete(source)
+ responses.append(check_complete)
+
+ # Initialize widget
+ responses = []
+ w = ConsoleWidget()
+ w._append_plain_text('Header\n')
+ w._prompt = 'prompt>'
+ w._show_prompt()
+ w.kernel_client = TestIPyKernelClient()
+
+ # Execute incomplete statement inside a block
+ code = '\n'.join(["if True:", " a = 1"])
+ w._set_input_buffer(code)
+ w.execute(interactive=True)
+ assert responses == [('incomplete', 4)]
+
+ # Execute complete statement inside a block
+ responses = []
+ code = '\n'.join(["if True:", " a = 1\n\n"])
+ w._set_input_buffer(code)
+ w.execute(interactive=True)
+ assert responses == [('complete', None)]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-4.4.1/qtconsole/tests/test_frontend_widget.py
new/qtconsole-4.4.3/qtconsole/tests/test_frontend_widget.py
--- old/qtconsole-4.4.1/qtconsole/tests/test_frontend_widget.py 2017-09-21
01:14:25.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/tests/test_frontend_widget.py 2018-11-10
04:10:20.000000000 +0100
@@ -1,14 +1,17 @@
import unittest
+import pytest
+
from qtconsole.qt import QtGui
from qtconsole.qt_loaders import load_qtest
from qtconsole.frontend_widget import FrontendWidget
-import ipython_genutils.testing.decorators as dec
+from . import no_display
+
-setup = dec.skip_file_no_x11(__name__)
QTest = load_qtest()
[email protected](no_display, reason="Doesn't work without a display")
class TestFrontendWidget(unittest.TestCase):
@classmethod
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/qtconsole-4.4.1/qtconsole/tests/test_jupyter_widget.py
new/qtconsole-4.4.3/qtconsole/tests/test_jupyter_widget.py
--- old/qtconsole-4.4.1/qtconsole/tests/test_jupyter_widget.py 2017-09-21
01:14:25.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/tests/test_jupyter_widget.py 2018-11-10
04:10:20.000000000 +0100
@@ -1,15 +1,18 @@
import unittest
+import pytest
+
from qtconsole.qt import QtGui
from qtconsole.qt_loaders import load_qtest
from qtconsole.client import QtKernelClient
from qtconsole.jupyter_widget import JupyterWidget
-import ipython_genutils.testing.decorators as dec
+from . import no_display
+
-setup = dec.skip_file_no_x11(__name__)
QTest = load_qtest()
[email protected](no_display, reason="Doesn't work without a display")
class TestJupyterWidget(unittest.TestCase):
@classmethod
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/tests/test_kill_ring.py
new/qtconsole-4.4.3/qtconsole/tests/test_kill_ring.py
--- old/qtconsole-4.4.1/qtconsole/tests/test_kill_ring.py 2018-08-12
00:38:18.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/tests/test_kill_ring.py 2018-11-10
04:10:20.000000000 +0100
@@ -1,12 +1,13 @@
import unittest
-from qtconsole.qt import QtGui
+import pytest
+from qtconsole.qt import QtGui
from qtconsole.kill_ring import KillRing, QtKillRing
-import ipython_genutils.testing.decorators as dec
+from . import no_display
-setup = dec.skip_file_no_x11(__name__)
[email protected](no_display, reason="Doesn't work without a display")
class TestKillRing(unittest.TestCase):
@classmethod
@@ -80,5 +81,5 @@
if __name__ == '__main__':
- import nose
- nose.main()
+ import pytest
+ pytest.main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/qtconsole/tests/test_styles.py
new/qtconsole-4.4.3/qtconsole/tests/test_styles.py
--- old/qtconsole-4.4.1/qtconsole/tests/test_styles.py 2017-03-29
14:34:25.000000000 +0200
+++ new/qtconsole-4.4.3/qtconsole/tests/test_styles.py 2018-11-10
04:10:20.000000000 +0100
@@ -1,4 +1,5 @@
import unittest
+
from qtconsole.styles import dark_color, dark_style
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/qtconsole-4.4.1/setup.py new/qtconsole-4.4.3/setup.py
--- old/qtconsole-4.4.1/setup.py 2017-01-08 23:13:40.000000000 +0100
+++ new/qtconsole-4.4.3/setup.py 2018-11-10 04:10:20.000000000 +0100
@@ -92,7 +92,7 @@
]
extras_require = setuptools_args['extras_require'] = {
- 'test': ['nose'],
+ 'test': ['pytest'],
'test:python_version=="2.7"': ['mock'],
'doc': 'Sphinx>=1.3',
}
++++++ qtconsole.pdf ++++++
(binary differes)
++++++ qtconsole.zip ++++++
Binary files /var/tmp/diff_new_pack.k7DO66/_old and
/var/tmp/diff_new_pack.k7DO66/_new differ