Skip to content

Commit

Permalink
Merge pull request #3350 from ofek/fix-test-warning
Browse files Browse the repository at this point in the history
Fix warning in test suite
  • Loading branch information
willmcgugan committed May 1, 2024
2 parents 245649b + eb35788 commit 027a472
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions docs/requirements.txt
Expand Up @@ -2,3 +2,4 @@ alabaster==0.7.12
Sphinx==5.1.1
sphinx-rtd-theme==1.0.0
sphinx-copybutton==0.5.1
importlib-metadata; python_version < '3.8'
9 changes: 7 additions & 2 deletions docs/source/conf.py
Expand Up @@ -17,10 +17,15 @@

# -- Project information -----------------------------------------------------

import sys

import pkg_resources
import sphinx_rtd_theme

if sys.version_info >= (3, 8):
from importlib.metadata import Distribution
else:
from importlib_metadata import Distribution

html_theme = "sphinx_rtd_theme"

html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
Expand All @@ -30,7 +35,7 @@
author = "Will McGugan"

# The full version, including alpha/beta/rc tags
release = pkg_resources.get_distribution("rich").version
release = Distribution.from_name("rich").version


# -- General configuration ---------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Expand Up @@ -44,6 +44,7 @@ pytest-cov = "^3.0.0"
attrs = "^21.4.0"
pre-commit = "^2.17.0"
asv = "^0.5.1"
importlib-metadata = { version = "*", python = "<3.8" }

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
8 changes: 6 additions & 2 deletions tests/test_syntax.py
Expand Up @@ -3,7 +3,6 @@
import sys
import tempfile

import pkg_resources
import pytest
from pygments.lexers import PythonLexer

Expand All @@ -21,7 +20,12 @@

from .render import render

PYGMENTS_VERSION = pkg_resources.get_distribution("pygments").version
if sys.version_info >= (3, 8):
from importlib.metadata import Distribution
else:
from importlib_metadata import Distribution

PYGMENTS_VERSION = Distribution.from_name("pygments").version
OLD_PYGMENTS = PYGMENTS_VERSION == "2.13.0"

CODE = '''\
Expand Down

0 comments on commit 027a472

Please sign in to comment.