##// END OF EJS Templates
Merge pull request #13848 from bollwyvl/gh-13845-fix-pygments-entry-points...
Matthias Bussonnier -
r27968:d38397b0 merge
parent child Browse files
Show More
@@ -0,0 +1,26 b''
1 from typing import List
2
3 import pytest
4 import pygments.lexers
5 import pygments.lexer
6
7 from IPython.lib.lexers import IPythonConsoleLexer, IPythonLexer, IPython3Lexer
8
9 #: the human-readable names of the IPython lexers with ``entry_points``
10 EXPECTED_LEXER_NAMES = [
11 cls.name for cls in [IPythonConsoleLexer, IPythonLexer, IPython3Lexer]
12 ]
13
14
15 @pytest.fixture
16 def all_pygments_lexer_names() -> List[str]:
17 """Get all lexer names registered in pygments."""
18 return {l[0] for l in pygments.lexers.get_all_lexers()}
19
20
21 @pytest.mark.parametrize("expected_lexer", EXPECTED_LEXER_NAMES)
22 def test_pygments_entry_points(
23 expected_lexer: str, all_pygments_lexer_names: List[str]
24 ) -> None:
25 """Check whether the ``entry_points`` for ``pygments.lexers`` are correct."""
26 assert expected_lexer in all_pygments_lexer_names
@@ -106,12 +106,6 b' IPython.core.tests = *.png, *.jpg, daft_extension/*.py'
106 IPython.lib.tests = *.wav
106 IPython.lib.tests = *.wav
107 IPython.testing.plugin = *.txt
107 IPython.testing.plugin = *.txt
108
108
109 [options.entry_points]
110 pygments.lexers =
111 ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer
112 ipython = IPython.lib.lexers:IPythonLexer
113 ipython3 = IPython.lib.lexers:IPython3Lexer
114
115 [velin]
109 [velin]
116 ignore_patterns =
110 ignore_patterns =
117 IPython/core/tests
111 IPython/core/tests
@@ -139,7 +139,15 b" setup_args['cmdclass'] = {"
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
General Comments 0
You need to be logged in to leave comments. Login now