Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into ipythongh-13845-fix…
Browse files Browse the repository at this point in the history
…-pygments-entry-points
  • Loading branch information
bollwyvl committed Dec 1, 2022
2 parents 61b0fb8 + 3f0bf05 commit 267b581
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 3 deletions.
4 changes: 2 additions & 2 deletions IPython/core/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
# release. 'dev' as a _version_extra string means this is a development
# version
_version_major = 8
_version_minor = 7
_version_minor = 8
_version_patch = 0
_version_extra = ".dev"
# _version_extra = "rc1"
_version_extra = "" # Uncomment this for full releases
# _version_extra = "" # Uncomment this for full releases

# Construct full version string from these.
_ver = [_version_major, _version_minor, _version_patch]
Expand Down
26 changes: 26 additions & 0 deletions IPython/lib/tests/test_pygments.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from typing import List

import pytest
import pygments.lexers
import pygments.lexer

import IPython.lib.lexers

#: the human-readable names of the IPython lexers
EXPECTED_LEXER_NAMES = [
cls.name for cls in IPython.lib.lexers if issubclass(cls, pygments.lexer.Lexer)
]


@pytest.fixture
def all_pygments_lexer_names() -> List[str]:
"""Get all lexer names registered in pygments."""
return {l[0] for l in pygments.lexers.get_all_lexers()}


@pytest.mark.parametrize("expected_lexer", EXPECTED_LEXER_NAMES)
def test_pygments_entry_points(
expected_lexer: str, all_pygments_lexer_names: List[str]
) -> None:
"""Check whether the ``entry_points`` for ``pygments.lexers`` are correct."""
assert expected_lexer in all_pygments_lexer_names
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@
"ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer",
"ipython = IPython.lib.lexers:IPythonLexer",
"ipython3 = IPython.lib.lexers:IPython3Lexer",
]
],
}

#---------------------------------------------------------------------------
Expand Down

0 comments on commit 267b581

Please sign in to comment.