Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package jupyter-matlab-kernel for 
openSUSE:Factory checked in at 2023-01-23 18:31:38
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/jupyter-matlab-kernel (Old)
 and      /work/SRC/openSUSE:Factory/.jupyter-matlab-kernel.new.32243 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "jupyter-matlab-kernel"

Mon Jan 23 18:31:38 2023 rev:5 rq:1060277 version:0.17.1

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/jupyter-matlab-kernel/jupyter-matlab-kernel.changes  
    2021-03-30 20:58:55.736620950 +0200
+++ 
/work/SRC/openSUSE:Factory/.jupyter-matlab-kernel.new.32243/jupyter-matlab-kernel.changes
   2023-01-23 18:31:59.508072480 +0100
@@ -1,0 +2,9 @@
+Sun Jan 22 14:56:13 UTC 2023 - Ben Greiner <[email protected]>
+
+- Update to 0.17.1
+  * Stop using sys.executable when building wheels by @RibomBalt in
+    #161
+  * Add a kernel that priorly links to a existing matlab engine
+    (besides the original one) by @RibomBalt in #159
+
+-------------------------------------------------------------------

Old:
----
  matlab_kernel-0.16.11.tar.gz

New:
----
  matlab_kernel-0.17.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ jupyter-matlab-kernel.spec ++++++
--- /var/tmp/diff_new_pack.oku71r/_old  2023-01-23 18:32:00.084076035 +0100
+++ /var/tmp/diff_new_pack.oku71r/_new  2023-01-23 18:32:00.088076060 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package jupyter-matlab-kernel
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -16,9 +16,8 @@
 #
 
 
-%bcond_without  test
 Name:           jupyter-matlab-kernel
-Version:        0.16.11
+Version:        0.17.1
 Release:        0
 Summary:        Matlab kernel for Jupyter
 License:        BSD-3-Clause AND MIT
@@ -26,21 +25,20 @@
 URL:            https://github.com/Calysto/matlab_kernel
 Source:         
https://files.pythonhosted.org/packages/source/m/matlab-kernel/matlab_kernel-%{version}.tar.gz
 BuildRequires:  fdupes
-BuildRequires:  jupyter-jupyter_client >= 4.4.0
-BuildRequires:  jupyter-jupyter_core-filesystem
+BuildRequires:  jupyter-rpm-macros
 BuildRequires:  python-rpm-macros
-BuildRequires:  python3-certifi
+BuildRequires:  python3-ipython >= 4.0.0
+BuildRequires:  python3-jupyter_client >= 4.4.0
+BuildRequires:  python3-metakernel >= 0.23
+BuildRequires:  python3-pip
 BuildRequires:  python3-setuptools
-BuildRequires:  python3-wurlitzer
-Requires:       jupyter-ipython >= 4.0.0
-Requires:       jupyter-jupyter_client >= 4.4.0
-Requires:       jupyter-metakernel >= 0.20.8
-Requires:       python3-wurlitzer
-Suggests:       python3-backports.tempfile
-Suggests:       python3-certifi
-Provides:       python3-jupyter_matlab_kernel = %{version}
-Obsoletes:      python3-jupyter_matlab_kernel < %{version}
-Provides:       python3-matlab-kernel = %{version}
+BuildRequires:  python3-wheel
+Requires:       python3-ipython >= 4.0.0
+Requires:       python3-jupyter_client >= 4.4.0
+Requires:       python3-metakernel >= 0.23
+Provides:       python3-jupyter_matlab_kernel = %{version}-%{release}
+Obsoletes:      python3-jupyter_matlab_kernel < %{version}-%{release}
+Provides:       python3-matlab-kernel = %{version}-%{release}
 BuildArch:      noarch
 
 %description
@@ -51,22 +49,23 @@
 %setup -q -n matlab_kernel-%{version}
 
 %build
-%python3_build
+%python3_pyproject_wheel
 
 %install
-%python3_install
+%python3_pyproject_install
 %fdupes %{buildroot}%{python3_sitelib}
 %fdupes %{buildroot}%{_jupyter_kernel_dir}
 
 # Tests require MATLAB installed
 # %%check
