##// END OF EJS Templates
Use setuptools' find_packages()
James Morris -
Show More
@@ -1,42 +1,47 b''
1 [metadata]
1 [metadata]
2 version = attr: IPython.core.release.__version__
2 version = attr: IPython.core.release.__version__
3 license_file = LICENSE
3 license_file = LICENSE
4 project_urls =
4 project_urls =
5 Documentation = https://ipython.readthedocs.io/
5 Documentation = https://ipython.readthedocs.io/
6 Funding = https://numfocus.org/
6 Funding = https://numfocus.org/
7 Source = https://github.com/ipython/ipython
7 Source = https://github.com/ipython/ipython
8 Tracker = https://github.com/ipython/ipython/issues
8 Tracker = https://github.com/ipython/ipython/issues
9
9
10 [options]
10 [options]
11 packages = find:
11 python_requires = >=3.8
12 python_requires = >=3.8
12 zip_safe = False
13 zip_safe = False
13 install_requires =
14 install_requires =
14 setuptools>=18.5
15 setuptools>=18.5
15 jedi>=0.16
16 jedi>=0.16
16 decorator
17 decorator
17 pickleshare
18 pickleshare
18 traitlets>=4.2
19 traitlets>=4.2
19 prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1
20 prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1
20 pygments
21 pygments
21 backcall
22 backcall
22 stack_data
23 stack_data
23 matplotlib-inline
24 matplotlib-inline
24 pexpect>4.3; sys_platform != "win32"
25 pexpect>4.3; sys_platform != "win32"
25 appnope; sys_platform == "darwin"
26 appnope; sys_platform == "darwin"
26 colorama; sys_platform == "win32"
27 colorama; sys_platform == "win32"
27
28
29 [options.packages.find]
30 exclude =
31 deathrow
32 quarantine
33 setupext
34
28 [options.entry_points]
35 [options.entry_points]
29 console_scripts =
36 console_scripts =
30 ipython = IPython:start_ipython
37 ipython = IPython:start_ipython
31 iptest = IPython.testing.iptestcontroller:main
32 ipython3 = IPython:start_ipython
38 ipython3 = IPython:start_ipython
33 iptest3 = IPython.testing.iptestcontroller:main
34 pygments.lexers =
39 pygments.lexers =
35 ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer
40 ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer
36 ipython = IPython.lib.lexers:IPythonLexer
41 ipython = IPython.lib.lexers:IPythonLexer
37 ipython3 = IPython.lib.lexers:IPython3Lexer
42 ipython3 = IPython.lib.lexers:IPython3Lexer
38
43
39 [velin]
44 [velin]
40 ignore_patterns =
45 ignore_patterns =
41 IPython/core/tests,
46 IPython/core/tests,
42 IPython/testing
47 IPython/testing
@@ -1,204 +1,201 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 find_packages,
71 find_package_data,
70 find_package_data,
72 check_package_data_first,
71 check_package_data_first,
73 find_data_files,
72 find_data_files,
74 git_prebuild,
73 git_prebuild,
75 install_symlinked,
74 install_symlinked,
76 install_lib_symlink,
75 install_lib_symlink,
77 install_scripts_for_symlink,
76 install_scripts_for_symlink,
78 unsymlink,
77 unsymlink,
79 )
78 )
80
79
81 #-------------------------------------------------------------------------------
80 #-------------------------------------------------------------------------------
82 # Handle OS specific things
81 # Handle OS specific things
83 #-------------------------------------------------------------------------------
82 #-------------------------------------------------------------------------------
84
83
85 if os.name in ('nt','dos'):
84 if os.name in ('nt','dos'):
86 os_name = 'windows'
85 os_name = 'windows'
87 else:
86 else:
88 os_name = os.name
87 os_name = os.name
89
88
90 # Under Windows, 'sdist' has not been supported. Now that the docs build with
89 # Under Windows, 'sdist' has not been supported. Now that the docs build with
91 # Sphinx it might work, but let's not turn it on until someone confirms that it
90 # Sphinx it might work, but let's not turn it on until someone confirms that it
92 # actually works.
91 # actually works.
93 if os_name == 'windows' and 'sdist' in sys.argv:
92 if os_name == 'windows' and 'sdist' in sys.argv:
94 print('The sdist command is not available under Windows. Exiting.')
93 print('The sdist command is not available under Windows. Exiting.')
95 sys.exit(1)
94 sys.exit(1)
96
95
97
96
98 #-------------------------------------------------------------------------------
97 #-------------------------------------------------------------------------------
99 # Things related to the IPython documentation
98 # Things related to the IPython documentation
100 #-------------------------------------------------------------------------------
99 #-------------------------------------------------------------------------------
101
100
102 # update the manuals when building a source dist
101 # update the manuals when building a source dist
103 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
102 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
104
103
105 # List of things to be updated. Each entry is a triplet of args for
104 # List of things to be updated. Each entry is a triplet of args for
106 # target_update()
105 # target_update()
107 to_update = [
106 to_update = [
108 ('docs/man/ipython.1.gz',
107 ('docs/man/ipython.1.gz',
109 ['docs/man/ipython.1'],
108 ['docs/man/ipython.1'],
110 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
109 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
111 ]
110 ]
112
111
113
112
114 [ target_update(*t) for t in to_update ]
113 [ target_update(*t) for t in to_update ]
115
114
116 #---------------------------------------------------------------------------
115 #---------------------------------------------------------------------------
117 # Find all the packages, package data, and data_files
116 # Find all the packages, package data, and data_files
118 #---------------------------------------------------------------------------
117 #---------------------------------------------------------------------------
119
118
120 packages = find_packages()
121 package_data = find_package_data()
119 package_data = find_package_data()
122
120
123 data_files = find_data_files()
121 data_files = find_data_files()
124
122
125 setup_args['packages'] = packages
126 setup_args['package_data'] = package_data
123 setup_args['package_data'] = package_data
127 setup_args['data_files'] = data_files
124 setup_args['data_files'] = data_files
128
125
129 #---------------------------------------------------------------------------
126 #---------------------------------------------------------------------------
130 # custom distutils commands
127 # custom distutils commands
131 #---------------------------------------------------------------------------
128 #---------------------------------------------------------------------------
132 # imports here, so they are after setuptools import if there was one
129 # imports here, so they are after setuptools import if there was one
133 from setuptools.command.sdist import sdist
130 from setuptools.command.sdist import sdist
134
131
135 setup_args['cmdclass'] = {
132 setup_args['cmdclass'] = {
136 'build_py': \
133 'build_py': \
137 check_package_data_first(git_prebuild('IPython')),
134 check_package_data_first(git_prebuild('IPython')),
138 'sdist' : git_prebuild('IPython', sdist),
135 'sdist' : git_prebuild('IPython', sdist),
139 'symlink': install_symlinked,
136 'symlink': install_symlinked,
140 'install_lib_symlink': install_lib_symlink,
137 'install_lib_symlink': install_lib_symlink,
141 'install_scripts_sym': install_scripts_for_symlink,
138 'install_scripts_sym': install_scripts_for_symlink,
142 'unsymlink': unsymlink,
139 'unsymlink': unsymlink,
143 }
140 }
144
141
145
142
146 #---------------------------------------------------------------------------
143 #---------------------------------------------------------------------------
147 # Handle scripts, dependencies, and setuptools specific things
144 # Handle scripts, dependencies, and setuptools specific things
148 #---------------------------------------------------------------------------
145 #---------------------------------------------------------------------------
149
146
150 # This dict is used for passing extra arguments that are setuptools
147 # This dict is used for passing extra arguments that are setuptools
151 # specific to setup
148 # specific to setup
152 setuptools_extra_args = {}
149 setuptools_extra_args = {}
153
150
154 # setuptools requirements
151 # setuptools requirements
155
152
156 extras_require = dict(
153 extras_require = dict(
157 parallel=["ipyparallel"],
154 parallel=["ipyparallel"],
158 qtconsole=["qtconsole"],
155 qtconsole=["qtconsole"],
159 doc=["Sphinx>=1.3"],
156 doc=["Sphinx>=1.3"],
160 test=[
157 test=[
161 "pytest",
158 "pytest",
162 "testpath",
159 "testpath",
163 "pygments",
160 "pygments",
164 ],
161 ],
165 test_extra=[
162 test_extra=[
166 "pytest",
163 "pytest",
167 "testpath",
164 "testpath",
168 "curio",
165 "curio",
169 "matplotlib!=3.2.0",
166 "matplotlib!=3.2.0",
170 "nbformat",
167 "nbformat",
171 "numpy>=1.17",
168 "numpy>=1.17",
172 "pandas",
169 "pandas",
173 "pygments",
170 "pygments",
174 "trio",
171 "trio",
175 ],
172 ],
176 terminal=[],
173 terminal=[],
177 kernel=["ipykernel"],
174 kernel=["ipykernel"],
178 nbformat=["nbformat"],
175 nbformat=["nbformat"],
179 notebook=["notebook", "ipywidgets"],
176 notebook=["notebook", "ipywidgets"],
180 nbconvert=["nbconvert"],
177 nbconvert=["nbconvert"],
181 )
178 )
182
179
183
180
184 everything = set()
181 everything = set()
185 for key, deps in extras_require.items():
182 for key, deps in extras_require.items():
186 if ':' not in key:
183 if ':' not in key:
187 everything.update(deps)
184 everything.update(deps)
188 extras_require['all'] = list(sorted(everything))
185 extras_require['all'] = list(sorted(everything))
189
186
190 setup_args["extras_require"] = extras_require
187 setup_args["extras_require"] = extras_require
191
188
192 #---------------------------------------------------------------------------
189 #---------------------------------------------------------------------------
193 # Do the actual setup now
190 # Do the actual setup now
194 #---------------------------------------------------------------------------
191 #---------------------------------------------------------------------------
195
192
196 setup_args.update(setuptools_extra_args)
193 setup_args.update(setuptools_extra_args)
197
194
198
195
199
196
200 def main():
197 def main():
201 setup(**setup_args)
198 setup(**setup_args)
202
199
203 if __name__ == '__main__':
200 if __name__ == '__main__':
204 main()
201 main()
General Comments 0
You need to be logged in to leave comments. Login now