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