-# %%pytest
+# Use from the github repo: test_matlab_kernel.py
 
 %files
 %license LICENSE.txt
 %doc README.rst
-%{python3_sitelib}/matlab_kernel-%{version}-py*.egg-info
-%{python3_sitelib}/matlab_kernel/
+%{python3_sitelib}/matlab_kernel-%{version}.dist-info
+%{python3_sitelib}/matlab_kernel
 %{_jupyter_kernel_dir}/matlab
+%{_jupyter_kernel_dir}/matlab_connect
 
 %changelog

++++++ matlab_kernel-0.16.11.tar.gz -> matlab_kernel-0.17.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matlab_kernel-0.16.11/MANIFEST.in 
new/matlab_kernel-0.17.1/MANIFEST.in
--- old/matlab_kernel-0.16.11/MANIFEST.in       2020-11-02 19:57:07.000000000 
+0100
+++ new/matlab_kernel-0.17.1/MANIFEST.in        2022-05-09 12:18:00.000000000 
+0200
@@ -1,4 +1,4 @@
 include versioneer.py
 include matlab_kernel/_version.py
-include matlab_kernel/kernel.json
+include matlab_kernel/kernel_template.json
 recursive-include matlab_kernel *.png
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matlab_kernel-0.16.11/PKG-INFO 
new/matlab_kernel-0.17.1/PKG-INFO
--- old/matlab_kernel-0.16.11/PKG-INFO  2020-11-09 21:41:42.153092000 +0100
+++ new/matlab_kernel-0.17.1/PKG-INFO   2022-05-09 12:20:58.245650800 +0200
@@ -1,120 +1,10 @@
 Metadata-Version: 2.1
 Name: matlab_kernel
-Version: 0.16.11
+Version: 0.17.1
 Summary: UNKNOWN
 Home-page: https://github.com/Calysto/matlab_kernel
 Author: Steven Silvester, Antony Lee
 License: BSD
-Description: 
-        A Matlab kernel for Jupyter
-        ===========================
-        
-        Prerequisites
-        -------------
-        Install `Jupyter Notebook 
<http://jupyter.readthedocs.org/en/latest/install.html>`_ and the
-        `Matlab engine for Python 
<https://www.mathworks.com/help/matlab/matlab-engine-for-python.html>`_.
-        
-        Installation
-        ------------
-        
-        Install using::
-        
-            $ pip install matlab_kernel
-        
-        or ``pip install git+https://github.com/Calysto/matlab_kernel`` for 
the dev version.
-        
-        To use the kernel, run one of::
-        
-            $ jupyter notebook
-            # In the notebook interface, select Matlab from the 'New' menu
-            $ jupyter qtconsole --kernel matlab
-            $ jupyter console --kernel matlab
-        
-        To remove from kernel listings::
-        
-            $ jupyter kernelspec remove matlab
-        
-        
-        Configuration
-        -------------
-        The kernel can be configured by adding an ``matlab_kernel_config.py`` 
file to the
-        ``jupyter`` config path.  The ``MatlabKernel`` class offers 
``plot_settings`` as a configurable traits.
-        The available plot settings are:
-        'format', 'backend', 'width', 'height', and 'resolution'.
-        
-        .. code:: bash
-        
-            cat ~/.jupyter/matlab_kernel_config.py
-            c.MatlabKernel.plot_settings = dict(format='svg')
-        
-        
-        Troubleshooting
-        ---------------
-        
-        Kernel Times Out While Starting
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        If the kernel is not starting, try running the following from a 
terminal.
-        
-        .. code:: shell
-        
-          python -m matlab_kernel.check
-        
-        Please include that output if opening an issue.
-        
-        
-        Kernel is Not Listed
-        ~~~~~~~~~~~~~~~~~~~~
-        If the kernel is not listed as an available kernel, first try the 
following command:
-        
-        .. code:: shell
-        
-            python -m matlab_kernel install --user
-        
-        If the kernel is still not listed, verify that the following point to 
the same
-        version of python:
-        
-        .. code:: shell
-        
-            which python  # use "where" if using cmd.exe
-            which jupyter
-        
-        
-        Additional information
-        ----------------------
-        
-        The Matlab kernel is based on `MetaKernel 
<http://pypi.python.org/pypi/metakernel>`_,
-        which means it features a standard set of magics.  For a full list of 
magics,
-        run ``%lsmagic`` in a cell.
-        
-        A sample notebook is available online_.
-        
-        A note about plotting.  After each call to Matlab, we ask Matlab to 
save any
-        open figures to image files whose format and resolution are defined 
using the
-        ``%plot`` magic.  The resulting image is shown inline in the notebook. 
 You can
