Hello community,
here is the log from the commit of package python-jupyter_core for
openSUSE:Factory checked in at 2017-05-17 17:14:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jupyter_core (Old)
and /work/SRC/openSUSE:Factory/.python-jupyter_core.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jupyter_core"
Wed May 17 17:14:06 2017 rev:4 rq:491437 version:4.3.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-jupyter_core/python-jupyter_core-doc.changes
2016-02-18 12:36:49.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.python-jupyter_core.new/python-jupyter_core-doc.changes
2017-05-17 17:14:08.508711414 +0200
@@ -1,0 +2,42 @@
+Wed Apr 26 16:32:25 UTC 2017 - [email protected]
+
+- Implement single-spec version.
+- Remove version_specific_dirs.patch.
+ The Python3 jupyter implementation will be used for directories.
+
+-------------------------------------------------------------------
+Fri Mar 31 13:59:14 UTC 2017 - [email protected]
+
+- Add version_specific_dirs.patch
+ Uses python version-specific directories to avoid conflicts.
+- Install the directories used for system-side settings and data so
+ they are properly owned by this package.
+
+-------------------------------------------------------------------
+Thu Mar 30 19:05:42 UTC 2017 - [email protected]
+
+- Update to 4.3.0
+ * Add `JUPYTER_NO_CONFIG` environment variable for disabling all
+ Jupyter configuration.
+ * More detailed error message when failing to launch subcommands.
+- Update to 4.2.1
+ * Fix error message on Windows when subcommand not found.
+ * Correctly display PATH in ``jupyter troubleshoot`` on Windows.
+- Update to 4.2.0
+ * Make :command:`jupyter` directory top priority in search path
+ for subcommands, so that :command:`jupyter-subcommand` next to
+ :command:`jupyter` will always be picked if present.
+ * Avoid using ``shell=True`` for subcommand dispatch on Windows.
+- Update to 4.1.1
+ * Include symlink directory and real location on subcommand PATH
+ when :file:`jupyter` is a symlink.
+- Update to 4.1.0
+ * Add ``jupyter.py`` module, so that :command:`python -m jupyter`
+ always works.
+ * Add prototype ``jupyter troubleshoot`` command for displaying
+ environment info.
+ * Ensure directory containing ``jupyter`` executable is included
+ when dispatching subcommands.
+ * Unicode fixes for Legacy Python.
+
+-------------------------------------------------------------------
--- /work/SRC/openSUSE:Factory/python-jupyter_core/python-jupyter_core.changes
2016-02-18 12:36:49.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.python-jupyter_core.new/python-jupyter_core.changes
2017-05-17 17:14:08.692685478 +0200
@@ -1,0 +2,66 @@
+Thu Apr 27 08:10:10 UTC 2017 - [email protected]
+
+- All python versions can share the empty extension directories
+ without conflicting.
+
+-------------------------------------------------------------------
+Wed Apr 26 16:32:25 UTC 2017 - [email protected]
+
+- Implement single-spec version.
+- Remove version_specific_dirs.patch.
+ The Python3 jupyter implementation will be used for directories.
+
+-------------------------------------------------------------------
+Wed Apr 26 16:32:25 UTC 2017 - [email protected]
+
+- Implement single-spec version.
+- Remove version_specific_dirs.patch.
+ The Python3 jupyter implementation will be used for directories.
+
+-------------------------------------------------------------------
+Fri Apr 7 18:24:08 UTC 2017 - [email protected]
+
+- Make python files explicit to make it easier to identify
+ conflicts in the future.
+
+-------------------------------------------------------------------
+Fri Apr 7 03:13:20 UTC 2017 - [email protected]
+
+- Own kernel directories.
+
+-------------------------------------------------------------------
+Fri Mar 31 13:59:14 UTC 2017 - [email protected]
+
+- Add version_specific_dirs.patch
+ Uses python version-specific directories to avoid conflicts.
+- Install the directories used for system-side settings and data so
+ they are properly owned by this package.
+
+-------------------------------------------------------------------
+Thu Mar 30 19:05:42 UTC 2017 - [email protected]
+
+- Update to 4.3.0
+ * Add `JUPYTER_NO_CONFIG` environment variable for disabling all
+ Jupyter configuration.
+ * More detailed error message when failing to launch subcommands.
+- Update to 4.2.1
+ * Fix error message on Windows when subcommand not found.
+ * Correctly display PATH in ``jupyter troubleshoot`` on Windows.
+- Update to 4.2.0
+ * Make :command:`jupyter` directory top priority in search path
+ for subcommands, so that :command:`jupyter-subcommand` next to
+ :command:`jupyter` will always be picked if present.
+ * Avoid using ``shell=True`` for subcommand dispatch on Windows.
+- Update to 4.1.1
+ * Include symlink directory and real location on subcommand PATH
+ when :file:`jupyter` is a symlink.
+- Update to 4.1.0
+ * Add ``jupyter.py`` module, so that :command:`python -m jupyter`
+ always works.
+ * Add prototype ``jupyter troubleshoot`` command for displaying
+ environment info.
+ * Ensure directory containing ``jupyter`` executable is included
+ when dispatching subcommands.
+ * Unicode fixes for Legacy Python.
+
+-------------------------------------------------------------------
Old:
----
jupyter_core-4.0.6.tar.gz
New:
----
jupyter_core-4.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-jupyter_core-doc.spec ++++++
--- /var/tmp/diff_new_pack.WieBzy/_old 2017-05-17 17:14:09.396586243 +0200
+++ /var/tmp/diff_new_pack.WieBzy/_new 2017-05-17 17:14:09.400585679 +0200
@@ -1,7 +1,7 @@
#
-# spec file for package python-jupyter_core
+# spec file for package python-jupyter_core-doc
#
-# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,73 +16,93 @@
#
-%if 0%{?suse_version} && ( 0%{?suse_version} != 1315 && 0%{?suse_version} >
1110 )
-%define build_pdf 1
+%if 0%{?suse_version} && 0%{?suse_version} > 1320
+%bcond_without pdf
%else
-%define build_pdf 0
+%bcond_with pdf
%endif
+%bcond_without html
+
+%bcond_without tests
+
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-jupyter_core-doc
-Version: 4.0.6
+Version: 4.3.0
Release: 0
Summary: Documentation for python-jupyter_core
License: BSD-3-Clause
Group: Development/Languages/Python
Url: http://jupyter.org
-Source:
https://pypi.python.org/packages/source/j/jupyter_core/jupyter_core-%{version}.tar.gz
-BuildRequires: python-jupyter_core
+Source:
https://files.pythonhosted.org/packages/source/j/jupyter_core/jupyter_core-%{version}.tar.gz
+BuildRequires: fdupes
+BuildRequires: python-rpm-macros
+BuildRequires: %{python_module jupyter_core}
+%if %{with tests}
+# Test requirements
+BuildRequires: %{python_module pytest}
+# Python 2.7 test requirements
+BuildRequires: python-mock
+%endif
# Documentation requirements
-BuildRequires: python-Sphinx
-%if %{build_pdf}
-BuildRequires: python-Sphinx-latex
+%if %{with pdf} || %{with html}
+BuildRequires: python3-Sphinx
%endif
+%if %{with pdf}
+BuildRequires: python3-Sphinx-latex
+%endif
+Provides: %{name}-html = %{version}
+Provides: %{name}-pdf = %{version}
+Obsoletes: %{name}-html < %{version}
+Obsoletes: %{name}-pdf < %{version}
+Provides: %{python_module jupyter_core-doc = %{version}}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
-Documentation and help files for python3-jupyter_core.
-
-%package html
-Summary: HTML documentation for python-jupyter_core
-Recommends: python-jupyter_core = %{version}
-
-%description html
-Documentation and help files for python-jupyter_core in HTML format.
-
-%package pdf
-Summary: PDF documentation for python-jupyter_core
-Recommends: python-jupyter_core = %{version}
-
-%description pdf
-Documentation and help files for python-jupyter_core in PDF format.
-
+Documentation and help files for python-jupyter_core.
%prep
%setup -q -n jupyter_core-%{version}
%build
-# Not needed
-
-%install
# Build the documentation
pushd docs
-%if %{build_pdf}
-PYTHONPATH=%{buildroot}%{python_sitelib} make latexpdf
+%if %{with html}
+make html
+rm -rf build/html/.buildinfo
+%endif
+%if %{with pdf}
+make latexpdf
%endif
-PYTHONPATH=%{buildroot}%{python_sitelib} make html
-rm -rf _build/html/.buildinfo
popd
-%files html
-%defattr(-,root,root,-)
-%doc COPYING.md
-%doc docs/_build/html/
+%install
+mkdir -p %{buildroot}%{_docdir}/python-jupyter_core
+
+%if %{with pdf}
+cp docs/_build/latex/*.pdf %{buildroot}%{_docdir}/python-jupyter_core/
+%endif
+
+%if %{with html}
+cp -r docs/_build/html %{buildroot}%{_docdir}/python-jupyter_core/
+%endif
+
+cp -r examples %{buildroot}%{_docdir}/python-jupyter_core/
+%fdupes %{buildroot}%{_docdir}/python-jupyter_core/
+
+%if %{with tests}
+%check
+# test_migrate requires files not found in the package
+pushd jupyter_core/tests
+rm test_migrate.py
+%python_expand py.test-%{$python_bin_suffix}
+popd
+%endif
-%if %{build_pdf}
-%files pdf
+%files
%defattr(-,root,root,-)
%doc COPYING.md
-%doc docs/_build/latex/jupyter_core.pdf
-%endif
+%{_docdir}/python-jupyter_core/
%changelog
++++++ python-jupyter_core.spec ++++++
--- /var/tmp/diff_new_pack.WieBzy/_old 2017-05-17 17:14:09.436580604 +0200
+++ /var/tmp/diff_new_pack.WieBzy/_new 2017-05-17 17:14:09.440580041 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-jupyter_core
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -16,33 +16,27 @@
#
+%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-jupyter_core
-Version: 4.0.6
+Version: 4.3.0
Release: 0
Summary: Base package on which Jupyter projects rely
License: BSD-3-Clause
Group: Development/Languages/Python
Url: http://jupyter.org
-Source:
https://pypi.python.org/packages/source/j/jupyter_core/jupyter_core-%{version}.tar.gz
-BuildRequires: python-devel >= 2.7
-BuildRequires: python-ipython_genutils
-BuildRequires: python-traitlets
-# Test requirements
-BuildRequires: python-pytest
-# Python 2.7 test requirements
-BuildRequires: python-mock
-Requires: python >= 2.7
+Source:
https://files.pythonhosted.org/packages/source/j/jupyter_core/jupyter_core-%{version}.tar.gz
+BuildRequires: fdupes
+BuildRequires: python-rpm-macros
+BuildRequires: %{python_module devel}
+BuildRequires: %{python_module setuptools}
+BuildRequires: %{python_module ipython_genutils}
+BuildRequires: %{python_module traitlets}
Requires: python-ipython_genutils
Requires: python-traitlets
Recommends: python-jupyter_ipython
-Requires(post): update-alternatives
-Requires(postun): update-alternatives
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-%if 0%{?suse_version} && 0%{?suse_version} <= 1110
-%{!?python_sitelib: %global python_sitelib %(python -c "from
distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%else
BuildArch: noarch
-%endif
+%python_subpackages
%description
Core common functionality of Jupyter projects.
@@ -57,53 +51,28 @@
%setup -q -n jupyter_core-%{version}
%build
-python setup.py build
+%python_build
%install
-python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+%python_install
+%python_expand %fdupes %{buildroot}%{$python_sitelib}
-# Prepare for update-alternatives usage
-mv %{buildroot}%{_bindir}/jupyter %{buildroot}%{_bindir}/jupyter2
-mv %{buildroot}%{_bindir}/jupyter-migrate
%{buildroot}%{_bindir}/jupyter2-migrate
-
-ln -s -f %{_bindir}/jupyter2 %{buildroot}%{_bindir}/jupyter-%{py_ver}
-ln -s -f %{_bindir}/jupyter2-migrate
%{buildroot}%{_bindir}/jupyter-migrate-%{py_ver}
-
-mkdir -p %{buildroot}%{_sysconfdir}/alternatives
-for p in jupyter jupyter-migrate ; do
- ln -s -f %{_sysconfdir}/alternatives/$p %{buildroot}%{_bindir}/$p
- # create a dummy target for /etc/alternatives/$p
- touch %{buildroot}%{_sysconfdir}/alternatives/$p
-done
-
-%check
-# test_migrate requires files not found in the package
-pushd jupyter_core/tests
-rm test_migrate.py
-PYTHONPATH=%{buildroot}%{python_sitelib} py.test
-popd
-
-%post
-%_sbindir/update-alternatives \
- --install %{_bindir}/jupyter jupyter %{_bindir}/jupyter-%{py_ver} 30 \
- --slave %{_bindir}/jupyter-migrate jupyter-migrate
%{_bindir}/jupyter-migrate-%{py_ver}
-
-%preun
-if [ $1 -eq 0 ] ; then
- %_sbindir/update-alternatives --remove jupyter %{_bindir}/jupyter-%{py_ver}
-fi
+# these directories are used by extensions
+mkdir -p %{buildroot}%{_datadir}/jupyter/
+mkdir -p %{buildroot}%{_datadir}/jupyter/kernels/
+mkdir -p %{buildroot}%{_sysconfdir}/jupyter/
-%files
+%files %{python_files}
%defattr(-,root,root,-)
%doc CONTRIBUTING.md COPYING.md README.md
-%{_bindir}/jupyter
-%{_bindir}/jupyter2
-%{_bindir}/jupyter-%{py_ver}
-%ghost %{_sysconfdir}/alternatives/jupyter
-%{_bindir}/jupyter-migrate
-%{_bindir}/jupyter2-migrate
-%{_bindir}/jupyter-migrate-%{py_ver}
-%ghost %{_sysconfdir}/alternatives/jupyter-migrate
-%{python_sitelib}/*
+%python3_only %{_bindir}/jupyter
+%python3_only %{_bindir}/jupyter-migrate
+%{python_sitelib}/jupyter*.py*
+%pycache_only %{python_sitelib}/__pycache__/jupyter*.*.py*
+%{_datadir}/jupyter/
+%{_datadir}/jupyter/kernels/
+%{_sysconfdir}/jupyter/
+%{python_sitelib}/jupyter_core/
+%{python_sitelib}/jupyter_core-%{version}-*.egg-info
%changelog
++++++ jupyter_core-4.0.6.tar.gz -> jupyter_core-4.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/PKG-INFO
new/jupyter_core-4.3.0/PKG-INFO
--- old/jupyter_core-4.0.6/PKG-INFO 2015-09-18 10:23:31.000000000 +0200
+++ new/jupyter_core-4.3.0/PKG-INFO 2017-02-14 18:32:10.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: jupyter_core
-Version: 4.0.6
+Version: 4.3.0
Summary: Jupyter core package. A base package on which Jupyter projects rely.
Home-page: http://jupyter.org
Author: Jupyter Development Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/docs/changelog.rst
new/jupyter_core-4.3.0/docs/changelog.rst
--- old/jupyter_core-4.0.6/docs/changelog.rst 2015-09-18 10:19:33.000000000
+0200
+++ new/jupyter_core-4.3.0/docs/changelog.rst 2017-02-10 12:06:44.000000000
+0100
@@ -1,6 +1,65 @@
Changes in jupyter-core
=======================
+4.3
+---
+
+4.3.0
+~~~~~
+
+`on
+GitHub <https://github.com/jupyter/jupyter_core/releases/tag/4.3.0>`__
+
+- Add `JUPYTER_NO_CONFIG` environment variable for disabling all Jupyter
configuration.
+- More detailed error message when failing to launch subcommands.
+
+
+4.2
+---
+
+4.2.1
+~~~~~
+
+`on
+GitHub <https://github.com/jupyter/jupyter_core/releases/tag/4.2.1>`__
+
+- Fix error message on Windows when subcommand not found.
+- Correctly display PATH in ``jupyter troubleshoot`` on Windows.
+
+4.2.0
+~~~~~
+
+`on
+GitHub <https://github.com/jupyter/jupyter_core/releases/tag/4.2.0>`__
+
+- Make :command:`jupyter` directory top priority in search path for
subcommands,
+ so that :command:`jupyter-subcommand` next to :command:`jupyter` will always
be picked if present.
+- Avoid using ``shell=True`` for subcommand dispatch on Windows.
+
+4.1
+---
+
+4.1.1
+~~~~~
+
+`on
+GitHub <https://github.com/jupyter/jupyter_core/releases/tag/4.1.1>`__
+
+- Include symlink directory and real location on subcommand PATH when
:file:`jupyter` is a symlink.
+
+
+4.1.0
+~~~~~
+
+`on
+GitHub <https://github.com/jupyter/jupyter_core/releases/tag/4.1>`__
+
+- Add ``jupyter.py`` module, so that :command:`python -m jupyter` always works.
+- Add prototype ``jupyter troubleshoot`` command for displaying environment
info.
+- Ensure directory containing ``jupyter`` executable is included when
dispatching subcommands.
+- Unicode fixes for Legacy Python.
+
+
4.0
---
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/docs/index.rst
new/jupyter_core-4.3.0/docs/index.rst
--- old/jupyter_core-4.0.6/docs/index.rst 2015-09-17 09:28:33.000000000
+0200
+++ new/jupyter_core-4.3.0/docs/index.rst 2016-10-11 14:52:31.000000000
+0200
@@ -3,7 +3,7 @@
This documentation only describes the public API in the ``jupyter_core``
package. For overview information about using Jupyter, see the `main Jupyter
-docs <http://jupyter.readthedocs.org/en/latest/>`__.
+docs <https://jupyter.readthedocs.io/en/latest/>`__.
Contents:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/examples/jupyter-completion.bash
new/jupyter_core-4.3.0/examples/jupyter-completion.bash
--- old/jupyter_core-4.0.6/examples/jupyter-completion.bash 1970-01-01
01:00:00.000000000 +0100
+++ new/jupyter_core-4.3.0/examples/jupyter-completion.bash 2016-08-10
11:22:59.000000000 +0200
@@ -0,0 +1,90 @@
+# load with: . jupyter-completion.bash
+
+if [[ -n ${ZSH_VERSION-} ]]; then
+ autoload -Uz bashcompinit && bashcompinit
+fi
+
+_jupyter()
+{
+ local url=$1
+ local var=$2
+ local dash=$3
+ if [[ "$url $var" == $__jupyter ]]; then
+ opts=$__jupyter
+ return
+ fi
+ # matplotlib and profile don't need the = and the
+ # version without simplifies the special cased completion
+ opts=$(jupyter ${url} --help-all | grep -E "^-{1,2}[^-]" | sed -e
"s/<.*//" -e "s/[^=]$/& /" -e "$ s/^/\n-h\n--help\n--help-all\n/")
+ __jupyter="$url $var"
+ __jupyter="$opts"
+}
+
+_jupyter()
+{
+ local cur=${COMP_WORDS[COMP_CWORD]}
+ local prev=${COMP_WORDS[COMP_CWORD - 1]}
+ local subcommands="notebook qtconsole console nbconvert kernelspec trust "
+ local opts="help"
+ if [ -z "$__jupyter" ]; then
+ _jupyter baseopts
+ __jupyter="${opts}"
+ fi
+ local baseopts="$__jupyter"
+ local mode=""
+ for i in "${COMP_WORDS[@]}"; do
+ [ "$cur" = "$i" ] && break
+ if [[ ${subcommands} == *${i}* ]]; then
+ mode="$i"
+ break
+ elif [[ ${i} == "--"* ]]; then
+ mode="nosubcommand"
+ break
+ fi
+ done
+
+
+ if [[ ${cur} == -* ]]; then
+ case $mode in
+ "notebook" | "qtconsole" | "console" | "nbconvert")
+ _jupyter $mode
+ opts=$"${opts} ${baseopts}"
+ ;;
+ "kernelspec")
+ if [[ $COMP_CWORD -ge 3 ]]; then
+ # 'history trim' and 'history clear' covered by next line
+ _jupyter $mode\ "${COMP_WORDS[2]}"
+ else
+ _jupyter $mode
+
+ fi
+ opts=$"${opts}"
+ ;;
+ *)
+ opts=$baseopts
+ esac
+ # don't drop the trailing space
+ local IFS=$'\t\n'
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ return 0
+ elif [[ $mode == "kernelspec" ]]; then
+ if [[ $COMP_CWORD -ge 3 ]]; then
+ # drop into flags
+ opts="--"
+ else
+ opts="list install "
+ fi
+ local IFS=$'\t\n'
+ COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
+ else
+ if [ "$COMP_CWORD" == 1 ]; then
+ local IFS=$'\t\n'
+ local sub=$(echo $subcommands | sed -e "s/ / \t/g")
+ COMPREPLY=( $(compgen -W "${sub}" -- ${cur}) )
+ else
+ COMPREPLY=( $(compgen -f -- ${cur}) )
+ fi
+ fi
+
+}
+complete -o default -o nospace -F _jupyter jupyter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/jupyter.py
new/jupyter_core-4.3.0/jupyter.py
--- old/jupyter_core-4.0.6/jupyter.py 1970-01-01 01:00:00.000000000 +0100
+++ new/jupyter_core-4.3.0/jupyter.py 2016-02-12 11:37:57.000000000 +0100
@@ -0,0 +1,4 @@
+"""Launch the root jupyter command"""
+if __name__ == '__main__':
+ from jupyter_core.command import main
+ main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/jupyter_core/application.py
new/jupyter_core-4.3.0/jupyter_core/application.py
--- old/jupyter_core-4.0.6/jupyter_core/application.py 2015-09-16
14:01:43.000000000 +0200
+++ new/jupyter_core-4.3.0/jupyter_core/application.py 2017-02-13
10:51:58.000000000 +0100
@@ -262,7 +262,7 @@
@classmethod
def launch_instance(cls, argv=None, **kwargs):
- """Launch an instance of a Jupyer Application"""
+ """Launch an instance of a Jupyter Application"""
try:
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
except NoStart:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/jupyter_core/command.py
new/jupyter_core-4.3.0/jupyter_core/command.py
--- old/jupyter_core-4.0.6/jupyter_core/command.py 2015-09-17
09:28:33.000000000 +0200
+++ new/jupyter_core-4.3.0/jupyter_core/command.py 2017-02-07
10:55:35.000000000 +0100
@@ -56,6 +56,7 @@
return parser
+
def list_subcommands():
"""List all jupyter subcommands
@@ -64,10 +65,9 @@
Returns a list of jupyter's subcommand names, without the `jupyter-`
prefix.
Nested children (e.g. jupyter-sub-subsub) are not included.
"""
- path = os.environ.get('PATH') or os.defpath
subcommand_tuples = set()
# construct a set of `('foo', 'bar') from `jupyter-foo-bar`
- for d in path.split(os.pathsep):
+ for d in _path_with_self():
try:
names = os.listdir(d)
except OSError:
@@ -93,7 +93,16 @@
Python provides execvp on Windows, but its behavior is problematic (Python
bug#9148).
"""
if sys.platform.startswith('win'):
- p = Popen([cmd] + argv[1:])
+ # PATH is ignored when shell=False,
+ # so rely on shutil.which
+ try:
+ from shutil import which
+ except ImportError:
+ from .utils.shutil_which import which
+ cmd_path = which(cmd)
+ if cmd_path is None:
+ raise OSError('%r not found' % cmd, errno.ENOENT)
+ p = Popen([cmd_path] + argv[1:])
# Don't raise KeyboardInterrupt in the parent process.
# Set this after spawning, to avoid subprocess inheriting handler.
import signal
@@ -104,7 +113,33 @@
os.execvp(cmd, argv)
+def _path_with_self():
+ """Put `jupyter`'s dir at the front of PATH
+
+ Ensures that /path/to/jupyter subcommand
+ will do /path/to/jupyter-subcommand
+ even if /other/jupyter-subcommand is ahead of it on PATH
+ """
+ scripts = [sys.argv[0]]
+ if os.path.islink(scripts[0]):
+ # include realpath, if `jupyter` is a symlink
+ scripts.append(os.path.realpath(scripts[0]))
+
+ path_list = (os.environ.get('PATH') or os.defpath).split(os.pathsep)
+ for script in scripts:
+ bindir = os.path.dirname(script)
+ if (os.path.isdir(bindir)
+ and os.access(script, os.X_OK) # only if it's a script
+ ):
+ # ensure executable's dir is on PATH
+ # avoids missing subcommands when jupyter is run via absolute path
+ path_list.insert(0, bindir)
+ os.environ['PATH'] = os.pathsep.join(path_list)
+ return path_list
+
+
def main():
+ _path_with_self() # ensure executable is on PATH
if len(sys.argv) > 1 and not sys.argv[1].startswith('-'):
# Don't parse if a subcommand is given
# Avoids argparse gobbling up args passed to subcommand, such as `-h`.
@@ -150,9 +185,7 @@
try:
_execvp(command, sys.argv[1:])
except OSError as e:
- if e.errno == errno.ENOENT:
- sys.exit("jupyter: %r is not a Jupyter command" % subcommand)
- raise
+ sys.exit("Error executing Jupyter command %r: %s" % (subcommand, e))
if __name__ == '__main__':
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/jupyter_core/migrate.py
new/jupyter_core-4.3.0/jupyter_core/migrate.py
--- old/jupyter_core-4.0.6/jupyter_core/migrate.py 2015-09-18
10:22:43.000000000 +0200
+++ new/jupyter_core-4.3.0/jupyter_core/migrate.py 2016-01-29
08:21:30.000000000 +0100
@@ -1,3 +1,5 @@
+from __future__ import unicode_literals
+
"""Migrating IPython < 4.0 to Jupyter
This *copies* configuration and resources to their new locations in Jupyter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/jupyter_core/paths.py
new/jupyter_core-4.3.0/jupyter_core/paths.py
--- old/jupyter_core-4.0.6/jupyter_core/paths.py 2015-06-25
22:44:46.000000000 +0200
+++ new/jupyter_core-4.3.0/jupyter_core/paths.py 2017-02-07
10:46:49.000000000 +0100
@@ -11,6 +11,7 @@
import os
import sys
+import tempfile
pjoin = os.path.join
@@ -23,6 +24,18 @@
homedir = os.path.realpath(homedir)
return homedir
+_dtemps = {}
+def _mkdtemp_once(name):
+ """Make or reuse a temporary directory.
+
+ If this is called with the same name in the same process, it will return
+ the same directory.
+ """
+ try:
+ return _dtemps[name]
+ except KeyError:
+ d = _dtemps[name] = tempfile.mkdtemp(prefix=name + '-')
+ return d
def jupyter_config_dir():
"""Get the Jupyter config directory for this platform and user.
@@ -33,6 +46,9 @@
env = os.environ
home_dir = get_home_dir()
+ if env.get('JUPYTER_NO_CONFIG'):
+ return _mkdtemp_once('jupyter-clean-cfg')
+
if env.get('JUPYTER_CONFIG_DIR'):
return env['JUPYTER_CONFIG_DIR']
@@ -164,6 +180,9 @@
def jupyter_config_path():
"""Return the search path for Jupyter config files as a list."""
paths = [jupyter_config_dir()]
+ if os.environ.get('JUPYTER_NO_CONFIG'):
+ return paths
+
for p in ENV_CONFIG_PATH:
if p not in SYSTEM_CONFIG_PATH:
paths.append(p)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_core-4.0.6/jupyter_core/tests/test_command.py
new/jupyter_core-4.3.0/jupyter_core/tests/test_command.py
--- old/jupyter_core-4.0.6/jupyter_core/tests/test_command.py 2015-07-14
19:07:29.000000000 +0200
+++ new/jupyter_core-4.3.0/jupyter_core/tests/test_command.py 2016-09-13
15:22:49.000000000 +0200
@@ -7,7 +7,7 @@
import pytest
try:
- from unitteset.mock import patch
+ from unittest.mock import patch
except ImportError:
# py2
from mock import patch
@@ -76,6 +76,7 @@
with pytest.raises(CalledProcessError):
output = get_jupyter_output('nonexistant-subcommand')
[email protected](sys, 'argv', [__file__] + sys.argv[1:])
def test_subcommand_list(tmpdir):
a = tmpdir.mkdir("a")
for cmd in ('jupyter-foo-bar',
@@ -98,3 +99,42 @@
'xyz',
'yo-eyropa-ganymyde-callysto',
]
+
+def test_not_on_path(tmpdir):
+ a = tmpdir.mkdir("a")
+ jupyter = a.join('jupyter')
+ jupyter.write(
+ 'from jupyter_core import command; command.main()'
+ )
+ jupyter.chmod(0o700)
+ witness_cmd = 'jupyter-witness'
+ if sys.platform == 'win32':
+ witness_cmd += '.py'
+ witness = a.join(witness_cmd)
+ witness.write('#!%s\n%s\n' % (sys.executable, 'print("WITNESS ME")'))
+ witness.chmod(0o700)
+ out = check_output([sys.executable, str(jupyter), 'witness'], env={'PATH':
''})
+ assert b'WITNESS' in out
+
+
+def test_path_priority(tmpdir):
+ a = tmpdir.mkdir("a")
+ jupyter = a.join('jupyter')
+ jupyter.write(
+ 'from jupyter_core import command; command.main()'
+ )
+ jupyter.chmod(0o700)
+ witness_cmd = 'jupyter-witness'
+ if sys.platform == 'win32':
+ witness_cmd += '.py'
+ witness_a = a.join(witness_cmd)
+ witness_a.write('#!%s\n%s\n' % (sys.executable, 'print("WITNESS A")'))
+ witness_a.chmod(0o700)
+
+ b = tmpdir.mkdir("b")
+ witness_b = b.join(witness_cmd)
+ witness_b.write('#!%s\n%s\n' % (sys.executable, 'print("WITNESS B")'))
+ witness_b.chmod(0o700)
+
+ out = check_output([sys.executable, str(jupyter), 'witness'], env={'PATH':
str(b)})
+ assert b'WITNESS A' in out
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/jupyter_core-4.0.6/jupyter_core/tests/test_migrate.py
new/jupyter_core-4.3.0/jupyter_core/tests/test_migrate.py
--- old/jupyter_core-4.0.6/jupyter_core/tests/test_migrate.py 2015-06-25
22:44:46.000000000 +0200
+++ new/jupyter_core-4.3.0/jupyter_core/tests/test_migrate.py 2016-06-24
23:29:51.000000000 +0200
@@ -1,6 +1,7 @@
-"""Test config file migration"""
+# coding: utf-8
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
+"""Test config file migration"""
import os
import re
@@ -36,7 +37,7 @@
@pytest.fixture
def td(request):
"""Fixture for a temporary directory"""
- td = mkdtemp()
+ td = mkdtemp(u'μnïcø∂e')
request.addfinalizer(lambda : shutil.rmtree(td))
return td
@@ -215,5 +216,3 @@
migrate()
assert os.path.exists(env['JUPYTER_CONFIG_DIR'])
assert os.path.exists(env['JUPYTER_DATA_DIR'])
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/jupyter_core/troubleshoot.py
new/jupyter_core-4.3.0/jupyter_core/troubleshoot.py
--- old/jupyter_core-4.0.6/jupyter_core/troubleshoot.py 1970-01-01
01:00:00.000000000 +0100
+++ new/jupyter_core-4.3.0/jupyter_core/troubleshoot.py 2016-10-11
14:52:31.000000000 +0200
@@ -0,0 +1,104 @@
+#!/usr/bin/env python
+"""
+display environment information that isfrequently
+used to troubleshoot installations of Jupyter or IPython
+"""
+
+# import argparse
+import os
+import platform
+import subprocess
+import sys
+
+
+# def get_args():
+# """
+# TODO: output in JSON or xml? maybe?
+# """
+# pass
+
+def subs(cmd):
+ """
+ get data from commands that we need to run outside of python
+ """
+ try:
+ stdout = subprocess.check_output(cmd)
+ return stdout.decode('utf-8', 'replace').strip()
+ except (OSError, subprocess.CalledProcessError):
+ return None
+
+
+def get_data():
+ """
+ returns a dict of various user environment data
+ """
+ env = {}
+ env['path'] = os.environ.get('PATH')
+ env['sys_path'] = sys.path
+ env['sys_exe'] = sys.executable
+ env['sys_version'] = sys.version
+ env['platform'] = platform.platform()
+ # FIXME: which on Windows?
+ if sys.platform == 'win32':
+ env['where'] = subs(['where', 'jupyter'])
+ env['which'] = None
+ else:
+ env['which'] = subs(['which', '-a', 'jupyter'])
+ env['where'] = None
+ env['pip'] = subs(['pip', 'list'])
+ env['conda'] = subs(['conda', 'list'])
+ return env
+
+
+def main():
+ """
+ print out useful info
+ """
+ #pylint: disable=superfluous-parens
+ # args = get_args()
+ environment_data = get_data()
+
+ print('$PATH:')
+ for directory in environment_data['path'].split(os.pathsep):
+ print('\t' + directory)
+
+ print('\n' + 'sys.path:')
+ for directory in environment_data['sys_path']:
+ print('\t' + directory)
+
+ print('\n' + 'sys.executable:')
+ print('\t' + environment_data['sys_exe'])
+
+ print('\n' + 'sys.version:')
+ if '\n' in environment_data['sys_version']:
+ for data in environment_data['sys_version'].split('\n'):
+ print('\t' + data)
+ else:
+ print('\t' + environment_data['sys_version'])
+
+ print('\n' + 'platform.platform():')
+ print('\t' + environment_data['platform'])
+
+ if environment_data['which']:
+ print('\n' + 'which -a jupyter:')
+ for line in environment_data['which'].split('\n'):
+ print('\t' + line)
+
+ if environment_data['where']:
+ print('\n' + 'where jupyter:')
+ for line in environment_data['where'].split('\n'):
+ print('\t' + line)
+
+ if environment_data['pip']:
+ print('\n' + 'pip list:')
+ for package in environment_data['pip'].split('\n'):
+ print('\t' + package)
+
+ if environment_data['conda']:
+ print('\n' + 'conda list:')
+ for package in environment_data['conda'].split('\n'):
+ print('\t' + package)
+
+
+if __name__ == '__main__':
+ main()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/jupyter_core/version.py
new/jupyter_core-4.3.0/jupyter_core/version.py
--- old/jupyter_core-4.0.6/jupyter_core/version.py 2015-09-18
10:23:00.000000000 +0200
+++ new/jupyter_core-4.3.0/jupyter_core/version.py 2017-02-13
10:51:58.000000000 +0100
@@ -1,6 +1,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
-version_info = (4, 0, 6)
+version_info = (4, 3, 0)
__version__ = '.'.join(map(str, version_info))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/jupyter_core-4.0.6/setup.py
new/jupyter_core-4.3.0/setup.py
--- old/jupyter_core-4.0.6/setup.py 2015-09-16 14:01:43.000000000 +0200
+++ new/jupyter_core-4.3.0/setup.py 2017-02-13 10:51:58.000000000 +0100
@@ -51,6 +51,7 @@
packages = ['jupyter_core',
'jupyter_core.utils',
'jupyter_core.tests'],
+ py_modules = ['jupyter'],
package_data = package_data,
scripts = glob(pjoin('scripts', '*')),
description = "Jupyter core package. A base package on which
Jupyter projects rely.",
@@ -86,6 +87,7 @@
'console_scripts': [
'jupyter = jupyter_core.command:main',
'jupyter-migrate = jupyter_core.migrate:main',
+ 'jupyter-troubleshoot = jupyter_core.troubleshoot:main',
]
}