##// END OF EJS Templates
Specify install_requires in setup.cfg
James Morris -
Show More
@@ -1,13 +1,29 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 [options]
11 install_requires =
12 setuptools>=18.5
13 jedi>=0.16
14 decorator
15 pickleshare
16 traitlets>=4.2
17 prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1
18 pygments
19 backcall
20 stack_data
21 matplotlib-inline
22 pexpect>4.3; sys_platform != "win32"
23 appnope; sys_platform == "darwin"
24 colorama; sys_platform == "win32"
25
10 26 [velin]
11 27 ignore_patterns =
12 28 IPython/core/tests,
13 29 IPython/testing
@@ -1,256 +1,216 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 73 find_entry_points,
74 74 find_data_files,
75 75 git_prebuild,
76 76 install_symlinked,
77 77 install_lib_symlink,
78 78 install_scripts_for_symlink,
79 79 unsymlink,
80 80 )
81 81
82 82 #-------------------------------------------------------------------------------
83 83 # Handle OS specific things
84 84 #-------------------------------------------------------------------------------
85 85
86 86 if os.name in ('nt','dos'):
87 87 os_name = 'windows'
88 88 else:
89 89 os_name = os.name
90 90
91 91 # Under Windows, 'sdist' has not been supported. Now that the docs build with
92 92 # Sphinx it might work, but let's not turn it on until someone confirms that it
93 93 # actually works.
94 94 if os_name == 'windows' and 'sdist' in sys.argv:
95 95 print('The sdist command is not available under Windows. Exiting.')
96 96 sys.exit(1)
97 97
98 98
99 99 #-------------------------------------------------------------------------------
100 100 # Things related to the IPython documentation
101 101 #-------------------------------------------------------------------------------
102 102
103 103 # update the manuals when building a source dist
104 104 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
105 105
106 106 # List of things to be updated. Each entry is a triplet of args for
107 107 # target_update()
108 108 to_update = [
109 109 ('docs/man/ipython.1.gz',
110 110 ['docs/man/ipython.1'],
111 111 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
112 112 ]
113 113
114 114
115 115 [ target_update(*t) for t in to_update ]
116 116
117 117 #---------------------------------------------------------------------------
118 118 # Find all the packages, package data, and data_files
119 119 #---------------------------------------------------------------------------
120 120
121 121 packages = find_packages()
122 122 package_data = find_package_data()
123 123
124 124 data_files = find_data_files()
125 125
126 126 setup_args['packages'] = packages
127 127 setup_args['package_data'] = package_data
128 128 setup_args['data_files'] = data_files
129 129
130 130 #---------------------------------------------------------------------------
131 131 # custom distutils commands
132 132 #---------------------------------------------------------------------------
133 133 # imports here, so they are after setuptools import if there was one
134 134 from setuptools.command.sdist import sdist
135 135
136 136 setup_args['cmdclass'] = {
137 137 'build_py': \
138 138 check_package_data_first(git_prebuild('IPython')),
139 139 'sdist' : git_prebuild('IPython', sdist),
140 140 'symlink': install_symlinked,
141 141 'install_lib_symlink': install_lib_symlink,
142 142 'install_scripts_sym': install_scripts_for_symlink,
143 143 'unsymlink': unsymlink,
144 144 }
145 145
146 146
147 147 #---------------------------------------------------------------------------
148 148 # Handle scripts, dependencies, and setuptools specific things
149 149 #---------------------------------------------------------------------------
150 150
151 151 # This dict is used for passing extra arguments that are setuptools
152 152 # specific to setup
153 153 setuptools_extra_args = {}
154 154
155 155 # setuptools requirements
156 156
157 157 extras_require = dict(
158 158 parallel=["ipyparallel"],
159 159 qtconsole=["qtconsole"],
160 160 doc=["Sphinx>=1.3"],
161 161 test=[
162 162 "pytest",
163 163 "testpath",
164 164 "pygments",
165 165 ],
166 166 test_extra=[
167 167 "pytest",
168 168 "testpath",
169 169 "curio",
170 170 "matplotlib!=3.2.0",
171 171 "nbformat",
172 172 "numpy>=1.17",
173 173 "pandas",
174 174 "pygments",
175 175 "trio",
176 176 ],
177 177 terminal=[],
178 178 kernel=["ipykernel"],
179 179 nbformat=["nbformat"],
180 180 notebook=["notebook", "ipywidgets"],
181 181 nbconvert=["nbconvert"],
182 182 )
183 183
184 install_requires = [
185 "setuptools>=18.5",
186 "jedi>=0.16",
187 "decorator",
188 "pickleshare",
189 "traitlets>=4.2",
190 "prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1",
191 "pygments",
192 "backcall",
193 "stack_data",
194 "matplotlib-inline",
195 ]
196
197 # Platform-specific dependencies:
198 # This is the correct way to specify these,
199 # but requires pip >= 6. pip < 6 ignores these.
200
201 extras_require.update(
202 {
203 ':sys_platform != "win32"': ["pexpect>4.3"],
204 ':sys_platform == "darwin"': ["appnope"],
205 ':sys_platform == "win32"': ["colorama"],
206 }
207 )
208 # FIXME: re-specify above platform dependencies for pip < 6
209 # These would result in non-portable bdists.
210 if not any(arg.startswith('bdist') for arg in sys.argv):
211 if sys.platform == 'darwin':
212 install_requires.extend(['appnope'])
213
214 if not sys.platform.startswith("win"):
215 install_requires.append("pexpect>4.3")
216
217 # workaround pypa/setuptools#147, where setuptools misspells
218 # platform_python_implementation as python_implementation
219 if 'setuptools' in sys.modules:
220 for key in list(extras_require):
221 if 'platform_python_implementation' in key:
222 new_key = key.replace('platform_python_implementation', 'python_implementation')
223 extras_require[new_key] = extras_require.pop(key)
224 184
225 185 everything = set()
226 186 for key, deps in extras_require.items():
227 187 if ':' not in key:
228 188 everything.update(deps)
229 189 extras_require['all'] = list(sorted(everything))
230 190
231 191 setuptools_extra_args["python_requires"] = ">=3.8"
232 192 setuptools_extra_args["zip_safe"] = False
233 193 setuptools_extra_args["entry_points"] = {
234 194 "console_scripts": find_entry_points(),
235 195 "pygments.lexers": [
236 196 "ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer",
237 197 "ipython = IPython.lib.lexers:IPythonLexer",
238 198 "ipython3 = IPython.lib.lexers:IPython3Lexer",
239 199 ],
240 200 }
201
241 202 setup_args["extras_require"] = extras_require
242 setup_args["install_requires"] = install_requires
243 203
244 204 #---------------------------------------------------------------------------
245 205 # Do the actual setup now
246 206 #---------------------------------------------------------------------------
247 207
248 208 setup_args.update(setuptools_extra_args)
249 209
250 210
251 211
252 212 def main():
253 213 setup(**setup_args)
254 214
255 215 if __name__ == '__main__':
256 216 main()
General Comments 0
You need to be logged in to leave comments. Login now