-        use ``%plot native`` to raise normal Matlab windows instead.
-        
-        
-        Advanced Installation Notes
-        ---------------------------
-        
-        We automatically install a Jupyter kernelspec when installing the 
python package. This location can be found using ``jupyter kernelspec list``. 
If the default location is not desired, you can remove the directory for the 
octave kernel, and install using ``python -m matlab_kernel install``. See 
``python -m matlab_kernel install --help`` for available options.
-        
-        It has been reported that Matlab version 2016b works fine. However, 
Matlab 2014b does not work with Python 3.5.
-        
-        .. _online: 
http://nbviewer.ipython.org/github/Calysto/matlab_kernel/blob/master/matlab_kernel.ipynb
-        
-        
-        Development
-        ~~~~~~~~~~~
-        
-        Install the package locally::
-        
-            $ pip install -e .
-            $ python -m matlab_kernel install
-        
-        As you make changes, test them in a notebook (restart the kernel 
between changes).
-        
-        
 Platform: UNKNOWN
 Classifier: Framework :: IPython
 Classifier: License :: OSI Approved :: BSD License
@@ -125,3 +15,116 @@
 Requires: jupyter_client (>=4.4.0)
 Requires: ipython (>=4.0.0)
 Description-Content-Type: text/x-rst
+License-File: LICENSE.txt
+
+
+A Matlab kernel for Jupyter
+===========================
+
+Prerequisites
+-------------
+Install `Jupyter Notebook 
<http://jupyter.readthedocs.org/en/latest/install.html>`_ and the
+`Matlab engine for Python 
<https://www.mathworks.com/help/matlab/matlab-engine-for-python.html>`_.
+
+Installation
+------------
+
+Install using::
+
+    $ pip install matlab_kernel
+
+or ``pip install git+https://github.com/Calysto/matlab_kernel`` for the dev 
version.
+
+To use the kernel, run one of::
+
+    $ jupyter notebook
+    # In the notebook interface, select Matlab from the 'New' menu
+    $ jupyter qtconsole --kernel matlab
+    $ jupyter console --kernel matlab
+
+To remove from kernel listings::
+
+    $ jupyter kernelspec remove matlab
+
+
+Configuration
+-------------
+The kernel can be configured by adding an ``matlab_kernel_config.py`` file to 
the
+``jupyter`` config path.  The ``MatlabKernel`` class offers ``plot_settings`` 
as a configurable traits.
+The available plot settings are:
+'format', 'backend', 'width', 'height', and 'resolution'.
+
+.. code:: bash
+
+    cat ~/.jupyter/matlab_kernel_config.py
+    c.MatlabKernel.plot_settings = dict(format='svg')
+
+
+Troubleshooting
+---------------
+
+Kernel Times Out While Starting
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+If the kernel is not starting, try running the following from a terminal.
+
+.. code:: shell
+
+  python -m matlab_kernel.check
+
+Please include that output if opening an issue.
+
+
+Kernel is Not Listed
+~~~~~~~~~~~~~~~~~~~~
+If the kernel is not listed as an available kernel, first try the following 
command:
+
+.. code:: shell
+
+    python -m matlab_kernel install --user
+
+If the kernel is still not listed, verify that the following point to the same
+version of python:
+
+.. code:: shell
+
+    which python  # use "where" if using cmd.exe
+    which jupyter
+
+
+Additional information
+----------------------
+
+The Matlab kernel is based on `MetaKernel 
<http://pypi.python.org/pypi/metakernel>`_,
+which means it features a standard set of magics.  For a full list of magics,
+run ``%lsmagic`` in a cell.
+
+A sample notebook is available online_.
+
+A note about plotting.  After each call to Matlab, we ask Matlab to save any
+open figures to image files whose format and resolution are defined using the
+``%plot`` magic.  The resulting image is shown inline in the notebook.  You can
+use ``%plot native`` to raise normal Matlab windows instead.
+
+
+Advanced Installation Notes
+---------------------------
+
+We automatically install a Jupyter kernelspec when installing the python 
package. This location can be found using ``jupyter kernelspec list``. If the 
default location is not desired, you can remove the directory for the octave 
kernel, and install using ``python -m matlab_kernel install``. See ``python -m 
matlab_kernel install --help`` for available options.
+
+It has been reported that Matlab version 2016b works fine. However, Matlab 
2014b does not work with Python 3.5.
+
+.. _online: 
http://nbviewer.ipython.org/github/Calysto/matlab_kernel/blob/master/matlab_kernel.ipynb
+
+
+Development
+~~~~~~~~~~~
+
+Install the package locally::
+
+    $ pip install -e .
+    $ python -m matlab_kernel install
+
+As you make changes, test them in a notebook (restart the kernel between 
changes).
+
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matlab_kernel-0.16.11/matlab_kernel/__init__.py 
new/matlab_kernel-0.17.1/matlab_kernel/__init__.py
--- old/matlab_kernel-0.16.11/matlab_kernel/__init__.py 2020-11-09 
21:41:38.000000000 +0100
+++ new/matlab_kernel-0.17.1/matlab_kernel/__init__.py  2022-05-09 
12:20:41.000000000 +0200
@@ -1,3 +1,3 @@
 """A Matlab kernel for Jupyter"""
 
