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