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