-__version__ = '0.16.11'
+__version__ = '0.17.1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matlab_kernel-0.16.11/matlab_kernel/kernel.json 
new/matlab_kernel-0.17.1/matlab_kernel/kernel.json
--- old/matlab_kernel-0.16.11/matlab_kernel/kernel.json 2020-11-02 
19:57:07.000000000 +0100
+++ new/matlab_kernel-0.17.1/matlab_kernel/kernel.json  1970-01-01 
01:00:00.000000000 +0100
@@ -1,8 +0,0 @@
-{
-    "argv": [
-        "python", "-m", "matlab_kernel", "-f", "{connection_file}"],
-    "display_name": "Matlab",
-    "language": "matlab",
-    "mimetype": "text/x-octave",
-    "name": "matlab"
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matlab_kernel-0.16.11/matlab_kernel/kernel.py 
new/matlab_kernel-0.17.1/matlab_kernel/kernel.py
--- old/matlab_kernel-0.16.11/matlab_kernel/kernel.py   2020-11-09 
21:41:27.000000000 +0100
+++ new/matlab_kernel-0.17.1/matlab_kernel/kernel.py    2022-05-09 
12:18:00.000000000 +0200
@@ -28,7 +28,7 @@
 
 from . import __version__
 
-
+IS_CONNECT = "connect-to-existing-kernel" in os.environ.keys()
 class _PseudoStream:
 
     def __init__(self, writer):
@@ -39,9 +39,10 @@
     """Get the kernel json for the kernel.
     """
     here = os.path.dirname(__file__)
-    with open(os.path.join(here, 'kernel.json')) as fid:
+    kernel_name = 'matlab_connect' if IS_CONNECT else 'matlab'
+    with open(os.path.join(here, kernel_name ,'kernel.json')) as fid:
         data = json.load(fid)
-    data['argv'][0] = sys.executable
+    # data['argv'][0] = sys.executable
     return data
 
 
@@ -79,10 +80,16 @@
         Matlab engine not installed:
         See https://www.mathworks.com/help/matlab/matlab-engine-for-python.htm
         """)
-        try:
-            self.__matlab = matlab.engine.start_matlab()
-        except matlab.engine.EngineError:
-            self.__matlab = matlab.engine.connect_matlab()
+        if IS_CONNECT:
+            try:
+                self.__matlab = matlab.engine.connect_matlab()
+            except matlab.engine.EngineError:
+                self.__matlab = matlab.engine.start_matlab()
+        else:
+            try:
+                self.__matlab = matlab.engine.start_matlab()
+            except matlab.engine.EngineError:
+                self.__matlab = matlab.engine.connect_matlab()
         # detecting the correct kwargs for async running
         # matlab 'async' param is deprecated since it became a keyword in 
python 3.7
         # instead, 'background' param is available and recommended since 
Matlab R2017b
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/matlab_kernel-0.16.11/matlab_kernel/kernel_template.json 
new/matlab_kernel-0.17.1/matlab_kernel/kernel_template.json
--- old/matlab_kernel-0.16.11/matlab_kernel/kernel_template.json        
1970-01-01 01:00:00.000000000 +0100
+++ new/matlab_kernel-0.17.1/matlab_kernel/kernel_template.json 2022-05-09 
12:18:00.000000000 +0200
@@ -0,0 +1,8 @@
+{
+    "argv": [
+        "python", "-m", "matlab_kernel", "-f", "{connection_file}"],
+    "display_name": "Matlab",
+    "language": "matlab",
+    "mimetype": "text/x-octave",
+    "name": "matlab"
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/matlab_kernel-0.16.11/matlab_kernel/matlab/kernel.json 
new/matlab_kernel-0.17.1/matlab_kernel/matlab/kernel.json
--- old/matlab_kernel-0.16.11/matlab_kernel/matlab/kernel.json  1970-01-01 
01:00:00.000000000 +0100
+++ new/matlab_kernel-0.17.1/matlab_kernel/matlab/kernel.json   2022-05-09 
12:20:57.000000000 +0200
@@ -0,0 +1 @@
+{"argv": ["python", "-m", "matlab_kernel", "-f", "{connection_file}"], 
"display_name": "Matlab", "language": "matlab", "mimetype": "text/x-octave", 
"name": "matlab"}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/matlab_kernel-0.16.11/matlab_kernel/matlab_connect/kernel.json 
new/matlab_kernel-0.17.1/matlab_kernel/matlab_connect/kernel.json
--- old/matlab_kernel-0.16.11/matlab_kernel/matlab_connect/kernel.json  
1970-01-01 01:00:00.000000000 +0100
+++ new/matlab_kernel-0.17.1/matlab_kernel/matlab_connect/kernel.json   
2022-05-09 12:20:57.000000000 +0200
@@ -0,0 +1 @@
+{"argv": ["python", "-m", "matlab_kernel", "-f", "{connection_file}"], 
"display_name": "Matlab (Connection)", "language": "matlab", "mimetype": 
"text/x-octave", "name": "matlab_connect", "env": 
{"connect-to-existing-kernel": "1"}}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/matlab_kernel-0.16.11/matlab_kernel.egg-info/PKG-INFO 
new/matlab_kernel-0.17.1/matlab_kernel.egg-info/PKG-INFO
--- old/matlab_kernel-0.16.11/matlab_kernel.egg-info/PKG-INFO   2020-11-09 
21:41:42.000000000 +0100
+++ new/matlab_kernel-0.17.1/matlab_kernel.egg-info/PKG-INFO    2022-05-09 
12:20:57.000000000 +0200
@@ -1,120 +1,10 @@
 Metadata-Version: 2.1
 Name: matlab-kernel
-Version: 0.16.11
+Version: 0.17.1
 Summary: UNKNOWN
 Home-page: https://github.com/Calysto/matlab_kernel
 Author: Steven Silvester, Antony Lee
 License: BSD
-Description: 
-        A Matlab kernel for Jupyter
-        ===========================
-        
-        Prerequisites
-        -------------
-        Install `Jupyter Notebook 
<http://jupyter.readthedocs.org/en/latest/install.html>`_ and the
-        `Matlab engine for Python 
<https://www.mathworks.com/help/matlab/matlab-engine-for-python.html>`_.
-        
-        Installation
-        ------------
-        
-        Install using::
-        
-            $ pip install matlab_kernel
-        
-        or ``pip install git+https://github.com/Calysto/matlab_kernel`` for 
the dev version.
-        
-        To use the kernel, run one of::
-        
-            $ jupyter notebook
-            # In the notebook interface, select Matlab from the 'New' menu
-            $ jupyter qtconsole --kernel matlab
-            $ jupyter console --kernel matlab
-        
-        To remove from kernel listings::
-        
-            $ jupyter kernelspec remove matlab
-        
-        
-        Configuration
-        -------------
-        The kernel can be configured by adding an ``matlab_kernel_config.py`` 
file to the
-        ``jupyter`` config path.  The ``MatlabKernel`` class offers 
``plot_settings`` as a configurable traits.
-        The available plot settings are:
-        'format', 'backend', 'width', 'height', and 'resolution'.
-        
-        .. code:: bash
-        
-            cat ~/.jupyter/matlab_kernel_config.py
-            c.MatlabKernel.plot_settings = dict(format='svg')
-        
-        
-        Troubleshooting
-        ---------------
-        
-        Kernel Times Out While Starting
-        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        If the kernel is not starting, try running the following from a 
terminal.
-        
-        .. code:: shell
-        
-          python -m matlab_kernel.check
-        
-        Please include that output if opening an issue.
-        
-        
-        Kernel is Not Listed
-        ~~~~~~~~~~~~~~~~~~~~
-        If the kernel is not listed as an available kernel, first try the 
following command:
-        
-        .. code:: shell
-        
-            python -m matlab_kernel install --user
-        
-        If the kernel is still not listed, verify that the following point to 
the same
-        version of python:
-        
-        .. code:: shell
-        
-            which python  # use "where" if using cmd.exe
-            which jupyter
-        
-        
-        Additional information
-        ----------------------
-        
-        The Matlab kernel is based on `MetaKernel 
<http://pypi.python.org/pypi/metakernel>`_,
-        which means it features a standard set of magics.  For a full list of 
magics,
-        run ``%lsmagic`` in a cell.
-        
-        A sample notebook is available online_.
-        
-        A note about plotting.  After each call to Matlab, we ask Matlab to 
save any
-        open figures to image files whose format and resolution are defined 
using the
-        ``%plot`` magic.  The resulting image is shown inline in the notebook. 
 You can
-        use ``%plot native`` to raise normal Matlab windows instead.
-        
-        
-        Advanced Installation Notes
-        ---------------------------
-        
-        We automatically install a Jupyter kernelspec when installing the 
python package. This location can be found using ``jupyter kernelspec list``. 
If the default location is not desired, you can remove the directory for the 
octave kernel, and install using ``python -m matlab_kernel install``. See 
``python -m matlab_kernel install --help`` for available options.
-        
-        It has been reported that Matlab version 2016b works fine. However, 
Matlab 2014b does not work with Python 3.5.
-        
-        .. _online: 
http://nbviewer.ipython.org/github/Calysto/matlab_kernel/blob/master/matlab_kernel.ipynb
-        
-        
-        Development
-        ~~~~~~~~~~~
-        
-        Install the package locally::
-        
-            $ pip install -e .
-            $ python -m matlab_kernel install
-        
-        As you make changes, test them in a notebook (restart the kernel 
between changes).
-        
-        
 Platform: UNKNOWN
 Classifier: Framework :: IPython
 Classifier: License :: OSI Approved :: BSD License
@@ -125,3 +15,116 @@
 Requires: jupyter_client (>=4.4.0)
 Requires: ipython (>=4.0.0)
 Description-Content-Type: text/x-rst
+License-File: LICENSE.txt
+
+
+A Matlab kernel for Jupyter
+===========================
+
+Prerequisites
+-------------
+Install `Jupyter Notebook 
<http://jupyter.readthedocs.org/en/latest/install.html>`_ and the
+`Matlab engine for Python 
<https://www.mathworks.com/help/matlab/matlab-engine-for-python.html>`_.
+
+Installation
+------------
+
+Install using::
+
+    $ pip install matlab_kernel
+
+or ``pip install git+https://github.com/Calysto/matlab_kernel`` for the dev 
version.
+
+To use the kernel, run one of::
+
+    $ jupyter notebook
+    # In the notebook interface, select Matlab from the 'New' menu
+    $ jupyter qtconsole --kernel matlab
+    $ jupyter console --kernel matlab
+
+To remove from kernel listings::
+
+    $ jupyter kernelspec remove matlab
+
+
+Configuration
+-------------
+The kernel can be configured by adding an ``matlab_kernel_config.py`` file to 
the
+``jupyter`` config path.  The ``MatlabKernel`` class offers ``plot_settings`` 
as a configurable traits.
+The available plot settings are:
+'format', 'backend', 'width', 'height', and 'resolution'.
+
+.. code:: bash
+
+    cat ~/.jupyter/matlab_kernel_config.py
+    c.MatlabKernel.plot_settings = dict(format='svg')
+
+
+Troubleshooting
+---------------
+
+Kernel Times Out While Starting
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+If the kernel is not starting, try running the following from a terminal.
+
+.. code:: shell
+
+  python -m matlab_kernel.check
+
+Please include that output if opening an issue.
+
+
+Kernel is Not Listed
+~~~~~~~~~~~~~~~~~~~~
+If the kernel is not listed as an available kernel, first try the following 
command:
+
+.. code:: shell
+
+    python -m matlab_kernel install --user
+
+If the kernel is still not listed, verify that the following point to the same
+version of python:
+
+.. code:: shell
+
+    which python  # use "where" if using cmd.exe
+    which jupyter
+
+
+Additional information
+----------------------
+
+The Matlab kernel is based on `MetaKernel 
<http://pypi.python.org/pypi/metakernel>`_,
+which means it features a standard set of magics.  For a full list of magics,
+run ``%lsmagic`` in a cell.
+
+A sample notebook is available online_.
+
+A note about plotting.  After each call to Matlab, we ask Matlab to save any
+open figures to image files whose format and resolution are defined using the
+``%plot`` magic.  The resulting image is shown inline in the notebook.  You can
+use ``%plot native`` to raise normal Matlab windows instead.
+
+
+Advanced Installation Notes
+---------------------------
+
+We automatically install a Jupyter kernelspec when installing the python 
package. This location can be found using ``jupyter kernelspec list``. If the 
default location is not desired, you can remove the directory for the octave 
kernel, and install using ``python -m matlab_kernel install``. See ``python -m 
matlab_kernel install --help`` for available options.
+
+It has been reported that Matlab version 2016b works fine. However, Matlab 
2014b does not work with Python 3.5.
+
+.. _online: 
http://nbviewer.ipython.org/github/Calysto/matlab_kernel/blob/master/matlab_kernel.ipynb
+
+
+Development
+~~~~~~~~~~~
+
+Install the package locally::
+
+    $ pip install -e .
+    $ python -m matlab_kernel install
+
+As you make changes, test them in a notebook (restart the kernel between 
changes).
+
+
+
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/matlab_kernel-0.16.11/matlab_kernel.egg-info/SOURCES.txt 
new/matlab_kernel-0.17.1/matlab_kernel.egg-info/SOURCES.txt
--- old/matlab_kernel-0.16.11/matlab_kernel.egg-info/SOURCES.txt        
2020-11-09 21:41:42.000000000 +0100
+++ new/matlab_kernel-0.17.1/matlab_kernel.egg-info/SOURCES.txt 2022-05-09 
12:20:58.000000000 +0200
@@ -6,10 +6,12 @@
 matlab_kernel/__init__.py
 matlab_kernel/__main__.py
 matlab_kernel/check.py
-matlab_kernel/kernel.json
 matlab_kernel/kernel.py
+matlab_kernel/kernel_template.json
 matlab_kernel.egg-info/PKG-INFO
 matlab_kernel.egg-info/SOURCES.txt
 matlab_kernel.egg-info/dependency_links.txt
 matlab_kernel.egg-info/requires.txt
-matlab_kernel.egg-info/top_level.txt
\ No newline at end of file
+matlab_kernel.egg-info/top_level.txt
+matlab_kernel/matlab/kernel.json
+matlab_kernel/matlab_connect/kernel.json
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matlab_kernel-0.16.11/setup.cfg 
new/matlab_kernel-0.17.1/setup.cfg
--- old/matlab_kernel-0.16.11/setup.cfg 2020-11-09 21:41:42.153558300 +0100
+++ new/matlab_kernel-0.17.1/setup.cfg  2022-05-09 12:20:58.246935000 +0200
@@ -2,7 +2,7 @@
 license_file = LICENSE.txt
 
 [versioneer]
-vcs = git
+VCS = git
 style = pep440
 versionfile_source = matlab_kernel/_version.py
 versionfile_build = matlab_kernel/_version.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/matlab_kernel-0.16.11/setup.py 
new/matlab_kernel-0.17.1/setup.py
--- old/matlab_kernel-0.16.11/setup.py  2020-11-02 19:57:07.000000000 +0100
+++ new/matlab_kernel-0.17.1/setup.py   2022-05-09 12:18:00.000000000 +0200
@@ -1,4 +1,7 @@
 import glob
+import json
+import os
+import sys
 from setuptools import setup, find_packages
 
 with open('matlab_kernel/__init__.py', 'rb') as fid:
@@ -9,12 +12,44 @@
             break
 
 DISTNAME = 'matlab_kernel'
+PY_EXECUTABLE = 'python'
+
+# when building wheels, directly use 'python' in the kernelspec.
+if any(a.startswith("bdist") for a in sys.argv):
+    PY_EXECUTABLE = 'python'
+
+# when directly installing, use sys.executable to get python full path.
+if any(a.startswith("install") for a in sys.argv):
+    PY_EXECUTABLE = sys.executable
+
+# generating kernel.json for both kernels
+os.makedirs(os.path.join(DISTNAME, 'matlab'), exist_ok=True)
+with open(os.path.join(DISTNAME, 'kernel_template.json'), 'r') as fp:
+    matlab_json = json.load(fp)
+matlab_json['argv'][0] = PY_EXECUTABLE
+with open(os.path.join(DISTNAME, 'matlab','kernel.json'), 'w') as fp:
+    json.dump(matlab_json, fp)
+
+os.makedirs(os.path.join(DISTNAME, 'matlab_connect'), exist_ok=True)
+with open(os.path.join(DISTNAME, 'kernel_template.json'), 'r') as fp:
+    matlab_json = json.load(fp)
+matlab_json['argv'][0] = PY_EXECUTABLE
+matlab_json['display_name'] = 'Matlab (Connection)'
+matlab_json['name'] = "matlab_connect"
+matlab_json['env'] = {'connect-to-existing-kernel': '1'}
+with open(os.path.join(DISTNAME, 'matlab_connect','kernel.json'), 'w') as fp:
+    json.dump(matlab_json, fp)
+
 PACKAGE_DATA = {
     DISTNAME: ['*.m'] + glob.glob('%s/**/*.*' % DISTNAME)
 }
 DATA_FILES = [
     ('share/jupyter/kernels/matlab', [
-        '%s/kernel.json' % DISTNAME
+        '%s/matlab/kernel.json' % DISTNAME
+     ] + glob.glob('%s/images/*.png' % DISTNAME)
+    ), 
+    ('share/jupyter/kernels/matlab_connect', [
+        '%s/matlab_connect/kernel.json' % DISTNAME
      ] + glob.glob('%s/images/*.png' % DISTNAME)
     )
 ]

Reply via email to