##// END OF EJS Templates
Drop support for Python 3.3
Thomas Kluyver -
Show More
@@ -1,54 +1,53 b''
1 1 # http://travis-ci.org/#!/ipython/ipython
2 2 language: python
3 3 python:
4 4 - "nightly"
5 5 - 3.6
6 6 - 3.5
7 7 - 3.4
8 - 3.3
9 8 sudo: false
10 9 env:
11 10 global:
12 11 - PATH=$TRAVIS_BUILD_DIR/pandoc:$PATH
13 12 group: edge
14 13 before_install:
15 14 - 'if [[ $GROUP != js* ]]; then COVERAGE=""; fi'
16 15 install:
17 16 - pip install setuptools pip --upgrade
18 17 - pip install -e file://$PWD#egg=ipython[test] --upgrade
19 18 - pip install codecov --upgrade
20 19 - sudo apt-get install graphviz
21 20 script:
22 21 - cd /tmp && iptest --coverage xml && cd -
23 22 # On the latest Python only, make sure that the docs build.
24 23 - |
25 24 if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then
26 25 pip install -r docs/requirements.txt
27 26 make -C docs/ html SPHINXOPTS="-W"
28 27 fi
29 28 after_success:
30 29 - cp /tmp/ipy_coverage.xml ./
31 30 - cp /tmp/.coverage ./
32 31 - codecov
33 32
34 33 matrix:
35 34 allow_failures:
36 35 - python: nightly
37 36
38 37 before_deploy:
39 38 - rm -rf dist/
40 39 - python setup.py sdist
41 40 - python setup.py bdist_wheel
42 41
43 42 deploy:
44 43 provider: releases
45 44 api_key:
46 45 secure: Y/Ae9tYs5aoBU8bDjN2YrwGG6tCbezj/h3Lcmtx8HQavSbBgXnhnZVRb2snOKD7auqnqjfT/7QMm4ZyKvaOEgyggGktKqEKYHC8KOZ7yp8I5/UMDtk6j9TnXpSqqBxPiud4MDV76SfRYEQiaDoG4tGGvSfPJ9KcNjKrNvSyyxns=
47 46 file: dist/*
48 47 file_glob: true
49 48 skip_cleanup: true
50 49 on:
51 50 repo: ipython/ipython
52 51 all_branches: true # Backports are released from e.g. 5.x branch
53 52 tags: true
54 53 python: 3.6 # Any version should work, but we only need one
@@ -1,151 +1,151 b''
1 1 # encoding: utf-8
2 2 """
3 3 IPython: tools for interactive and parallel computing in Python.
4 4
5 5 http://ipython.org
6 6 """
7 7 #-----------------------------------------------------------------------------
8 8 # Copyright (c) 2008-2011, IPython Development Team.
9 9 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
10 10 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11 11 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
12 12 #
13 13 # Distributed under the terms of the Modified BSD License.
14 14 #
15 15 # The full license is in the file COPYING.txt, distributed with this software.
16 16 #-----------------------------------------------------------------------------
17 17
18 18 #-----------------------------------------------------------------------------
19 19 # Imports
20 20 #-----------------------------------------------------------------------------
21 21
22 22 import os
23 23 import sys
24 24
25 25 #-----------------------------------------------------------------------------
26 26 # Setup everything
27 27 #-----------------------------------------------------------------------------
28 28
29 29 # Don't forget to also update setup.py when this changes!
30 if sys.version_info < (3,3):
30 if sys.version_info < (3,4):
31 31 raise ImportError(
32 32 """
33 IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.
33 IPython 6.3+ supports Python 3.4 and above.
34 34 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
35 Beginning with IPython 6.0, Python 3.3 and above is required.
35 Python 3.3 was supported up to IPython 6.2.
36 36
37 37 See IPython `README.rst` file for more information:
38 38
39 39 https://github.com/ipython/ipython/blob/master/README.rst
40 40
41 41 """)
42 42
43 43 # Make it easy to import extensions - they are always directly on pythonpath.
44 44 # Therefore, non-IPython modules can be added to extensions directory.
45 45 # This should probably be in ipapp.py.
46 46 sys.path.append(os.path.join(os.path.dirname(__file__), "extensions"))
47 47
48 48 #-----------------------------------------------------------------------------
49 49 # Setup the top level names
50 50 #-----------------------------------------------------------------------------
51 51
52 52 from .core.getipython import get_ipython
53 53 from .core import release
54 54 from .core.application import Application
55 55 from .terminal.embed import embed
56 56
57 57 from .core.interactiveshell import InteractiveShell
58 58 from .testing import test
59 59 from .utils.sysinfo import sys_info
60 60 from .utils.frame import extract_module_locals
61 61
62 62 # Release data
63 63 __author__ = '%s <%s>' % (release.author, release.author_email)
64 64 __license__ = release.license
65 65 __version__ = release.version
66 66 version_info = release.version_info
67 67
68 68 def embed_kernel(module=None, local_ns=None, **kwargs):
69 69 """Embed and start an IPython kernel in a given scope.
70 70
71 71 If you don't want the kernel to initialize the namespace
72 72 from the scope of the surrounding function,
73 73 and/or you want to load full IPython configuration,
74 74 you probably want `IPython.start_kernel()` instead.
75 75
76 76 Parameters
77 77 ----------
78 78 module : ModuleType, optional
79 79 The module to load into IPython globals (default: caller)
80 80 local_ns : dict, optional
81 81 The namespace to load into IPython user namespace (default: caller)
82 82
83 83 kwargs : various, optional
84 84 Further keyword args are relayed to the IPKernelApp constructor,
85 85 allowing configuration of the Kernel. Will only have an effect
86 86 on the first embed_kernel call for a given process.
87 87 """
88 88
89 89 (caller_module, caller_locals) = extract_module_locals(1)
90 90 if module is None:
91 91 module = caller_module
92 92 if local_ns is None:
93 93 local_ns = caller_locals
94 94
95 95 # Only import .zmq when we really need it
96 96 from ipykernel.embed import embed_kernel as real_embed_kernel
97 97 real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
98 98
99 99 def start_ipython(argv=None, **kwargs):
100 100 """Launch a normal IPython instance (as opposed to embedded)
101 101
102 102 `IPython.embed()` puts a shell in a particular calling scope,
103 103 such as a function or method for debugging purposes,
104 104 which is often not desirable.
105 105
106 106 `start_ipython()` does full, regular IPython initialization,
107 107 including loading startup files, configuration, etc.
108 108 much of which is skipped by `embed()`.
109 109
110 110 This is a public API method, and will survive implementation changes.
111 111
112 112 Parameters
113 113 ----------
114 114
115 115 argv : list or None, optional
116 116 If unspecified or None, IPython will parse command-line options from sys.argv.
117 117 To prevent any command-line parsing, pass an empty list: `argv=[]`.
118 118 user_ns : dict, optional
119 119 specify this dictionary to initialize the IPython user namespace with particular values.
120 120 kwargs : various, optional
121 121 Any other kwargs will be passed to the Application constructor,
122 122 such as `config`.
123 123 """
124 124 from IPython.terminal.ipapp import launch_new_instance
125 125 return launch_new_instance(argv=argv, **kwargs)
126 126
127 127 def start_kernel(argv=None, **kwargs):
128 128 """Launch a normal IPython kernel instance (as opposed to embedded)
129 129
130 130 `IPython.embed_kernel()` puts a shell in a particular calling scope,
131 131 such as a function or method for debugging purposes,
132 132 which is often not desirable.
133 133
134 134 `start_kernel()` does full, regular IPython initialization,
135 135 including loading startup files, configuration, etc.
136 136 much of which is skipped by `embed()`.
137 137
138 138 Parameters
139 139 ----------
140 140
141 141 argv : list or None, optional
142 142 If unspecified or None, IPython will parse command-line options from sys.argv.
143 143 To prevent any command-line parsing, pass an empty list: `argv=[]`.
144 144 user_ns : dict, optional
145 145 specify this dictionary to initialize the IPython user namespace with particular values.
146 146 kwargs : various, optional
147 147 Any other kwargs will be passed to the Application constructor,
148 148 such as `config`.
149 149 """
150 150 from IPython.kernel.zmq.kernelapp import launch_new_instance
151 151 return launch_new_instance(argv=argv, **kwargs)
@@ -1,266 +1,264 b''
1 1 #!/usr/bin/env python3
2 2 # -*- coding: utf-8 -*-
3 3 """Setup script for IPython.
4 4
5 5 Under Posix environments it works like a typical setup.py script.
6 6 Under Windows, the command sdist is not supported, since IPython
7 7 requires utilities which are not available under Windows."""
8 8
9 9 #-----------------------------------------------------------------------------
10 10 # Copyright (c) 2008-2011, IPython Development Team.
11 11 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
12 12 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
13 13 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
14 14 #
15 15 # Distributed under the terms of the Modified BSD License.
16 16 #
17 17 # The full license is in the file COPYING.rst, distributed with this software.
18 18 #-----------------------------------------------------------------------------
19 19
20 20 from __future__ import print_function
21 21
22 22 import os
23 23 import sys
24 24
25 25 # **Python version check**
26 26 #
27 27 # This check is also made in IPython/__init__, don't forget to update both when
28 28 # changing Python version requirements.
29 if sys.version_info < (3, 3):
29 if sys.version_info < (3, 4):
30 30 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
31 31 try:
32 32 import pip
33 33 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
34 34 if pip_version < (9, 0, 1) :
35 35 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
36 36 'pip {} detected.'.format(pip.__version__)
37 37 else:
38 38 # pip is new enough - it must be something else
39 39 pip_message = ''
40 40 except Exception:
41 41 pass
42 42
43 43
44 44 error = """
45 45 IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.
46 46 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
47 47 Beginning with IPython 6.0, Python 3.3 and above is required.
48 48
49 49 See IPython `README.rst` file for more information:
50 50
51 51 https://github.com/ipython/ipython/blob/master/README.rst
52 52
53 53 Python {py} detected.
54 54 {pip}
55 55 """.format(py=sys.version_info, pip=pip_message )
56 56
57 57 print(error, file=sys.stderr)
58 58 sys.exit(1)
59 59
60 60 # At least we're on the python version we need, move on.
61 61
62 62 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
63 63 # update it when the contents of directories change.
64 64 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
65 65
66 66 from distutils.core import setup
67 67
68 68 # Our own imports
69 69 from setupbase import target_update
70 70
71 71 from setupbase import (
72 72 setup_args,
73 73 find_packages,
74 74 find_package_data,
75 75 check_package_data_first,
76 76 find_entry_points,
77 77 build_scripts_entrypt,
78 78 find_data_files,
79 79 git_prebuild,
80 80 install_symlinked,
81 81 install_lib_symlink,
82 82 install_scripts_for_symlink,
83 83 unsymlink,
84 84 )
85 85
86 86 isfile = os.path.isfile
87 87 pjoin = os.path.join
88 88
89 89 #-------------------------------------------------------------------------------
90 90 # Handle OS specific things
91 91 #-------------------------------------------------------------------------------
92 92
93 93 if os.name in ('nt','dos'):
94 94 os_name = 'windows'
95 95 else:
96 96 os_name = os.name
97 97
98 98 # Under Windows, 'sdist' has not been supported. Now that the docs build with
99 99 # Sphinx it might work, but let's not turn it on until someone confirms that it
100 100 # actually works.
101 101 if os_name == 'windows' and 'sdist' in sys.argv:
102 102 print('The sdist command is not available under Windows. Exiting.')
103 103 sys.exit(1)
104 104
105 105
106 106 #-------------------------------------------------------------------------------
107 107 # Things related to the IPython documentation
108 108 #-------------------------------------------------------------------------------
109 109
110 110 # update the manuals when building a source dist
111 111 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
112 112
113 113 # List of things to be updated. Each entry is a triplet of args for
114 114 # target_update()
115 115 to_update = [
116 116 ('docs/man/ipython.1.gz',
117 117 ['docs/man/ipython.1'],
118 118 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
119 119 ]
120 120
121 121
122 122 [ target_update(*t) for t in to_update ]
123 123
124 124 #---------------------------------------------------------------------------
125 125 # Find all the packages, package data, and data_files
126 126 #---------------------------------------------------------------------------
127 127
128 128 packages = find_packages()
129 129 package_data = find_package_data()
130 130
131 131 data_files = find_data_files()
132 132
133 133 setup_args['packages'] = packages
134 134 setup_args['package_data'] = package_data
135 135 setup_args['data_files'] = data_files
136 136
137 137 #---------------------------------------------------------------------------
138 138 # custom distutils commands
139 139 #---------------------------------------------------------------------------
140 140 # imports here, so they are after setuptools import if there was one
141 141 from distutils.command.sdist import sdist
142 142
143 143 setup_args['cmdclass'] = {
144 144 'build_py': \
145 145 check_package_data_first(git_prebuild('IPython')),
146 146 'sdist' : git_prebuild('IPython', sdist),
147 147 'symlink': install_symlinked,
148 148 'install_lib_symlink': install_lib_symlink,
149 149 'install_scripts_sym': install_scripts_for_symlink,
150 150 'unsymlink': unsymlink,
151 151 }
152 152
153 153
154 154 #---------------------------------------------------------------------------
155 155 # Handle scripts, dependencies, and setuptools specific things
156 156 #---------------------------------------------------------------------------
157 157
158 158 # For some commands, use setuptools. Note that we do NOT list install here!
159 159 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
160 160 needs_setuptools = {'develop', 'release', 'bdist_egg', 'bdist_rpm',
161 161 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel',
162 162 'egg_info', 'easy_install', 'upload', 'install_egg_info',
163 163 }
164 164
165 165 if len(needs_setuptools.intersection(sys.argv)) > 0:
166 166 import setuptools
167 167
168 168 # This dict is used for passing extra arguments that are setuptools
169 169 # specific to setup
170 170 setuptools_extra_args = {}
171 171
172 172 # setuptools requirements
173 173
174 174 extras_require = dict(
175 175 parallel = ['ipyparallel'],
176 176 qtconsole = ['qtconsole'],
177 177 doc = ['Sphinx>=1.3'],
178 test = ['nose>=0.10.1', 'requests', 'testpath', 'pygments', 'nbformat', 'ipykernel'],
178 test = ['nose>=0.10.1', 'requests', 'testpath', 'pygments', 'nbformat', 'ipykernel', 'numpy'],
179 179 terminal = [],
180 180 kernel = ['ipykernel'],
181 181 nbformat = ['nbformat'],
182 182 notebook = ['notebook', 'ipywidgets'],
183 183 nbconvert = ['nbconvert'],
184 184 )
185 185
186 186 install_requires = [
187 187 'setuptools>=18.5',
188 188 'jedi>=0.10',
189 189 'decorator',
190 190 'pickleshare',
191 191 'simplegeneric>0.8',
192 192 'traitlets>=4.2',
193 193 'prompt_toolkit>=1.0.15,<2.0.0',
194 194 'pygments',
195 195 'backcall',
196 196 ]
197 197
198 198 # Platform-specific dependencies:
199 199 # This is the correct way to specify these,
200 200 # but requires pip >= 6. pip < 6 ignores these.
201 201
202 202 extras_require.update({
203 'test:python_version >= "3.4"': ['numpy'],
204 ':python_version == "3.3"': ['pathlib2'],
205 203 ':python_version <= "3.4"': ['typing'],
206 204 ':sys_platform != "win32"': ['pexpect'],
207 205 ':sys_platform == "darwin"': ['appnope'],
208 206 ':sys_platform == "win32"': ['colorama'],
209 207 ':sys_platform == "win32" and python_version < "3.6"': ['win_unicode_console>=0.5'],
210 208 })
211 209 # FIXME: re-specify above platform dependencies for pip < 6
212 210 # These would result in non-portable bdists.
213 211 if not any(arg.startswith('bdist') for arg in sys.argv):
214 212 if sys.platform == 'darwin':
215 213 install_requires.extend(['appnope'])
216 214
217 215 if not sys.platform.startswith('win'):
218 216 install_requires.append('pexpect')
219 217
220 218 # workaround pypa/setuptools#147, where setuptools misspells
221 219 # platform_python_implementation as python_implementation
222 220 if 'setuptools' in sys.modules:
223 221 for key in list(extras_require):
224 222 if 'platform_python_implementation' in key:
225 223 new_key = key.replace('platform_python_implementation', 'python_implementation')
226 224 extras_require[new_key] = extras_require.pop(key)
227 225
228 226 everything = set()
229 227 for key, deps in extras_require.items():
230 228 if ':' not in key:
231 229 everything.update(deps)
232 230 extras_require['all'] = everything
233 231
234 232 if 'setuptools' in sys.modules:
235 setuptools_extra_args['python_requires'] = '>=3.3'
233 setuptools_extra_args['python_requires'] = '>=3.4'
236 234 setuptools_extra_args['zip_safe'] = False
237 235 setuptools_extra_args['entry_points'] = {
238 236 'console_scripts': find_entry_points(),
239 237 'pygments.lexers': [
240 238 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer',
241 239 'ipython = IPython.lib.lexers:IPythonLexer',
242 240 'ipython3 = IPython.lib.lexers:IPython3Lexer',
243 241 ],
244 242 }
245 243 setup_args['extras_require'] = extras_require
246 244 setup_args['install_requires'] = install_requires
247 245
248 246 else:
249 247 # scripts has to be a non-empty list, or install_scripts isn't called
250 248 setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()]
251 249
252 250 setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt
253 251
254 252 #---------------------------------------------------------------------------
255 253 # Do the actual setup now
256 254 #---------------------------------------------------------------------------
257 255
258 256 setup_args.update(setuptools_extra_args)
259 257
260 258
261 259
262 260 def main():
263 261 setup(**setup_args)
264 262
265 263 if __name__ == '__main__':
266 264 main()
General Comments 0
You need to be logged in to leave comments. Login now