Skip to content

Commit fa1ac7f

Browse files
authored
Replace pkg_resources with importlib.resources. (#58)
1 parent d265469 commit fa1ac7f

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

docs/conf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
1414

15+
import importlib.metadata
1516
import os
1617
import sys
1718

18-
import pkg_resources
19-
2019

2120
sys.path.append(os.path.abspath('../src'))
22-
rqmt = pkg_resources.require('zope.testing')[0]
21+
rqmt_version = importlib.metadata.version('zope.testing')
2322
# Import and document the pure-python versions of things; they tend to have
2423
# better docstrings and signatures.
2524
os.environ['PURE_PYTHON'] = '1'
@@ -67,9 +66,9 @@
6766
# built documents.
6867
#
6968
# The short X.Y version.
70-
version = '%s.%s' % tuple(map(int, rqmt.version.split('.')[:2]))
69+
version = '%s.%s' % tuple(map(int, rqmt_version.split('.')[:2]))
7170
# The full version, including alpha/beta/rc tags.
72-
release = rqmt.version
71+
release = rqmt_version
7372

7473
# The language for content autogenerated by Sphinx. Refer to documentation
7574
# for a list of supported languages.

0 commit comments

Comments
 (0)