Codebase list jupyter-console / upstream/6.4.0
New upstream version 6.4.0 Gordon Ball 2 years ago
17 changed file(s) with 56 addition(s) and 198 deletion(s). Raw diff Collapse all Expand all
00 [bumpversion]
1 current_version = 6.2.0
1 current_version = 6.4.0
22 parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(.(?P<suffix>.+))?
33 serialize =
44 {major}.{minor}.{patch}.{suffix}
1515 serialize =
1616 {major}, {minor}, {patch}, '{suffix}'
1717 {major}, {minor}, {patch}
18
2424 python-version: ${{ matrix.python-version }}
2525 - name: Install dependencies
2626 run: |
27 python -m pip install --upgrade pip
28 pip install pytest nose
27 python -m pip install --upgrade pip check-manifest
28 pip install pytest pytest-cov
2929 pip install .
3030 python -m ipykernel.kernelspec --user
3131 - name: Test with pytest
3232 run: |
33 pytest
33 pytest --cov jupyter_console
34 - name: Check Manifest
35 run: |
36 check-manifest
+0
-20
.travis.yml less more
0 language: python
1 python:
2 - 3.7
3 - 3.8
4 before_install:
5 - git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels
6 install:
7 - pip install --upgrade pip
8 - pip install --upgrade setuptools
9 - pip install mypy darker pep517 check-manifest
10 - pip install -f travis-wheels/wheelhouse --pre -e . coveralls
11 - python -m ipykernel.kernelspec --user
12 script:
13 - python -m pep517.build .
14 - check-manifest
15 - nosetests --with-coverage --cover-package=jupyter_console jupyter_console
16 - darker -r ac4cf65598ea417f6b69a80c162904bbce7547b3 jupyter_console
17 - mypy jupyter_console
18 after_success:
19 - coveralls
+0
-21
PKG-INFO less more
0 Metadata-Version: 2.1
1 Name: jupyter_console
2 Version: 6.2.0
3 Summary: Jupyter terminal console
4 Home-page: https://jupyter.org
5 Author: Jupyter Development Team
6 Author-email: jupyter@googlegroups.com
7 License: BSD
8 Description: An IPython-like terminal frontend for Jupyter kernels in any language.
9 Keywords: Interactive,Interpreter,Shell,Web
10 Platform: Linux
11 Platform: Mac OS X
12 Platform: Windows
13 Classifier: Intended Audience :: Developers
14 Classifier: Intended Audience :: System Administrators
15 Classifier: Intended Audience :: Science/Research
16 Classifier: License :: OSI Approved :: BSD License
17 Classifier: Programming Language :: Python
18 Classifier: Programming Language :: Python :: 3
19 Requires-Python: >=3.6
20 Provides-Extra: test
44 See PEP 440 https://www.python.org/dev/peps/pep-0440/
55 """
66
7 version_info = (6, 2, 0)
7 version_info = (6, 4, 0)
88
99 __version__ = '.'.join(map(str, version_info[:3])) + ''.join(version_info[3:])
88
99 from __future__ import print_function
1010
11 import logging
1211 import signal
1312 import sys
1413
1716 )
1817 from traitlets.config import catch_config_error, boolean_flag
1918
20 from jupyter_core.application import JupyterApp, base_aliases, base_flags, NoStart
19 from jupyter_core.application import JupyterApp, base_aliases, base_flags
2120 from jupyter_client.consoleapp import (
2221 JupyterConsoleApp, app_aliases, app_flags,
2322 )
140139 def init_banner(self):
141140 """optionally display the banner"""
142141 self.shell.show_banner()
143 # Make sure there is a space below the banner.
144 #if self.log_level <= logging.INFO: print()
145142
146143 def start(self):
147144 # JupyterApp.start dispatches on NoStart
1010 import signal
1111 import subprocess
1212 import sys
13 from tempfile import TemporaryDirectory
1314 import time
1415 from warnings import warn
1516
1718
1819 from zmq import ZMQError
1920 from IPython.core import page
20 from ipython_genutils.tempdir import NamedFileInTemporaryDirectory
2121 from traitlets import (
2222 Bool,
2323 Integer,
5555 is_done,
5656 )
5757 from prompt_toolkit.history import InMemoryHistory
58 from prompt_toolkit.patch_stdout import patch_stdout
5958 from prompt_toolkit.shortcuts.prompt import PromptSession
6059 from prompt_toolkit.shortcuts import print_formatted_text, CompleteStyle
6160 from prompt_toolkit.key_binding import KeyBindings
6766 from prompt_toolkit.styles import merge_styles
6867 from prompt_toolkit.styles.pygments import (style_from_pygments_cls,
6968 style_from_pygments_dict)
70 from prompt_toolkit.formatted_text import PygmentsTokens, FormattedText
69 from prompt_toolkit.formatted_text import PygmentsTokens
7170 from prompt_toolkit.output import ColorDepth
7271 from prompt_toolkit.utils import suspend_to_background_supported
7372
159158 ):
160159 new_meta[c] = m["type"]
161160 meta = new_meta
162 except:
161 except Exception:
163162 pass
164163
165164 start_pos = content["cursor_start"] - document.cursor_position
747746 content = msg["content"]
748747 status = content['status']
749748
750 if status == 'aborted':
751 self.write('Aborted\n')
749 if status == "aborted":
750 sys.stdout.write("Aborted\n")
752751 return
753752 elif status == 'ok':
754753 # handle payloads
852851 while self.client.iopub_channel.msg_ready():
853852 sub_msg = self.client.iopub_channel.get_msg()
854853 msg_type = sub_msg['header']['msg_type']
855 parent = sub_msg["parent_header"]
856854
857855 # Update execution_count in case it changed in another session
858856 if msg_type == "execute_input":
976974 imageformat = self._imagemime[mime]
977975 fmt = dict(format=imageformat)
978976 args = [s.format(**fmt) for s in self.stream_image_handler]
979 with open(os.devnull, 'w') as devnull:
980 proc = subprocess.Popen(
981 args, stdin=subprocess.PIPE,
982 stdout=devnull, stderr=devnull)
977 with subprocess.Popen(args, stdin=subprocess.PIPE,
978 stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) as proc:
983979 proc.communicate(raw)
984 return (proc.returncode == 0)
980 return (proc.returncode == 0)
985981
986982 def handle_image_tempfile(self, data, mime):
987983 raw = base64.decodebytes(data[mime].encode('ascii'))
988984 imageformat = self._imagemime[mime]
989985 filename = 'tmp.{0}'.format(imageformat)
990 with NamedFileInTemporaryDirectory(filename) as f, \
991 open(os.devnull, 'w') as devnull:
992 f.write(raw)
993 f.flush()
994 fmt = dict(file=f.name, format=imageformat)
986 with TemporaryDirectory() as tempdir:
987 fullpath = os.path.join(tempdir, filename)
988 with open(fullpath, 'wb') as f:
989 f.write(raw)
990 fmt = dict(file=fullpath, format=imageformat)
995991 args = [s.format(**fmt) for s in self.tempfile_image_handler]
996 rc = subprocess.call(args, stdout=devnull, stderr=devnull)
992 rc = subprocess.call(args, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
997993 return (rc == 0)
998994
999995 def handle_image_callable(self, data, mime):
88 import tempfile
99 from subprocess import check_output
1010
11 from nose import SkipTest
11 import pytest
1212
1313 from traitlets.tests.utils import check_help_all_output
14 from ipython_genutils.testing import decorators as dec
1514
16 @dec.skip_win32
15
16 @pytest.mark.xfail
17 @pytest.mark.skipif(sys.platform == "win32", reason="skip on windows")
1718 def test_console_starts():
1819 """test that `jupyter console` starts a terminal"""
1920 p, pexpect, t = start_console()
20 p.sendline('5')
21 idx = p.expect([r'Out\[\d+\]: 5', pexpect.EOF], timeout=t)
22 idx = p.expect([r'In \[\d+\]', pexpect.EOF], timeout=t)
21 p.sendline("5")
22 p.expect([r"Out\[\d+\]: 5", pexpect.EOF], timeout=t)
23 p.expect([r"In \[\d+\]", pexpect.EOF], timeout=t)
2324 stop_console(p, pexpect, t)
2425
2526 def test_help_output():
2627 """jupyter console --help-all works"""
2728 check_help_all_output('jupyter_console')
2829
30 @pytest.mark.xfail
2931 def test_display_text():
3032 "Ensure display protocol plain/text key is supported"
3133 # equivalent of:
6365 try:
6466 p = pexpect.spawn(cmd, args=args, env=env)
6567 except IOError:
66 raise SkipTest("Couldn't find command %s" % cmd)
68 pytest.skip("Couldn't find command %s" % cmd)
6769
6870 # timeout after one minute
6971 t = 60
70 idx = p.expect(r'In \[\d+\]', timeout=t)
72 p.expect(r"In \[\d+\]", timeout=t)
7173 return p, pexpect, t
7274
7375
00 # Copyright (c) IPython Development Team.
11 # Distributed under the terms of the Modified BSD License.
22
3 import base64
34 import os
45 import sys
6 from tempfile import TemporaryDirectory
57 import unittest
6 import base64
7
88 from unittest.mock import patch
99
10 import pytest
11
1012 from jupyter_console.ptshell import ZMQTerminalInteractiveShell
11 from ipython_genutils.tempdir import TemporaryDirectory
12 from ipython_genutils.testing.decorators import skip_without
13 from ipython_genutils.ipstruct import Struct
1413
1514
1615 SCRIPT_PATH = os.path.join(
3231
3332 def test_call_pil_by_default(self):
3433 pil_called_with = []
34
3535 def pil_called(data, mime):
3636 pil_called_with.append(data)
3737
4747 shell.handle_image(None, None) # arguments are dummy
4848 assert len(pil_called_with) == 1
4949
50 @skip_without('PIL')
5150 def test_handle_image_PIL(self):
51 pytest.importorskip('PIL')
5252 from PIL import Image, ImageShow
5353
5454 open_called_with = []
+0
-21
jupyter_console.egg-info/PKG-INFO less more
0 Metadata-Version: 2.1
1 Name: jupyter-console
2 Version: 6.2.0
3 Summary: Jupyter terminal console
4 Home-page: https://jupyter.org
5 Author: Jupyter Development Team
6 Author-email: jupyter@googlegroups.com
7 License: BSD
8 Description: An IPython-like terminal frontend for Jupyter kernels in any language.
9 Keywords: Interactive,Interpreter,Shell,Web
10 Platform: Linux
11 Platform: Mac OS X
12 Platform: Windows
13 Classifier: Intended Audience :: Developers
14 Classifier: Intended Audience :: System Administrators
15 Classifier: Intended Audience :: Science/Research
16 Classifier: License :: OSI Approved :: BSD License
17 Classifier: Programming Language :: Python
18 Classifier: Programming Language :: Python :: 3
19 Requires-Python: >=3.6
20 Provides-Extra: test
+0
-44
jupyter_console.egg-info/SOURCES.txt less more
0 .bumpversion.cfg
1 .gitignore
2 .mailmap
3 .travis.yml
4 CONTRIBUTING.md
5 COPYING.md
6 MANIFEST.in
7 README.md
8 RELEASING.md
9 mypy.ini
10 pyproject.toml
11 pytest.ini
12 readthedocs.yml
13 setup.cfg
14 setup.py
15 .github/workflows/python-package.yml
16 docs/Makefile
17 docs/autogen_config.py
18 docs/changelog.rst
19 docs/conf.py
20 docs/environment.yml
21 docs/index.rst
22 docs/make.bat
23 docs/release.rst
24 docs/requirements.txt
25 jupyter_console/__init__.py
26 jupyter_console/__main__.py
27 jupyter_console/_version.py
28 jupyter_console/app.py
29 jupyter_console/completer.py
30 jupyter_console/ptshell.py
31 jupyter_console/zmqhistory.py
32 jupyter_console.egg-info/PKG-INFO
33 jupyter_console.egg-info/SOURCES.txt
34 jupyter_console.egg-info/dependency_links.txt
35 jupyter_console.egg-info/entry_points.txt
36 jupyter_console.egg-info/requires.txt
37 jupyter_console.egg-info/top_level.txt
38 jupyter_console/tests/__init__.py
39 jupyter_console/tests/conftest.py
40 jupyter_console/tests/test_console.py
41 jupyter_console/tests/test_image_handler.py
42 jupyter_console/tests/writetofile.py
43 scripts/jupyter-console
+0
-1
jupyter_console.egg-info/dependency_links.txt less more
0
+0
-3
jupyter_console.egg-info/entry_points.txt less more
0 [console_scripts]
1 jupyter-console = jupyter_console.app:main
2
+0
-8
jupyter_console.egg-info/requires.txt less more
0 jupyter_client
1 ipython
2 ipykernel
3 prompt_toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0
4 pygments
5
6 [test:sys_platform != "win32"]
7 pexpect
+0
-1
jupyter_console.egg-info/top_level.txt less more
0 jupyter_console
00 [flake8]
11 max-line-length = 99
2 ignore = W291, E266, E265, E128, E251, E402, E124, E302, W293, E231, E222, W503, E126, E121, W391, E226, E127, W504
23
34 [metadata]
45 license_file = COPYING.md
5
6 [egg_info]
7 tag_build =
8 tag_date = 0
9
3131
3232
3333 error = """
34 Jupyter_Console 6.0+ supports Python 3.5 and above.
34 Jupyter_Console 6.2+ supports Python 3.6 and above.
3535 When using Python 2.7, please install and older version of Jupyter Console
3636 Python 3.3 and 3.4 were supported up to Jupyter Console 5.x.
37 Python 3.5 was supported up to Jupyter Console 6.1.0.
3738
3839 Python {py} detected.
3940 {pip}
4849 #-----------------------------------------------------------------------------
4950
5051 import os
51 from glob import glob
5252
5353 from setuptools import setup
5454
6969 setup_args = dict(
7070 name = name,
7171 version = version_ns['__version__'],
72 scripts = glob(pjoin('scripts', '*')),
7372 packages = packages,
7473 description = "Jupyter terminal console",
7574 long_description= "An IPython-like terminal frontend for Jupyter kernels in any language.",
8786 'Programming Language :: Python',
8887 'Programming Language :: Python :: 3',
8988 ],
90 )
91
92 if 'develop' in sys.argv or any(a.startswith('bdist') for a in sys.argv):
93 import setuptools
94
95 setuptools_args = {}
96 install_requires = setuptools_args['install_requires'] = [
97 'jupyter_client',
98 'ipython',
99 'ipykernel', # bless IPython kernel for now
100 'prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1',
101 'pygments',
102 ]
103
104 extras_require = setuptools_args['extras_require'] = {
105 'test:sys_platform != "win32"': ['pexpect'],
106
107
108 }
109
110 setuptools_args['python_requires'] = '>=3.6'
111
112
113 setuptools_args['entry_points'] = {
89 install_requires=[
90 'jupyter_client',
91 'ipython',
92 'ipykernel', # bless IPython kernel for now
93 'prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1',
94 'pygments',
95 ],
96 extras_require={
97 'test:sys_platform != "win32"': ['pexpect'],
98 },
99 python_requires='>=3.6',
100 entry_points={
114101 'console_scripts': [
115102 'jupyter-console = jupyter_console.app:main',
116103 ]
117 }
118
119 if 'setuptools' in sys.modules:
120 setup_args.update(setuptools_args)
121 setup_args.pop('scripts')
104 }
105 )
122106
123107
124108 if __name__ == '__main__':