Skip to content

Commit 0ac3c7b

Browse files
committed
Update copyright year and refactor version retrieval in conf.py
1 parent 8b52adb commit 0ac3c7b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

docs/conf.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@
1414

1515
import os
1616
import sys
17-
18-
import pkg_resources
17+
from datetime import date
18+
from importlib.metadata import version as dist_version
1919

2020

2121
sys.path.append(os.path.abspath('../src'))
22-
rqmt = pkg_resources.require('zope.catalog')[0]
2322

2423
# If extensions (or modules to document with autodoc) are in another directory,
2524
# add these directories to sys.path here. If the directory is relative to the
@@ -56,16 +55,14 @@
5655

5756
# General information about the project.
5857
project = 'zope.catalog'
59-
copyright = '2015-2017, Zope Foundation and Contributors'
58+
copyright = f'2015-{date.today().year}, Zope Foundation and Contributors'
6059

6160
# The version info for the project you're documenting, acts as replacement for
6261
# |version| and |release|, also used in various other places throughout the
6362
# built documents.
6463
#
6564
# The short X.Y version.
66-
version = '%s.%s' % tuple(map(int, rqmt.version.split('.')[:2]))
67-
# The full version, including alpha/beta/rc tags.
68-
release = rqmt.version
65+
version = dist_version('zope.catalog')
6966

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

0 commit comments

Comments
 (0)