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