Skip to content

Commit 5e014ac

Browse files
committed
Depend on ipython-pygments-lexers for pygments lexers
1 parent 10a7bc5 commit 5e014ac

File tree

8 files changed

+14
-809
lines changed

8 files changed

+14
-809
lines changed

IPython/lib/lexers.py

Lines changed: 10 additions & 522 deletions
Large diffs are not rendered by default.

IPython/lib/tests/test_lexers.py

Lines changed: 0 additions & 184 deletions
This file was deleted.

IPython/lib/tests/test_pygments.py

Lines changed: 0 additions & 26 deletions
This file was deleted.

IPython/sphinxext/ipython_console_highlighting.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"""
55

66
from sphinx import highlighting
7-
from IPython.lib.lexers import IPyLexer
7+
from ipython_pygments_lexers import IPyLexer
88

99
def setup(app):
1010
"""Setup as a sphinx extension."""
@@ -20,9 +20,7 @@ def setup(app):
2020
# Alternatively, we could register the lexer with pygments instead. This would
2121
# require using setuptools entrypoints: http://pygments.org/docs/plugins
2222

23-
ipy2 = IPyLexer(python3=False)
24-
ipy3 = IPyLexer(python3=True)
23+
ipy3 = IPyLexer()
2524

26-
highlighting.lexers['ipython'] = ipy2
27-
highlighting.lexers['ipython2'] = ipy2
25+
highlighting.lexers['ipython'] = ipy3
2826
highlighting.lexers['ipython3'] = ipy3

docs/autogen_api.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737
r"\.lib\.inputhook.+",
3838
r"\.ipdoctest",
3939
r"\.testing\.plugin",
40-
# Backwards compat import for lib.lexers
41-
r"\.nbconvert\.utils\.lexers",
4240
# We document this manually.
4341
r"\.utils\.py3compat",
4442
# These are exposed in display

docs/source/development/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,5 @@ Developer's guide for third party tools and libraries
1616
how_ipython_works
1717
wrapperkernels
1818
execution
19-
lexer
2019
config
2120
inputhook_app

docs/source/development/lexer.rst

Lines changed: 0 additions & 64 deletions
This file was deleted.

pyproject.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ requires-python = ">=3.11"
2424
dependencies = [
2525
'colorama; sys_platform == "win32"',
2626
"decorator",
27+
"ipython-pygments-lexers",
2728
"jedi>=0.16",
2829
"matplotlib-inline",
2930
'pexpect>4.3; sys_platform != "win32" and sys_platform != "emscripten"',
@@ -35,11 +36,6 @@ dependencies = [
3536
]
3637
dynamic = ["authors", "license", "version"]
3738

38-
[project.entry-points."pygments.lexers"]
39-
ipythonconsole = "IPython.lib.lexers:IPythonConsoleLexer"
40-
ipython = "IPython.lib.lexers:IPythonLexer"
41-
ipython3 = "IPython.lib.lexers:IPython3Lexer"
42-
4339
[project.scripts]
4440
ipython = "IPython:start_ipython"
4541
ipython3 = "IPython:start_ipython"

0 commit comments

Comments
 (0)