##// END OF EJS Templates
Stop support for 3.7 on the master branch....
Matthias Bussonnier -
Show More
@@ -1,60 +1,60 b''
1 1 name: Run tests
2 2
3 3 on:
4 4 push:
5 5 pull_request:
6 6 # Run weekly on Monday at 1:23 UTC
7 7 schedule:
8 8 - cron: '23 1 * * 1'
9 9 workflow_dispatch:
10 10
11 11
12 12 jobs:
13 13 test:
14 14 runs-on: ${{ matrix.os }}
15 15 strategy:
16 16 matrix:
17 17 os: [ubuntu-latest, windows-latest]
18 python-version: ["3.7", "3.8", "3.9", "3.10"]
18 python-version: ["3.8", "3.9", "3.10"]
19 19 deps: [test_extra]
20 20 # Test all on ubuntu, test ends on macos
21 21 include:
22 22 - os: macos-latest
23 python-version: "3.7"
23 python-version: "3.8"
24 24 deps: test_extra
25 25 - os: macos-latest
26 26 python-version: "3.10"
27 27 deps: test_extra
28 28 # Tests minimal dependencies set
29 29 - os: ubuntu-latest
30 30 python-version: "3.10"
31 31 deps: test
32 32 # Tests latest development Python version
33 33 - os: ubuntu-latest
34 34 python-version: "3.11-dev"
35 35 deps: test
36 36
37 37 steps:
38 38 - uses: actions/checkout@v2
39 39 - name: Set up Python ${{ matrix.python-version }}
40 40 uses: actions/setup-python@v2
41 41 with:
42 42 python-version: ${{ matrix.python-version }}
43 43 - name: Install latex
44 44 if: runner.os == 'Linux' && matrix.deps == 'test_extra'
45 45 run: sudo apt-get -yq -o Acquire::Retries=3 --no-install-suggests --no-install-recommends install texlive dvipng
46 46 - name: Install and update Python dependencies
47 47 run: |
48 48 python -m pip install --upgrade pip setuptools wheel
49 49 python -m pip install --upgrade -e .[${{ matrix.deps }}]
50 50 python -m pip install --upgrade check-manifest pytest-cov
51 51 - name: Check manifest
52 52 if: runner.os != 'Windows' # setup.py does not support sdist on Windows
53 53 run: check-manifest
54 54 - name: pytest
55 55 env:
56 56 COLUMNS: 120
57 57 run: |
58 58 pytest --color=yes -ra -v --cov --cov-report=xml
59 59 - name: Upload coverage to Codecov
60 60 uses: codecov/codecov-action@v2
@@ -1,143 +1,144 b''
1 # encoding: utf-8
2 1 """
3 2 IPython: tools for interactive and parallel computing in Python.
4 3
5 4 https://ipython.org
6 5 """
7 6 #-----------------------------------------------------------------------------
8 7 # Copyright (c) 2008-2011, IPython Development Team.
9 8 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
10 9 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11 10 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
12 11 #
13 12 # Distributed under the terms of the Modified BSD License.
14 13 #
15 14 # The full license is in the file COPYING.txt, distributed with this software.
16 15 #-----------------------------------------------------------------------------
17 16
18 17 #-----------------------------------------------------------------------------
19 18 # Imports
20 19 #-----------------------------------------------------------------------------
21 20
22 21 import os
23 22 import sys
24 23
25 24 #-----------------------------------------------------------------------------
26 25 # Setup everything
27 26 #-----------------------------------------------------------------------------
28 27
29 28 # Don't forget to also update setup.py when this changes!
30 if sys.version_info < (3, 6):
29 if sys.version_info < (3, 8):
31 30 raise ImportError(
32 31 """
33 IPython 7.10+ supports Python 3.6 and above.
32 IPython 8+ supports Python 3.8 and above, following NEP 29.
34 33 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
35 34 Python 3.3 and 3.4 were supported up to IPython 6.x.
36 35 Python 3.5 was supported with IPython 7.0 to 7.9.
36 Python 3.6 was supported with IPython up to 7.16.
37 Python 3.7 was still supported with the 7.x branch.
37 38
38 39 See IPython `README.rst` file for more information:
39 40
40 41 https://github.com/ipython/ipython/blob/master/README.rst
41 42
42 43 """)
43 44
44 45 #-----------------------------------------------------------------------------
45 46 # Setup the top level names
46 47 #-----------------------------------------------------------------------------
47 48
48 49 from .core.getipython import get_ipython
49 50 from .core import release
50 51 from .core.application import Application
51 52 from .terminal.embed import embed
52 53
53 54 from .core.interactiveshell import InteractiveShell
54 55 from .utils.sysinfo import sys_info
55 56 from .utils.frame import extract_module_locals
56 57
57 58 # Release data
58 59 __author__ = '%s <%s>' % (release.author, release.author_email)
59 60 __license__ = release.license
60 61 __version__ = release.version
61 62 version_info = release.version_info
62 63
63 64 def embed_kernel(module=None, local_ns=None, **kwargs):
64 65 """Embed and start an IPython kernel in a given scope.
65 66
66 67 If you don't want the kernel to initialize the namespace
67 68 from the scope of the surrounding function,
68 69 and/or you want to load full IPython configuration,
69 70 you probably want `IPython.start_kernel()` instead.
70 71
71 72 Parameters
72 73 ----------
73 74 module : types.ModuleType, optional
74 75 The module to load into IPython globals (default: caller)
75 76 local_ns : dict, optional
76 77 The namespace to load into IPython user namespace (default: caller)
77 78 **kwargs : various, optional
78 79 Further keyword args are relayed to the IPKernelApp constructor,
79 80 allowing configuration of the Kernel. Will only have an effect
80 81 on the first embed_kernel call for a given process.
81 82 """
82 83
83 84 (caller_module, caller_locals) = extract_module_locals(1)
84 85 if module is None:
85 86 module = caller_module
86 87 if local_ns is None:
87 88 local_ns = caller_locals
88 89
89 90 # Only import .zmq when we really need it
90 91 from ipykernel.embed import embed_kernel as real_embed_kernel
91 92 real_embed_kernel(module=module, local_ns=local_ns, **kwargs)
92 93
93 94 def start_ipython(argv=None, **kwargs):
94 95 """Launch a normal IPython instance (as opposed to embedded)
95 96
96 97 `IPython.embed()` puts a shell in a particular calling scope,
97 98 such as a function or method for debugging purposes,
98 99 which is often not desirable.
99 100
100 101 `start_ipython()` does full, regular IPython initialization,
101 102 including loading startup files, configuration, etc.
102 103 much of which is skipped by `embed()`.
103 104
104 105 This is a public API method, and will survive implementation changes.
105 106
106 107 Parameters
107 108 ----------
108 109 argv : list or None, optional
109 110 If unspecified or None, IPython will parse command-line options from sys.argv.
110 111 To prevent any command-line parsing, pass an empty list: `argv=[]`.
111 112 user_ns : dict, optional
112 113 specify this dictionary to initialize the IPython user namespace with particular values.
113 114 **kwargs : various, optional
114 115 Any other kwargs will be passed to the Application constructor,
115 116 such as `config`.
116 117 """
117 118 from IPython.terminal.ipapp import launch_new_instance
118 119 return launch_new_instance(argv=argv, **kwargs)
119 120
120 121 def start_kernel(argv=None, **kwargs):
121 122 """Launch a normal IPython kernel instance (as opposed to embedded)
122 123
123 124 `IPython.embed_kernel()` puts a shell in a particular calling scope,
124 125 such as a function or method for debugging purposes,
125 126 which is often not desirable.
126 127
127 128 `start_kernel()` does full, regular IPython initialization,
128 129 including loading startup files, configuration, etc.
129 130 much of which is skipped by `embed()`.
130 131
131 132 Parameters
132 133 ----------
133 134 argv : list or None, optional
134 135 If unspecified or None, IPython will parse command-line options from sys.argv.
135 136 To prevent any command-line parsing, pass an empty list: `argv=[]`.
136 137 user_ns : dict, optional
137 138 specify this dictionary to initialize the IPython user namespace with particular values.
138 139 **kwargs : various, optional
139 140 Any other kwargs will be passed to the Application constructor,
140 141 such as `config`.
141 142 """
142 143 from IPython.kernel.zmq.kernelapp import launch_new_instance
143 144 return launch_new_instance(argv=argv, **kwargs)
@@ -1,28 +1,27 b''
1 1 build: false
2 2 matrix:
3 3 fast_finish: true # immediately finish build once one of the jobs fails.
4 4
5 5 environment:
6 6 global:
7 7 APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022'
8 8 COLUMNS: 120 # Appveyor web viwer window width is 130 chars
9 9
10 10 matrix:
11
12 11 - PYTHON: "C:\\Python38"
13 12 PYTHON_VERSION: "3.8.x"
14 13 PYTHON_ARCH: "32"
15 14
16 15 init:
17 16 - "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
18 17
19 18 install:
20 19 - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
21 20 - python -m pip install --upgrade setuptools pip
22 21 - pip install pytest-cov
23 22 - pip install -e .[test_extra]
24 23 test_script:
25 24 - pytest --color=yes -ra --cov --cov-report=xml
26 25 on_finish:
27 26 - curl -Os https://uploader.codecov.io/latest/windows/codecov.exe
28 27 - codecov -e PYTHON_VERSION,PYTHON_ARCH
@@ -1,279 +1,280 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 import os
21 21 import sys
22 22 from pathlib import Path
23 23
24 24 # **Python version check**
25 25 #
26 26 # This check is also made in IPython/__init__, don't forget to update both when
27 27 # changing Python version requirements.
28 if sys.version_info < (3, 7):
28 if sys.version_info < (3, 8):
29 29 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
30 30 try:
31 31 import pip
32 32 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
33 33 if pip_version < (9, 0, 1) :
34 34 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
35 35 'pip {} detected.'.format(pip.__version__)
36 36 else:
37 37 # pip is new enough - it must be something else
38 38 pip_message = ''
39 39 except Exception:
40 40 pass
41 41
42 42
43 43 error = """
44 IPython 7.17+ supports Python 3.7 and above, following NEP 29.
44 IPython 8+ supports Python 3.8 and above, following NEP 29.
45 45 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
46 46 Python 3.3 and 3.4 were supported up to IPython 6.x.
47 47 Python 3.5 was supported with IPython 7.0 to 7.9.
48 48 Python 3.6 was supported with IPython up to 7.16.
49 Python 3.7 was still supported with the 7.x branch.
49 50
50 51 See IPython `README.rst` file for more information:
51 52
52 53 https://github.com/ipython/ipython/blob/master/README.rst
53 54
54 55 Python {py} detected.
55 56 {pip}
56 57 """.format(py=sys.version_info, pip=pip_message )
57 58
58 59 print(error, file=sys.stderr)
59 60 sys.exit(1)
60 61
61 62 # At least we're on the python version we need, move on.
62 63
63 64 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
64 65 # update it when the contents of directories change.
65 66 if Path("MANIFEST").exists():
66 67 Path("MANIFEST").unlink()
67 68
68 69 from distutils.core import setup
69 70
70 71 # Our own imports
71 72 from setupbase import target_update
72 73
73 74 from setupbase import (
74 75 setup_args,
75 76 find_packages,
76 77 find_package_data,
77 78 check_package_data_first,
78 79 find_entry_points,
79 80 build_scripts_entrypt,
80 81 find_data_files,
81 82 git_prebuild,
82 83 install_symlinked,
83 84 install_lib_symlink,
84 85 install_scripts_for_symlink,
85 86 unsymlink,
86 87 )
87 88
88 89 #-------------------------------------------------------------------------------
89 90 # Handle OS specific things
90 91 #-------------------------------------------------------------------------------
91 92
92 93 if os.name in ('nt','dos'):
93 94 os_name = 'windows'
94 95 else:
95 96 os_name = os.name
96 97
97 98 # Under Windows, 'sdist' has not been supported. Now that the docs build with
98 99 # Sphinx it might work, but let's not turn it on until someone confirms that it
99 100 # actually works.
100 101 if os_name == 'windows' and 'sdist' in sys.argv:
101 102 print('The sdist command is not available under Windows. Exiting.')
102 103 sys.exit(1)
103 104
104 105
105 106 #-------------------------------------------------------------------------------
106 107 # Things related to the IPython documentation
107 108 #-------------------------------------------------------------------------------
108 109
109 110 # update the manuals when building a source dist
110 111 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
111 112
112 113 # List of things to be updated. Each entry is a triplet of args for
113 114 # target_update()
114 115 to_update = [
115 116 ('docs/man/ipython.1.gz',
116 117 ['docs/man/ipython.1'],
117 118 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
118 119 ]
119 120
120 121
121 122 [ target_update(*t) for t in to_update ]
122 123
123 124 #---------------------------------------------------------------------------
124 125 # Find all the packages, package data, and data_files
125 126 #---------------------------------------------------------------------------
126 127
127 128 packages = find_packages()
128 129 package_data = find_package_data()
129 130
130 131 data_files = find_data_files()
131 132
132 133 setup_args['packages'] = packages
133 134 setup_args['package_data'] = package_data
134 135 setup_args['data_files'] = data_files
135 136
136 137 #---------------------------------------------------------------------------
137 138 # custom distutils commands
138 139 #---------------------------------------------------------------------------
139 140 # imports here, so they are after setuptools import if there was one
140 141 from distutils.command.sdist import sdist
141 142
142 143 setup_args['cmdclass'] = {
143 144 'build_py': \
144 145 check_package_data_first(git_prebuild('IPython')),
145 146 'sdist' : git_prebuild('IPython', sdist),
146 147 'symlink': install_symlinked,
147 148 'install_lib_symlink': install_lib_symlink,
148 149 'install_scripts_sym': install_scripts_for_symlink,
149 150 'unsymlink': unsymlink,
150 151 }
151 152
152 153
153 154 #---------------------------------------------------------------------------
154 155 # Handle scripts, dependencies, and setuptools specific things
155 156 #---------------------------------------------------------------------------
156 157
157 158 # For some commands, use setuptools. Note that we do NOT list install here!
158 159 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
159 160 needs_setuptools = {'develop', 'release', 'bdist_egg', 'bdist_rpm',
160 161 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel',
161 162 'egg_info', 'easy_install', 'upload', 'install_egg_info',
162 163 }
163 164
164 165 if len(needs_setuptools.intersection(sys.argv)) > 0:
165 166 import setuptools
166 167
167 168 # This dict is used for passing extra arguments that are setuptools
168 169 # specific to setup
169 170 setuptools_extra_args = {}
170 171
171 172 # setuptools requirements
172 173
173 174 extras_require = dict(
174 175 parallel=["ipyparallel"],
175 176 qtconsole=["qtconsole"],
176 177 doc=["Sphinx>=1.3"],
177 178 test=[
178 179 "pytest",
179 180 "testpath",
180 181 "pygments",
181 182 ],
182 183 test_extra=[
183 184 "pytest",
184 185 "testpath",
185 186 "curio",
186 187 "matplotlib!=3.2.0",
187 188 "nbformat",
188 189 "numpy>=1.17",
189 190 "pandas",
190 191 "pygments",
191 192 "trio",
192 193 ],
193 194 terminal=[],
194 195 kernel=["ipykernel"],
195 196 nbformat=["nbformat"],
196 197 notebook=["notebook", "ipywidgets"],
197 198 nbconvert=["nbconvert"],
198 199 )
199 200
200 201 install_requires = [
201 202 "setuptools>=18.5",
202 203 "jedi>=0.16",
203 204 "decorator",
204 205 "pickleshare",
205 206 "traitlets>=4.2",
206 207 "prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1",
207 208 "pygments",
208 209 "backcall",
209 210 "stack_data",
210 211 "matplotlib-inline",
211 212 ]
212 213
213 214 # Platform-specific dependencies:
214 215 # This is the correct way to specify these,
215 216 # but requires pip >= 6. pip < 6 ignores these.
216 217
217 218 extras_require.update(
218 219 {
219 220 ':sys_platform != "win32"': ["pexpect>4.3"],
220 221 ':sys_platform == "darwin"': ["appnope"],
221 222 ':sys_platform == "win32"': ["colorama"],
222 223 }
223 224 )
224 225 # FIXME: re-specify above platform dependencies for pip < 6
225 226 # These would result in non-portable bdists.
226 227 if not any(arg.startswith('bdist') for arg in sys.argv):
227 228 if sys.platform == 'darwin':
228 229 install_requires.extend(['appnope'])
229 230
230 231 if not sys.platform.startswith("win"):
231 232 install_requires.append("pexpect>4.3")
232 233
233 234 # workaround pypa/setuptools#147, where setuptools misspells
234 235 # platform_python_implementation as python_implementation
235 236 if 'setuptools' in sys.modules:
236 237 for key in list(extras_require):
237 238 if 'platform_python_implementation' in key:
238 239 new_key = key.replace('platform_python_implementation', 'python_implementation')
239 240 extras_require[new_key] = extras_require.pop(key)
240 241
241 242 everything = set()
242 243 for key, deps in extras_require.items():
243 244 if ':' not in key:
244 245 everything.update(deps)
245 246 extras_require['all'] = list(sorted(everything))
246 247
247 if 'setuptools' in sys.modules:
248 setuptools_extra_args['python_requires'] = '>=3.7'
249 setuptools_extra_args['zip_safe'] = False
250 setuptools_extra_args['entry_points'] = {
251 'console_scripts': find_entry_points(),
252 'pygments.lexers': [
253 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer',
254 'ipython = IPython.lib.lexers:IPythonLexer',
255 'ipython3 = IPython.lib.lexers:IPython3Lexer',
248 if "setuptools" in sys.modules:
249 setuptools_extra_args["python_requires"] = ">=3.8"
250 setuptools_extra_args["zip_safe"] = False
251 setuptools_extra_args["entry_points"] = {
252 "console_scripts": find_entry_points(),
253 "pygments.lexers": [
254 "ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer",
255 "ipython = IPython.lib.lexers:IPythonLexer",
256 "ipython3 = IPython.lib.lexers:IPython3Lexer",
256 257 ],
257 258 }
258 259 setup_args['extras_require'] = extras_require
259 260 setup_args['install_requires'] = install_requires
260 261
261 262 else:
262 263 # scripts has to be a non-empty list, or install_scripts isn't called
263 264 setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()]
264 265
265 266 setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt
266 267
267 268 #---------------------------------------------------------------------------
268 269 # Do the actual setup now
269 270 #---------------------------------------------------------------------------
270 271
271 272 setup_args.update(setuptools_extra_args)
272 273
273 274
274 275
275 276 def main():
276 277 setup(**setup_args)
277 278
278 279 if __name__ == '__main__':
279 280 main()
General Comments 0
You need to be logged in to leave comments. Login now