##// END OF EJS Templates
pyproject.toml (project.entrypoints, project.scripts): Move here from setup.py, setupbase.py
Matthias Koeppe -
Show More
@@ -34,7 +34,16 b' dependencies = ['
34 "traitlets>=5",
34 "traitlets>=5",
35 "typing_extensions; python_version<'3.10'",
35 "typing_extensions; python_version<'3.10'",
36 ]
36 ]
37 dynamic = ["authors", "entry-points", "license", "scripts", "version"]
37 dynamic = ["authors", "license", "version"]
38
39 [project.entry-points."pygments.lexers"]
40 ipythonconsole = "IPython.lib.lexers:IPythonConsoleLexer"
41 ipython = "IPython.lib.lexers:IPythonLexer"
42 ipython3 = "IPython.lib.lexers:IPython3Lexer"
43
44 [project.scripts]
45 ipython = "IPython:start_ipython"
46 ipython3 = "IPython:start_ipython"
38
47
39 [project.readme]
48 [project.readme]
40 file = "long_description.rst"
49 file = "long_description.rst"
@@ -67,7 +67,7 b' from setuptools import setup'
67
67
68 # Our own imports
68 # Our own imports
69
69
70 from setupbase import target_update, find_entry_points
70 from setupbase import target_update
71
71
72 from setupbase import (
72 from setupbase import (
73 setup_args,
73 setup_args,
@@ -133,15 +133,6 b" setup_args['cmdclass'] = {"
133 'sdist' : git_prebuild('IPython', sdist),
133 'sdist' : git_prebuild('IPython', sdist),
134 }
134 }
135
135
136 setup_args["entry_points"] = {
137 "console_scripts": find_entry_points(),
138 "pygments.lexers": [
139 "ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer",
140 "ipython = IPython.lib.lexers:IPythonLexer",
141 "ipython3 = IPython.lib.lexers:IPython3Lexer",
142 ],
143 }
144
145 #---------------------------------------------------------------------------
136 #---------------------------------------------------------------------------
146 # Do the actual setup now
137 # Do the actual setup now
147 #---------------------------------------------------------------------------
138 #---------------------------------------------------------------------------
@@ -162,26 +162,6 b' def target_update(target,deps,cmd):'
162 os.system(cmd)
162 os.system(cmd)
163
163
164 #---------------------------------------------------------------------------
164 #---------------------------------------------------------------------------
165 # Find scripts
166 #---------------------------------------------------------------------------
167
168 def find_entry_points():
169 """Defines the command line entry points for IPython
170
171 This always uses setuptools-style entry points. When setuptools is not in
172 use, our own build_scripts_entrypt class below parses these and builds
173 command line scripts.
174
175 Each of our entry points gets a plain name, e.g. ipython, and a name
176 suffixed with the Python major version number, e.g. ipython3.
177 """
178 ep = [
179 'ipython%s = IPython:start_ipython',
180 ]
181 major_suffix = str(sys.version_info[0])
182 return [e % "" for e in ep] + [e % major_suffix for e in ep]
183
184 #---------------------------------------------------------------------------
185 # VCS related
165 # VCS related
186 #---------------------------------------------------------------------------
166 #---------------------------------------------------------------------------
187
167
General Comments 0
You need to be logged in to leave comments. Login now