File tree 4 files changed +15
-4
lines changed
4 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -2,3 +2,4 @@ alabaster==0.7.12
2
2
Sphinx == 5.1.1
3
3
sphinx-rtd-theme == 1.0.0
4
4
sphinx-copybutton == 0.5.1
5
+ importlib-metadata ; python_version < '3.8'
Original file line number Diff line number Diff line change 17
17
18
18
# -- Project information -----------------------------------------------------
19
19
20
+ import sys
20
21
21
- import pkg_resources
22
22
import sphinx_rtd_theme
23
23
24
+ if sys .version_info >= (3 , 8 ):
25
+ from importlib .metadata import Distribution
26
+ else :
27
+ from importlib_metadata import Distribution
28
+
24
29
html_theme = "sphinx_rtd_theme"
25
30
26
31
html_theme_path = [sphinx_rtd_theme .get_html_theme_path ()]
30
35
author = "Will McGugan"
31
36
32
37
# The full version, including alpha/beta/rc tags
33
- release = pkg_resources . get_distribution ("rich" ).version
38
+ release = Distribution . from_name ("rich" ).version
34
39
35
40
36
41
# -- General configuration ---------------------------------------------------
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ pytest-cov = "^3.0.0"
44
44
attrs = " ^21.4.0"
45
45
pre-commit = " ^2.17.0"
46
46
asv = " ^0.5.1"
47
+ importlib-metadata = { version = " *" , python = " <3.8" }
47
48
48
49
[build-system ]
49
50
requires = [" poetry-core>=1.0.0" ]
Original file line number Diff line number Diff line change 3
3
import sys
4
4
import tempfile
5
5
6
- import pkg_resources
7
6
import pytest
8
7
from pygments .lexers import PythonLexer
9
8
21
20
22
21
from .render import render
23
22
24
- PYGMENTS_VERSION = pkg_resources .get_distribution ("pygments" ).version
23
+ if sys .version_info >= (3 , 8 ):
24
+ from importlib .metadata import Distribution
25
+ else :
26
+ from importlib_metadata import Distribution
27
+
28
+ PYGMENTS_VERSION = Distribution .from_name ("pygments" ).version
25
29
OLD_PYGMENTS = PYGMENTS_VERSION == "2.13.0"
26
30
27
31
CODE = '''\
You can’t perform that action at this time.
0 commit comments