Skip to content

Utilities/Sphinx: Require Sphinx 2.x, fix flake8 gripes

Matthew Woehlke requested to merge matthew-woehlke/cmake:flake8-sphinx into master

Tweak our Sphinx extensions slightly to assert that Sphinx is at least 2.x. Remove hacks for older versions of Sphinx. Port all uses of old-style % string formatting to use f-strings.

Dropping support for Sphinx 1.x cleans up a bunch of messy code and simplifies cleaning up imports. Using f-strings is generally more readable (and often shorter); although they require Python 3.6 or later, that should be available 'stock' on most or all platforms still under support, and besides, we were already using f-strings in some places. Obeying flake8 allows its use to check for possible issues without having to wade through noise about improper styling (and good styling is beneficial in its own right).

Merge request reports