From 3f5f27a34212f347e1d9edf748b3a97f05e5b2de Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Nov 05 2021 05:16:42 +0000 Subject: Add workaround for bug in python-sphinxcontrib-httpdomain 1.7.0 This is needed for the package to build on Fedora 35. JIRA: RHELWF-3788 --- diff --git a/docs/conf.py b/docs/conf.py index 3a27374..fc0ba42 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -19,6 +19,21 @@ import os import sys +# Hot-fix broken sphinxcontrib.httpdomain +# See: https://github.com/sphinx-contrib/httpdomain/pull/54 +try: + import pkg_resources + + if pkg_resources.require("sphinxcontrib_httpdomain")[0].version == '1.7.0': + from sphinxcontrib import httpdomain + + for typed_field in httpdomain.HTTPResource.doc_field_types: + typed_field.typerolename = None + for object_type in httpdomain.HTTPDomain.object_types.values(): + object_type.roles = tuple(r for r in object_type.roles if r != 'obj') +except Exception: + pass + # This will cause the Flask application to be created with development configs os.environ['DEV'] = 'true'