##// END OF EJS Templates
move all entry_point definitions to setup.py
Nicholas Bollweg -
Show More
@@ -1,120 +1,114 b''
1 [metadata]
1 [metadata]
2 name = ipython
2 name = ipython
3 version = attr: IPython.core.release.__version__
3 version = attr: IPython.core.release.__version__
4 url = https://ipython.org
4 url = https://ipython.org
5 description = IPython: Productive Interactive Computing
5 description = IPython: Productive Interactive Computing
6 long_description_content_type = text/x-rst
6 long_description_content_type = text/x-rst
7 long_description = file: long_description.rst
7 long_description = file: long_description.rst
8 license_file = LICENSE
8 license_file = LICENSE
9 project_urls =
9 project_urls =
10 Documentation = https://ipython.readthedocs.io/
10 Documentation = https://ipython.readthedocs.io/
11 Funding = https://numfocus.org/
11 Funding = https://numfocus.org/
12 Source = https://github.com/ipython/ipython
12 Source = https://github.com/ipython/ipython
13 Tracker = https://github.com/ipython/ipython/issues
13 Tracker = https://github.com/ipython/ipython/issues
14 keywords = Interactive, Interpreter, Shell, Embedding
14 keywords = Interactive, Interpreter, Shell, Embedding
15 platforms = Linux, Mac OSX, Windows
15 platforms = Linux, Mac OSX, Windows
16 classifiers =
16 classifiers =
17 Framework :: IPython
17 Framework :: IPython
18 Framework :: Jupyter
18 Framework :: Jupyter
19 Intended Audience :: Developers
19 Intended Audience :: Developers
20 Intended Audience :: Science/Research
20 Intended Audience :: Science/Research
21 License :: OSI Approved :: BSD License
21 License :: OSI Approved :: BSD License
22 Programming Language :: Python
22 Programming Language :: Python
23 Programming Language :: Python :: 3
23 Programming Language :: Python :: 3
24 Programming Language :: Python :: 3 :: Only
24 Programming Language :: Python :: 3 :: Only
25 Topic :: System :: Shells
25 Topic :: System :: Shells
26
26
27 [options]
27 [options]
28 packages = find:
28 packages = find:
29 python_requires = >=3.8
29 python_requires = >=3.8
30 zip_safe = False
30 zip_safe = False
31 install_requires =
31 install_requires =
32 appnope; sys_platform == "darwin"
32 appnope; sys_platform == "darwin"
33 backcall
33 backcall
34 colorama; sys_platform == "win32"
34 colorama; sys_platform == "win32"
35 decorator
35 decorator
36 jedi>=0.16
36 jedi>=0.16
37 matplotlib-inline
37 matplotlib-inline
38 pexpect>4.3; sys_platform != "win32"
38 pexpect>4.3; sys_platform != "win32"
39 pickleshare
39 pickleshare
40 prompt_toolkit>=3.0.11,<3.1.0
40 prompt_toolkit>=3.0.11,<3.1.0
41 pygments>=2.4.0
41 pygments>=2.4.0
42 stack_data
42 stack_data
43 traitlets>=5
43 traitlets>=5
44
44
45 [options.extras_require]
45 [options.extras_require]
46 black =
46 black =
47 black
47 black
48 doc =
48 doc =
49 ipykernel
49 ipykernel
50 setuptools>=18.5
50 setuptools>=18.5
51 sphinx>=1.3
51 sphinx>=1.3
52 sphinx-rtd-theme
52 sphinx-rtd-theme
53 docrepr
53 docrepr
54 matplotlib
54 matplotlib
55 stack_data
55 stack_data
56 pytest<7
56 pytest<7
57 typing_extensions
57 typing_extensions
58 %(test)s
58 %(test)s
59 kernel =
59 kernel =
60 ipykernel
60 ipykernel
61 nbconvert =
61 nbconvert =
62 nbconvert
62 nbconvert
63 nbformat =
63 nbformat =
64 nbformat
64 nbformat
65 notebook =
65 notebook =
66 ipywidgets
66 ipywidgets
67 notebook
67 notebook
68 parallel =
68 parallel =
69 ipyparallel
69 ipyparallel
70 qtconsole =
70 qtconsole =
71 qtconsole
71 qtconsole
72 terminal =
72 terminal =
73 test =
73 test =
74 pytest<7.1
74 pytest<7.1
75 pytest-asyncio
75 pytest-asyncio
76 testpath
76 testpath
77 test_extra =
77 test_extra =
78 %(test)s
78 %(test)s
79 curio
79 curio
80 matplotlib!=3.2.0
80 matplotlib!=3.2.0
81 nbformat
81 nbformat
82 numpy>=1.20
82 numpy>=1.20
83 pandas
83 pandas
84 trio
84 trio
85 all =
85 all =
86 %(black)s
86 %(black)s
87 %(doc)s
87 %(doc)s
88 %(kernel)s
88 %(kernel)s
89 %(nbconvert)s
89 %(nbconvert)s
90 %(nbformat)s
90 %(nbformat)s
91 %(notebook)s
91 %(notebook)s
92 %(parallel)s
92 %(parallel)s
93 %(qtconsole)s
93 %(qtconsole)s
94 %(terminal)s
94 %(terminal)s
95 %(test_extra)s
95 %(test_extra)s
96 %(test)s
96 %(test)s
97
97
98 [options.packages.find]
98 [options.packages.find]
99 exclude =
99 exclude =
100 setupext
100 setupext
101
101
102 [options.package_data]
102 [options.package_data]
103 IPython.core = profile/README*
103 IPython.core = profile/README*
104 IPython.core.tests = *.png, *.jpg, daft_extension/*.py
104 IPython.core.tests = *.png, *.jpg, daft_extension/*.py
105 IPython.lib.tests = *.wav
105 IPython.lib.tests = *.wav
106 IPython.testing.plugin = *.txt
106 IPython.testing.plugin = *.txt
107
107
108 [options.entry_points]
109 pygments.lexers =
110 ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer
111 ipython = IPython.lib.lexers:IPythonLexer
112 ipython3 = IPython.lib.lexers:IPython3Lexer
113
114 [velin]
108 [velin]
115 ignore_patterns =
109 ignore_patterns =
116 IPython/core/tests
110 IPython/core/tests
117 IPython/testing
111 IPython/testing
118
112
119 [tool.black]
113 [tool.black]
120 exclude = 'timing\.py'
114 exclude = 'timing\.py'
@@ -1,149 +1,157 b''
1 # -*- coding: utf-8 -*-
1 # -*- coding: utf-8 -*-
2 """Setup script for IPython.
2 """Setup script for IPython.
3
3
4 Under Posix environments it works like a typical setup.py script.
4 Under Posix environments it works like a typical setup.py script.
5 Under Windows, the command sdist is not supported, since IPython
5 Under Windows, the command sdist is not supported, since IPython
6 requires utilities which are not available under Windows."""
6 requires utilities which are not available under Windows."""
7
7
8 #-----------------------------------------------------------------------------
8 #-----------------------------------------------------------------------------
9 # Copyright (c) 2008-2011, IPython Development Team.
9 # Copyright (c) 2008-2011, IPython Development Team.
10 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
10 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
11 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
11 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
12 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
12 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
13 #
13 #
14 # Distributed under the terms of the Modified BSD License.
14 # Distributed under the terms of the Modified BSD License.
15 #
15 #
16 # The full license is in the file COPYING.rst, distributed with this software.
16 # The full license is in the file COPYING.rst, distributed with this software.
17 #-----------------------------------------------------------------------------
17 #-----------------------------------------------------------------------------
18
18
19 import os
19 import os
20 import sys
20 import sys
21
21
22 # **Python version check**
22 # **Python version check**
23 #
23 #
24 # This check is also made in IPython/__init__, don't forget to update both when
24 # This check is also made in IPython/__init__, don't forget to update both when
25 # changing Python version requirements.
25 # changing Python version requirements.
26 if sys.version_info < (3, 8):
26 if sys.version_info < (3, 8):
27 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
27 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
28 try:
28 try:
29 import pip
29 import pip
30 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
30 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
31 if pip_version < (9, 0, 1) :
31 if pip_version < (9, 0, 1) :
32 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
32 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
33 'pip {} detected.'.format(pip.__version__)
33 'pip {} detected.'.format(pip.__version__)
34 else:
34 else:
35 # pip is new enough - it must be something else
35 # pip is new enough - it must be something else
36 pip_message = ''
36 pip_message = ''
37 except Exception:
37 except Exception:
38 pass
38 pass
39
39
40
40
41 error = """
41 error = """
42 IPython 8+ supports Python 3.8 and above, following NEP 29.
42 IPython 8+ supports Python 3.8 and above, following NEP 29.
43 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
43 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
44 Python 3.3 and 3.4 were supported up to IPython 6.x.
44 Python 3.3 and 3.4 were supported up to IPython 6.x.
45 Python 3.5 was supported with IPython 7.0 to 7.9.
45 Python 3.5 was supported with IPython 7.0 to 7.9.
46 Python 3.6 was supported with IPython up to 7.16.
46 Python 3.6 was supported with IPython up to 7.16.
47 Python 3.7 was still supported with the 7.x branch.
47 Python 3.7 was still supported with the 7.x branch.
48
48
49 See IPython `README.rst` file for more information:
49 See IPython `README.rst` file for more information:
50
50
51 https://github.com/ipython/ipython/blob/main/README.rst
51 https://github.com/ipython/ipython/blob/main/README.rst
52
52
53 Python {py} detected.
53 Python {py} detected.
54 {pip}
54 {pip}
55 """.format(
55 """.format(
56 py=sys.version_info, pip=pip_message
56 py=sys.version_info, pip=pip_message
57 )
57 )
58
58
59 print(error, file=sys.stderr)
59 print(error, file=sys.stderr)
60 sys.exit(1)
60 sys.exit(1)
61
61
62 # At least we're on the python version we need, move on.
62 # At least we're on the python version we need, move on.
63
63
64 from setuptools import setup
64 from setuptools import setup
65
65
66 # Our own imports
66 # Our own imports
67 sys.path.insert(0, ".")
67 sys.path.insert(0, ".")
68
68
69 from setupbase import target_update, find_entry_points
69 from setupbase import target_update, find_entry_points
70
70
71 from setupbase import (
71 from setupbase import (
72 setup_args,
72 setup_args,
73 check_package_data_first,
73 check_package_data_first,
74 find_data_files,
74 find_data_files,
75 git_prebuild,
75 git_prebuild,
76 install_symlinked,
76 install_symlinked,
77 install_lib_symlink,
77 install_lib_symlink,
78 install_scripts_for_symlink,
78 install_scripts_for_symlink,
79 unsymlink,
79 unsymlink,
80 )
80 )
81
81
82 #-------------------------------------------------------------------------------
82 #-------------------------------------------------------------------------------
83 # Handle OS specific things
83 # Handle OS specific things
84 #-------------------------------------------------------------------------------
84 #-------------------------------------------------------------------------------
85
85
86 if os.name in ('nt','dos'):
86 if os.name in ('nt','dos'):
87 os_name = 'windows'
87 os_name = 'windows'
88 else:
88 else:
89 os_name = os.name
89 os_name = os.name
90
90
91 # Under Windows, 'sdist' has not been supported. Now that the docs build with
91 # 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
92 # Sphinx it might work, but let's not turn it on until someone confirms that it
93 # actually works.
93 # actually works.
94 if os_name == 'windows' and 'sdist' in sys.argv:
94 if os_name == 'windows' and 'sdist' in sys.argv:
95 print('The sdist command is not available under Windows. Exiting.')
95 print('The sdist command is not available under Windows. Exiting.')
96 sys.exit(1)
96 sys.exit(1)
97
97
98
98
99 #-------------------------------------------------------------------------------
99 #-------------------------------------------------------------------------------
100 # Things related to the IPython documentation
100 # Things related to the IPython documentation
101 #-------------------------------------------------------------------------------
101 #-------------------------------------------------------------------------------
102
102
103 # update the manuals when building a source dist
103 # update the manuals when building a source dist
104 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
104 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
105
105
106 # List of things to be updated. Each entry is a triplet of args for
106 # List of things to be updated. Each entry is a triplet of args for
107 # target_update()
107 # target_update()
108 to_update = [
108 to_update = [
109 (
109 (
110 "docs/man/ipython.1.gz",
110 "docs/man/ipython.1.gz",
111 ["docs/man/ipython.1"],
111 ["docs/man/ipython.1"],
112 "cd docs/man && python -m gzip --best ipython.1",
112 "cd docs/man && python -m gzip --best ipython.1",
113 ),
113 ),
114 ]
114 ]
115
115
116
116
117 [ target_update(*t) for t in to_update ]
117 [ target_update(*t) for t in to_update ]
118
118
119 #---------------------------------------------------------------------------
119 #---------------------------------------------------------------------------
120 # Find all the packages, package data, and data_files
120 # Find all the packages, package data, and data_files
121 #---------------------------------------------------------------------------
121 #---------------------------------------------------------------------------
122
122
123 data_files = find_data_files()
123 data_files = find_data_files()
124
124
125 setup_args['data_files'] = data_files
125 setup_args['data_files'] = data_files
126
126
127 #---------------------------------------------------------------------------
127 #---------------------------------------------------------------------------
128 # custom distutils commands
128 # custom distutils commands
129 #---------------------------------------------------------------------------
129 #---------------------------------------------------------------------------
130 # imports here, so they are after setuptools import if there was one
130 # imports here, so they are after setuptools import if there was one
131 from setuptools.command.sdist import sdist
131 from setuptools.command.sdist import sdist
132
132
133 setup_args['cmdclass'] = {
133 setup_args['cmdclass'] = {
134 'build_py': \
134 'build_py': \
135 check_package_data_first(git_prebuild('IPython')),
135 check_package_data_first(git_prebuild('IPython')),
136 'sdist' : git_prebuild('IPython', sdist),
136 'sdist' : git_prebuild('IPython', sdist),
137 'symlink': install_symlinked,
137 'symlink': install_symlinked,
138 'install_lib_symlink': install_lib_symlink,
138 'install_lib_symlink': install_lib_symlink,
139 'install_scripts_sym': install_scripts_for_symlink,
139 'install_scripts_sym': install_scripts_for_symlink,
140 'unsymlink': unsymlink,
140 'unsymlink': unsymlink,
141 }
141 }
142 setup_args["entry_points"] = {"console_scripts": find_entry_points()}
142
143 setup_args["entry_points"] = {
144 "console_scripts": find_entry_points(),
145 "pygments.lexers": [
146 "ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer",
147 "ipython = IPython.lib.lexers:IPythonLexer",
148 "ipython3 = IPython.lib.lexers:IPython3Lexer",
149 ]
150 }
143
151
144 #---------------------------------------------------------------------------
152 #---------------------------------------------------------------------------
145 # Do the actual setup now
153 # Do the actual setup now
146 #---------------------------------------------------------------------------
154 #---------------------------------------------------------------------------
147
155
148 if __name__ == "__main__":
156 if __name__ == "__main__":
149 setup(**setup_args)
157 setup(**setup_args)
General Comments 0
You need to be logged in to leave comments. Login now