sunpy / ablog

ABlog for blogging with Sphinx
https://ablog.readthedocs.io/
Other
181 stars 54 forks source link

ablog doesn't work with sphinx >=7.3.0 #277

Closed stephanlachnit closed 5 months ago

stephanlachnit commented 5 months ago

Describe the bug

Using ablog with sphinx >= 7.3.0 fails with

Theme error:
setting ablog.inject_templates_after_theme occurs in none of the searched theme configs

To Reproduce

No response

Screenshots

No response

System Details

No response

Installation method

pip

Carreau commented 5 months ago

I think this is a problem in sphinx, 360c7a80223e7818d002ce91146ee92c1eae7ec2

-        try:
-            return self.config.get(section, name)
-        except (configparser.NoOptionError, configparser.NoSectionError):
-            if self._base:
-                return self._base.get_config(section, name, default)
-
-            if default is _NO_DEFAULT:
-                raise ThemeError(__('setting %s.%s occurs in none of the '
-                                    'searched theme configs') % (section, name)) from None
-            return default
+        if section == 'theme':
+            value = self._settings.get(name, default)
+        elif section == 'options':
+            value = self._options.get(name, default)
+        else:
+            value = _NO_DEFAULT
+        if value is _NO_DEFAULT:
+            msg = __(
+                'setting %s.%s occurs in none of the searched theme configs',
+            ) % (section, name)
+            raise ThemeError(msg)
+        return value

this means that any section items that is neither 'theme' or 'option' will trigger an error.

EDIT : Though this commit is in earlier version of sphinx so I'm not sure. EDIT2: That is because there was 7 (!!) patch releases of sphinx yesterday.

Carreau commented 5 months ago

Bisect does point to the above commit.

nabobalis commented 5 months ago

Thanks for the report!

I will have to pin sphinx for now and then fix it when I get some more time.

nabobalis commented 5 months ago

The patch seems to be small so I will just add support for sphinx instead.