Hello community, here is the log from the commit of package python-spyder-kernels for openSUSE:Factory checked in at 2019-07-08 15:11:33 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-spyder-kernels (Old) and /work/SRC/openSUSE:Factory/.python-spyder-kernels.new.4615 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-spyder-kernels" Mon Jul 8 15:11:33 2019 rev:7 rq:713834 version:0.5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-spyder-kernels/python-spyder-kernels.changes 2019-06-04 12:12:43.903814086 +0200 +++ /work/SRC/openSUSE:Factory/.python-spyder-kernels.new.4615/python-spyder-kernels.changes 2019-07-08 15:11:33.835376112 +0200 @@ -1,0 +2,18 @@ +Sun Jun 30 10:12:35 UTC 2019 - Sebastian Wagner <sebix+novell.com@sebix.at> + +- update to version 0.5.0: + - New features: + - Set Matplotlib backend to inline for kernels started in a terminal. + - Handle option sent from Spyder to show/hide cmd windows generated + by the subprocess module. + - Issues Closed: + - [Issue 108](https://github.com/spyder-ide/spyder-kernels/issues/108) - Set matplotlib backend to inline by default on starting a new kernel ([PR 110](https://github.com/spyder-ide/spyder-kernels/pull/110)) + - In this release 1 issue was closed. + - Pull Requests Merged: + - [PR 110](https://github.com/spyder-ide/spyder-kernels/pull/110) - PR: Set Matplotlib backend to inline for kernels started outside Spyder ([108](https://github.com/spyder-ide/spyder-kernels/issues/108)) + - [PR 107](https://github.com/spyder-ide/spyder-kernels/pull/107) - PR: Use Readme.md for long description in PyPi + - [PR 104](https://github.com/spyder-ide/spyder-kernels/pull/104) - PR: Handle option to show/hide cmd windows generated by the subprocess module + - In this release 3 pull requests were closed. +- remove 818a6b5f619ef917f4c3413c9522212cd9b2fdfd.patch, included upstream + +------------------------------------------------------------------- Old: ---- 818a6b5f619ef917f4c3413c9522212cd9b2fdfd.patch python-spyder-kernels-0.4.4.tar.gz New: ---- python-spyder-kernels-0.5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-spyder-kernels.spec ++++++ --- /var/tmp/diff_new_pack.JuMxUZ/_old 2019-07-08 15:11:34.631376876 +0200 +++ /var/tmp/diff_new_pack.JuMxUZ/_new 2019-07-08 15:11:34.635376879 +0200 @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-spyder-kernels -Version: 0.4.4 +Version: 0.5.0 Release: 0 Summary: Jupyter kernels for Spyder's console License: MIT @@ -26,8 +26,6 @@ Url: https://github.com/spyder-ide/spyder-kernels # PyPI tarballs do not include the tests: https://github.com/spyder-ide/spyder-kernels/issues/66 Source: https://github.com/spyder-ide/spyder-kernels/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz -# PATCH-FIX-UPSTREAM 818a6b5f619ef917f4c3413c9522212cd9b2fdfd.patch -Patch0: https://github.com/spyder-ide/spyder-kernels/commit/818a6b5f619ef917f4c3413c... BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -35,6 +33,7 @@ BuildRequires: %{python_module cloudpickle} BuildRequires: %{python_module ipykernel >= 4.8.2} BuildRequires: %{python_module jupyter_client >= 5.2.3} +BuildRequires: %{python_module matplotlib} BuildRequires: %{python_module mock} BuildRequires: %{python_module pandas} BuildRequires: %{python_module pytest} @@ -66,7 +65,6 @@ %prep %setup -q -n spyder-kernels-%{version} -%patch0 -p1 %build %python_build ++++++ python-spyder-kernels-0.4.4.tar.gz -> python-spyder-kernels-0.5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/.circleci/install.sh new/spyder-kernels-0.5.0/.circleci/install.sh --- old/spyder-kernels-0.4.4/.circleci/install.sh 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/.circleci/install.sh 2019-06-23 19:33:17.000000000 +0200 @@ -2,7 +2,7 @@ export TRAVIS_OS_NAME="linux" export CONDA_DEPENDENCIES_FLAGS="--quiet" -export CONDA_DEPENDENCIES="ipykernel cloudpickle nomkl numpy pandas scipy pytest pytest-cov mock cython" +export CONDA_DEPENDENCIES="ipykernel cloudpickle nomkl numpy pandas scipy pytest pytest-cov mock cython matplotlib" export PIP_DEPENDENCIES="codecov wurlitzer" echo -e "PYTHON = $PYTHON_VERSION \n============" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/CHANGELOG.md new/spyder-kernels-0.5.0/CHANGELOG.md --- old/spyder-kernels-0.4.4/CHANGELOG.md 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/CHANGELOG.md 2019-06-23 19:33:17.000000000 +0200 @@ -1,5 +1,29 @@ # History of changes +## Version 0.5.0 (2019-06-23) + +### New features + +* Set Matplotlib backend to inline for kernels started in a terminal. +* Handle option sent from Spyder to show/hide cmd windows generated + by the subprocess module. + +### Issues Closed + +* [Issue 108](https://github.com/spyder-ide/spyder-kernels/issues/108) - Set matplotlib backend to inline by default on starting a new kernel ([PR 110](https://github.com/spyder-ide/spyder-kernels/pull/110)) + +In this release 1 issue was closed. + +### Pull Requests Merged + +* [PR 110](https://github.com/spyder-ide/spyder-kernels/pull/110) - PR: Set Matplotlib backend to inline for kernels started outside Spyder ([108](https://github.com/spyder-ide/spyder-kernels/issues/108)) +* [PR 107](https://github.com/spyder-ide/spyder-kernels/pull/107) - PR: Use Readme.md for long description in PyPi +* [PR 104](https://github.com/spyder-ide/spyder-kernels/pull/104) - PR: Handle option to show/hide cmd windows generated by the subprocess module + +In this release 3 pull requests were closed. + +---- + ## Version 0.4.4 (2019-04-08) ### Issues Closed diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/README.md new/spyder-kernels-0.5.0/README.md --- old/spyder-kernels-0.4.4/README.md 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/README.md 2019-06-23 19:33:17.000000000 +0200 @@ -4,7 +4,18 @@ [![AppVeyor](https://ci.appveyor.com/api/projects/status/pd0etf64xyiyd3qb/branch/master?svg=true)](https://ci.appveyor.com/project/spyder-ide/spyder-kernels/branch/master) [![codecov](https://codecov.io/gh/spyder-ide/spyder-kernels/branch/master/graph/badge.svg)](https://codecov.io/gh/spyder-ide/spyder-kernels) -Package that provides the kernels used by Spyder on its IPython console. +Package that provides Jupyter kernels for use with the consoles of Spyder, the +Scientific Python Development Environment. + +These kernels can launched either through Spyder itself or in an independent +Python session, and allow for interactive or file-based execution of Python +code inside Spyder. + +To learn about creating, connecting to and using these kernels with the Spyder +console, please read our [documentation](https://docs.spyder-ide.org/ipythonconsole.html). + +For advice on managing packages and environments with `spyder-kernels`, please visit +our [wiki](https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environm...). ## Installation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/appveyor.yml new/spyder-kernels-0.5.0/appveyor.yml --- old/spyder-kernels-0.4.4/appveyor.yml 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/appveyor.yml 2019-06-23 19:33:17.000000000 +0200 @@ -10,7 +10,7 @@ PIP_DEPENDENCIES_FLAGS: "-q" CONDA_DEPENDENCIES_FLAGS: "--quiet" CONDA_DEPENDENCIES: > - ipykernel cloudpickle numpy pandas scipy pytest pytest-cov mock cython + ipykernel cloudpickle numpy pandas scipy pytest pytest-cov mock cython matplotlib matrix: - PYTHON_VERSION: "2.7" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/setup.py new/spyder-kernels-0.5.0/setup.py --- old/spyder-kernels-0.4.4/setup.py 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/setup.py 2019-06-23 19:33:17.000000000 +0200 @@ -6,34 +6,20 @@ # (see spyder_kernels/__init__.py for details) # ----------------------------------------------------------------------------- - -""" -Spyder Kernels -============== - -Provides Jupyter kernels for use with the consoles of Spyder, the Scientific -Python Development Environment. These can launched either through Spyder itself -or in an independent Python session, and allow for interactive or file-based -execution of Python code in different environments, all inside the IDE. -For more on Spyder, visit https://www.spyder-ide.org/ - -To learn about creating, connecting to and using Spyder's consoles, read: -https://docs.spyder-ide.org/ipythonconsole.html - -For advice on managing packages and environments with Spyder-Kernels, see: -https://github.com/spyder-ide/spyder/wiki/Working-with-packages-and-environm... - -""" +"""Jupyter Kernels for the Spyder consoles.""" # Standard library imports import ast +import io import os # Third party imports from setuptools import find_packages, setup HERE = os.path.abspath(os.path.dirname(__file__)) -DOCLINES = __doc__.split('\n') + +with io.open('README.md', encoding='utf-8') as f: + LONG_DESCRIPTION = f.read() def get_version(module='spyder_kernels'): @@ -66,7 +52,8 @@ author='Spyder Development Team', author_email="spyderlib@googlegroups.com", description="Jupyter kernels for Spyder's console", - long_description="\n".join(DOCLINES[4:]), + long_description=LONG_DESCRIPTION, + long_description_content_type='text/markdown', packages=find_packages(exclude=['docs']), install_requires=REQUIREMENTS, include_package_data=True, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/spyder_kernels/_version.py new/spyder-kernels-0.5.0/spyder_kernels/_version.py --- old/spyder-kernels-0.4.4/spyder_kernels/_version.py 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/spyder_kernels/_version.py 2019-06-23 19:33:17.000000000 +0200 @@ -8,5 +8,5 @@ """Version File.""" -VERSION_INFO = (0, 4, 4) +VERSION_INFO = (0, 5, 0) __version__ = '.'.join(map(str, VERSION_INFO)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/spyder_kernels/console/kernel.py new/spyder-kernels-0.5.0/spyder_kernels/console/kernel.py --- old/spyder-kernels-0.4.4/spyder_kernels/console/kernel.py 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/spyder_kernels/console/kernel.py 2019-06-23 19:33:17.000000000 +0200 @@ -458,15 +458,17 @@ Set a backend for Matplotlib. backend: A parameter that can be passed to %matplotlib - (e.g. inline or tk). + (e.g. 'inline' or 'tk'). """ import traceback from IPython.core.getipython import get_ipython - generic_error = ("\n" - "NOTE: The following error appeared when setting " - "your Matplotlib backend\n\n" - "{0}") + generic_error = ( + "\n" + "="*73 + "\n" + "NOTE: The following error appeared when setting " + "your Matplotlib backend!!\n" + "="*73 + "\n\n" + "{0}" + ) magic = 'pylab' if pylab else 'matplotlib' @@ -479,11 +481,17 @@ if "GUI eventloops" in str(err): import matplotlib previous_backend = matplotlib.get_backend() - error = ("\n" - "NOTE: Spyder *can't* set your selected Matplotlib " - "backend because there is a previous backend already " - "in use.\n\n" - "Your backend will be {0}".format(previous_backend)) + if not backend in previous_backend.lower(): + # Only inform about an error if the user selected backend + # and the one set by Matplotlib are different. Else this + # message is very confusing. + error = ( + "\n" + "NOTE: Spyder *can't* set your selected Matplotlib " + "backend because there is a previous backend already " + "in use.\n\n" + "Your backend will be {0}".format(previous_backend) + ) del matplotlib # This covers other RuntimeError's else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/spyder_kernels/console/start.py new/spyder-kernels-0.5.0/spyder_kernels/console/start.py --- old/spyder-kernels-0.4.4/spyder_kernels/console/start.py 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/spyder_kernels/console/start.py 2019-06-23 19:33:17.000000000 +0200 @@ -145,12 +145,12 @@ # Pylab configuration mpl_backend = None - pylab_o = os.environ.get('SPY_PYLAB_O') - - if pylab_o == 'True' and is_module_installed('matplotlib'): - # Set Matplotlib backend + if is_module_installed('matplotlib'): + # Set Matplotlib backend with Spyder options + pylab_o = os.environ.get('SPY_PYLAB_O') backend_o = os.environ.get('SPY_BACKEND_O') - if backend_o is not None: + if pylab_o == 'True' and backend_o is not None: + # Select the automatic backend if backend_o == '1': if is_module_installed('PyQt5'): auto_backend = 'qt5' @@ -162,6 +162,8 @@ auto_backend = 'inline' else: auto_backend = '' + + # Mapping of Spyder options to backends backends = {'0': 'inline', '1': auto_backend, '2': 'qt5', @@ -171,14 +173,9 @@ '6': 'gtk', '7': 'wx', '8': 'tk'} - mpl_backend = backends[backend_o] - # Automatically load Pylab and Numpy, or only set Matplotlib - # backend - autoload_pylab_o = os.environ.get('SPY_AUTOLOAD_PYLAB_O') == 'True' - command = "get_ipython().kernel._set_mpl_backend('{0}', {1})" - spy_cfg.IPKernelApp.exec_lines.append( - command.format(mpl_backend, autoload_pylab_o)) + # Select backend + mpl_backend = backends[backend_o] # Inline backend configuration if mpl_backend == 'inline': @@ -206,6 +203,17 @@ bbox_inches = 'tight' if bbox_inches_o == 'True' else None spy_cfg.InlineBackend.print_figure_kwargs.update( {'bbox_inches': bbox_inches}) + else: + # Set Matplotlib backend to inline for external kernels. + # Fixes issue 108 + mpl_backend = 'inline' + + # Automatically load Pylab and Numpy, or only set Matplotlib + # backend + autoload_pylab_o = os.environ.get('SPY_AUTOLOAD_PYLAB_O') == 'True' + command = "get_ipython().kernel._set_mpl_backend('{0}', {1})" + spy_cfg.IPKernelApp.exec_lines.append( + command.format(mpl_backend, autoload_pylab_o)) # Enable Cython magic run_cython = os.environ.get('SPY_RUN_CYTHON') == 'True' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/spyder_kernels/console/tests/test_console_kernel.py new/spyder-kernels-0.5.0/spyder_kernels/console/tests/test_console_kernel.py --- old/spyder-kernels-0.4.4/spyder_kernels/console/tests/test_console_kernel.py 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/spyder_kernels/console/tests/test_console_kernel.py 2019-06-23 19:33:17.000000000 +0200 @@ -436,5 +436,25 @@ assert content['found'] +def test_matplotlib_inline(kernel): + """Test that the default backend for our kernels is 'inline'.""" + # Command to start the kernel + cmd = "from spyder_kernels.console import start; start.main()" + + with setup_kernel(cmd) as client: + # Get current backend + code = "import matplotlib; backend = matplotlib.get_backend()" + client.execute(code, user_expressions={'output': 'backend'}) + reply = client.get_shell_msg(block=True, timeout=TIMEOUT) + + # Transform value obtained through user_expressions + user_expressions = reply['content']['user_expressions'] + str_value = user_expressions['output']['data']['text/plain'] + value = ast.literal_eval(str_value) + + # Assert backend is inline + assert 'inline' in value + + if __name__ == "__main__": pytest.main() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/spyder_kernels/customize/spydercustomize.py new/spyder-kernels-0.5.0/spyder_kernels/customize/spydercustomize.py --- old/spyder-kernels-0.4.4/spyder_kernels/customize/spydercustomize.py 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/spyder_kernels/customize/spydercustomize.py 2019-06-23 19:33:17.000000000 +0200 @@ -44,7 +44,7 @@ # Main constants #============================================================================== IS_EXT_INTERPRETER = os.environ.get('SPY_EXTERNAL_INTERPRETER') == "True" - +HIDE_CMD_WINDOWS = os.environ.get('SPY_HIDE_CMD') == "True" #============================================================================== # Important Note: @@ -133,7 +133,7 @@ # Prevent subprocess.Popen calls to create visible console windows on Windows. # See issue #4932 #============================================================================== -if os.name == 'nt': +if os.name == 'nt' and HIDE_CMD_WINDOWS: import subprocess creation_flag = 0x08000000 # CREATE_NO_WINDOW diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/spyder-kernels-0.4.4/spyder_kernels/utils/tests/test_iofuncs.py new/spyder-kernels-0.5.0/spyder_kernels/utils/tests/test_iofuncs.py --- old/spyder-kernels-0.4.4/spyder_kernels/utils/tests/test_iofuncs.py 2019-04-08 11:49:16.000000000 +0200 +++ new/spyder-kernels-0.5.0/spyder_kernels/utils/tests/test_iofuncs.py 2019-06-23 19:33:17.000000000 +0200 @@ -107,7 +107,7 @@ like other structs, matrices and Cell Arrays. """ path = os.path.join(LOCATION, 'numpy_data.npz') - file_s = np.load(path) + file_s = np.load(path, allow_pickle=True) A = file_s['A'].item() B = file_s['B'] C = file_s['C']