##// END OF EJS Templates
Remove obsolete setuptools_extra_args
James Morris -
Show More
@@ -1,197 +1,189 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 import os
20 import os
21 import sys
21 import sys
22
22
23 # **Python version check**
23 # **Python version check**
24 #
24 #
25 # This check is also made in IPython/__init__, don't forget to update both when
25 # This check is also made in IPython/__init__, don't forget to update both when
26 # changing Python version requirements.
26 # changing Python version requirements.
27 if sys.version_info < (3, 8):
27 if sys.version_info < (3, 8):
28 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
28 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
29 try:
29 try:
30 import pip
30 import pip
31 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
31 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
32 if pip_version < (9, 0, 1) :
32 if pip_version < (9, 0, 1) :
33 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
33 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
34 'pip {} detected.'.format(pip.__version__)
34 'pip {} detected.'.format(pip.__version__)
35 else:
35 else:
36 # pip is new enough - it must be something else
36 # pip is new enough - it must be something else
37 pip_message = ''
37 pip_message = ''
38 except Exception:
38 except Exception:
39 pass
39 pass
40
40
41
41
42 error = """
42 error = """
43 IPython 8+ supports Python 3.8 and above, following NEP 29.
43 IPython 8+ supports Python 3.8 and above, following NEP 29.
44 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
44 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
45 Python 3.3 and 3.4 were supported up to IPython 6.x.
45 Python 3.3 and 3.4 were supported up to IPython 6.x.
46 Python 3.5 was supported with IPython 7.0 to 7.9.
46 Python 3.5 was supported with IPython 7.0 to 7.9.
47 Python 3.6 was supported with IPython up to 7.16.
47 Python 3.6 was supported with IPython up to 7.16.
48 Python 3.7 was still supported with the 7.x branch.
48 Python 3.7 was still supported with the 7.x branch.
49
49
50 See IPython `README.rst` file for more information:
50 See IPython `README.rst` file for more information:
51
51
52 https://github.com/ipython/ipython/blob/master/README.rst
52 https://github.com/ipython/ipython/blob/master/README.rst
53
53
54 Python {py} detected.
54 Python {py} detected.
55 {pip}
55 {pip}
56 """.format(py=sys.version_info, pip=pip_message )
56 """.format(py=sys.version_info, pip=pip_message )
57
57
58 print(error, file=sys.stderr)
58 print(error, file=sys.stderr)
59 sys.exit(1)
59 sys.exit(1)
60
60
61 # 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.
62
62
63 from setuptools import setup
63 from setuptools import setup
64
64
65 # Our own imports
65 # Our own imports
66 from setupbase import target_update
66 from setupbase import target_update
67
67
68 from setupbase import (
68 from setupbase import (
69 setup_args,
69 setup_args,
70 check_package_data_first,
70 check_package_data_first,
71 find_data_files,
71 find_data_files,
72 git_prebuild,
72 git_prebuild,
73 install_symlinked,
73 install_symlinked,
74 install_lib_symlink,
74 install_lib_symlink,
75 install_scripts_for_symlink,
75 install_scripts_for_symlink,
76 unsymlink,
76 unsymlink,
77 )
77 )
78
78
79 #-------------------------------------------------------------------------------
79 #-------------------------------------------------------------------------------
80 # Handle OS specific things
80 # Handle OS specific things
81 #-------------------------------------------------------------------------------
81 #-------------------------------------------------------------------------------
82
82
83 if os.name in ('nt','dos'):
83 if os.name in ('nt','dos'):
84 os_name = 'windows'
84 os_name = 'windows'
85 else:
85 else:
86 os_name = os.name
86 os_name = os.name
87
87
88 # Under Windows, 'sdist' has not been supported. Now that the docs build with
88 # Under Windows, 'sdist' has not been supported. Now that the docs build with
89 # Sphinx it might work, but let's not turn it on until someone confirms that it
89 # Sphinx it might work, but let's not turn it on until someone confirms that it
90 # actually works.
90 # actually works.
91 if os_name == 'windows' and 'sdist' in sys.argv:
91 if os_name == 'windows' and 'sdist' in sys.argv:
92 print('The sdist command is not available under Windows. Exiting.')
92 print('The sdist command is not available under Windows. Exiting.')
93 sys.exit(1)
93 sys.exit(1)
94
94
95
95
96 #-------------------------------------------------------------------------------
96 #-------------------------------------------------------------------------------
97 # Things related to the IPython documentation
97 # Things related to the IPython documentation
98 #-------------------------------------------------------------------------------
98 #-------------------------------------------------------------------------------
99
99
100 # update the manuals when building a source dist
100 # update the manuals when building a source dist
101 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
101 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
102
102
103 # List of things to be updated. Each entry is a triplet of args for
103 # List of things to be updated. Each entry is a triplet of args for
104 # target_update()
104 # target_update()
105 to_update = [
105 to_update = [
106 ('docs/man/ipython.1.gz',
106 ('docs/man/ipython.1.gz',
107 ['docs/man/ipython.1'],
107 ['docs/man/ipython.1'],
108 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
108 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
109 ]
109 ]
110
110
111
111
112 [ target_update(*t) for t in to_update ]
112 [ target_update(*t) for t in to_update ]
113
113
114 #---------------------------------------------------------------------------
114 #---------------------------------------------------------------------------
115 # Find all the packages, package data, and data_files
115 # Find all the packages, package data, and data_files
116 #---------------------------------------------------------------------------
116 #---------------------------------------------------------------------------
117
117
118 data_files = find_data_files()
118 data_files = find_data_files()
119
119
120 setup_args['data_files'] = data_files
120 setup_args['data_files'] = data_files
121
121
122 #---------------------------------------------------------------------------
122 #---------------------------------------------------------------------------
123 # custom distutils commands
123 # custom distutils commands
124 #---------------------------------------------------------------------------
124 #---------------------------------------------------------------------------
125 # imports here, so they are after setuptools import if there was one
125 # imports here, so they are after setuptools import if there was one
126 from setuptools.command.sdist import sdist
126 from setuptools.command.sdist import sdist
127
127
128 setup_args['cmdclass'] = {
128 setup_args['cmdclass'] = {
129 'build_py': \
129 'build_py': \
130 check_package_data_first(git_prebuild('IPython')),
130 check_package_data_first(git_prebuild('IPython')),
131 'sdist' : git_prebuild('IPython', sdist),
131 'sdist' : git_prebuild('IPython', sdist),
132 'symlink': install_symlinked,
132 'symlink': install_symlinked,
133 'install_lib_symlink': install_lib_symlink,
133 'install_lib_symlink': install_lib_symlink,
134 'install_scripts_sym': install_scripts_for_symlink,
134 'install_scripts_sym': install_scripts_for_symlink,
135 'unsymlink': unsymlink,
135 'unsymlink': unsymlink,
136 }
136 }
137
137
138
138
139 #---------------------------------------------------------------------------
139 #---------------------------------------------------------------------------
140 # Handle scripts, dependencies, and setuptools specific things
140 # Handle scripts, dependencies, and setuptools specific things
141 #---------------------------------------------------------------------------
141 #---------------------------------------------------------------------------
142
142
143 # This dict is used for passing extra arguments that are setuptools
144 # specific to setup
145 setuptools_extra_args = {}
146
147 # setuptools requirements
143 # setuptools requirements
148
144
149 extras_require = dict(
145 extras_require = dict(
150 parallel=["ipyparallel"],
146 parallel=["ipyparallel"],
151 qtconsole=["qtconsole"],
147 qtconsole=["qtconsole"],
152 doc=["Sphinx>=1.3"],
148 doc=["Sphinx>=1.3"],
153 test=[
149 test=[
154 "pytest",
150 "pytest",
155 "testpath",
151 "testpath",
156 "pygments",
152 "pygments",
157 ],
153 ],
158 test_extra=[
154 test_extra=[
159 "pytest",
155 "pytest",
160 "testpath",
156 "testpath",
161 "curio",
157 "curio",
162 "matplotlib!=3.2.0",
158 "matplotlib!=3.2.0",
163 "nbformat",
159 "nbformat",
164 "numpy>=1.17",
160 "numpy>=1.17",
165 "pandas",
161 "pandas",
166 "pygments",
162 "pygments",
167 "trio",
163 "trio",
168 ],
164 ],
169 terminal=[],
165 terminal=[],
170 kernel=["ipykernel"],
166 kernel=["ipykernel"],
171 nbformat=["nbformat"],
167 nbformat=["nbformat"],
172 notebook=["notebook", "ipywidgets"],
168 notebook=["notebook", "ipywidgets"],
173 nbconvert=["nbconvert"],
169 nbconvert=["nbconvert"],
174 )
170 )
175
171
176
172
177 everything = set()
173 everything = set()
178 for key, deps in extras_require.items():
174 for key, deps in extras_require.items():
179 if ':' not in key:
175 if ':' not in key:
180 everything.update(deps)
176 everything.update(deps)
181 extras_require['all'] = list(sorted(everything))
177 extras_require['all'] = list(sorted(everything))
182
178
183 setup_args["extras_require"] = extras_require
179 setup_args["extras_require"] = extras_require
184
180
185 #---------------------------------------------------------------------------
181 #---------------------------------------------------------------------------
186 # Do the actual setup now
182 # Do the actual setup now
187 #---------------------------------------------------------------------------
183 #---------------------------------------------------------------------------
188
184
189 setup_args.update(setuptools_extra_args)
190
191
192
193 def main():
185 def main():
194 setup(**setup_args)
186 setup(**setup_args)
195
187
196 if __name__ == '__main__':
188 if __name__ == '__main__':
197 main()
189 main()
General Comments 0
You need to be logged in to leave comments. Login now