From 64b1f855c26baa693f480f4b58633dfa583c6aaf 2024-02-17 07:49:26 From: Matthias Koeppe Date: 2024-02-17 07:49:26 Subject: [PATCH] pyproject.toml (project.entrypoints, project.scripts): Move here from setup.py, setupbase.py --- diff --git a/pyproject.toml b/pyproject.toml index ad0ab87..9b137ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,7 +34,16 @@ dependencies = [ "traitlets>=5", "typing_extensions; python_version<'3.10'", ] -dynamic = ["authors", "entry-points", "license", "scripts", "version"] +dynamic = ["authors", "license", "version"] + +[project.entry-points."pygments.lexers"] +ipythonconsole = "IPython.lib.lexers:IPythonConsoleLexer" +ipython = "IPython.lib.lexers:IPythonLexer" +ipython3 = "IPython.lib.lexers:IPython3Lexer" + +[project.scripts] +ipython = "IPython:start_ipython" +ipython3 = "IPython:start_ipython" [project.readme] file = "long_description.rst" diff --git a/setup.py b/setup.py index 307921a..f9f4f3a 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ from setuptools import setup # Our own imports -from setupbase import target_update, find_entry_points +from setupbase import target_update from setupbase import ( setup_args, @@ -133,15 +133,6 @@ setup_args['cmdclass'] = { 'sdist' : git_prebuild('IPython', sdist), } -setup_args["entry_points"] = { - "console_scripts": find_entry_points(), - "pygments.lexers": [ - "ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer", - "ipython = IPython.lib.lexers:IPythonLexer", - "ipython3 = IPython.lib.lexers:IPython3Lexer", - ], -} - #--------------------------------------------------------------------------- # Do the actual setup now #--------------------------------------------------------------------------- diff --git a/setupbase.py b/setupbase.py index 092ad2d..f4cbf71 100644 --- a/setupbase.py +++ b/setupbase.py @@ -162,26 +162,6 @@ def target_update(target,deps,cmd): os.system(cmd) #--------------------------------------------------------------------------- -# Find scripts -#--------------------------------------------------------------------------- - -def find_entry_points(): - """Defines the command line entry points for IPython - - This always uses setuptools-style entry points. When setuptools is not in - use, our own build_scripts_entrypt class below parses these and builds - command line scripts. - - Each of our entry points gets a plain name, e.g. ipython, and a name - suffixed with the Python major version number, e.g. ipython3. - """ - ep = [ - 'ipython%s = IPython:start_ipython', - ] - major_suffix = str(sys.version_info[0]) - return [e % "" for e in ep] + [e % major_suffix for e in ep] - -#--------------------------------------------------------------------------- # VCS related #---------------------------------------------------------------------------