Skip to content

Commit 21ce916

Browse files
authored
allow building docs with python 3.8 (xmlsec#227)
Signed-off-by: oleg.hoefling <[email protected]> Signed-off-by: oleg.hoefling <[email protected]>
1 parent b483b64 commit 21ce916

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

doc/source/conf.py

+10-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# -*- coding: utf-8 -*-
22

3-
import sys
3+
from __future__ import annotations
4+
45
import urllib.request
6+
import importlib.metadata
57

68
import lxml
79
from docutils.nodes import Text, reference
@@ -11,11 +13,6 @@
1113
from sphinx.environment import BuildEnvironment
1214
from sphinx.errors import ExtensionError
1315

14-
if sys.version_info >= (3, 8):
15-
from importlib import metadata as importlib_metadata
16-
else:
17-
import importlib_metadata
18-
1916

2017
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.intersphinx']
2118

@@ -28,11 +25,10 @@
2825
project = u'python-xmlsec'
2926
copyright = u'2020, Oleg Hoefling <[email protected]>' # noqa: A001
3027
author = u'Bulat Gaifullin <[email protected]>'
31-
release = importlib_metadata.version('xmlsec')
28+
release = importlib.metadata.version('xmlsec')
3229
parsed: Version = parse(release)
3330
version = '{}.{}'.format(parsed.major, parsed.minor)
3431

35-
language = None
3632
exclude_patterns: list[str] = []
3733
pygments_style = 'sphinx'
3834
todo_include_todos = False
@@ -69,6 +65,12 @@
6965
autodoc_member_order = 'groupwise'
7066
autodoc_docstring_signature = True
7167

68+
69+
rst_prolog = '''
70+
.. role:: xml(code)
71+
:language: xml
72+
'''
73+
7274
# LXML crossref'ing stuff:
7375
# LXML doesn't have an intersphinx docs,
7476
# so we link to lxml.etree._Element explicitly

doc/source/index.rst

-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
You can adapt this file completely to your liking, but it should at least
44
contain the root ``toctree`` directive.
55
6-
.. role:: xml(code)
7-
:language: xml
8-
96
Welcome to python-xmlsec's documentation!
107
=========================================
118

0 commit comments

Comments
 (0)