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