Skip to content

Commit

Permalink
Have sphinx > 3.0 ignore monkeypatched sas.models
Browse files Browse the repository at this point in the history
sas.models is a monkeypatched sasmodels that breaks sphinx autodoc.

Fixing this in a way that is compatible with both sphinx 1.8 and 3.x seems
difficult, so put a sphinx version check on the fix.

See SasView#1744
  • Loading branch information
llimeht committed Apr 5, 2021
1 parent bcbc496 commit 2c3c240
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/sphinx-docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,15 @@
rst_prolog = fid.read()

numfig = True

import sphinx
if sphinx.version_info[0] >= 3: # CRUFT

# Skip the monkey-patched 'sas.models' which grafts the sasmodels classes
# back into their old location in sasview, but causes autodoc to explode.
def autodoc_skip_member_handler(app, what, name, obj, skip, options):
return name.startswith("sas.models")

def setup(app):
# Connect the autodoc-skip-member event from apidoc to the callback
app.connect('autodoc-skip-member', autodoc_skip_member_handler)

0 comments on commit 2c3c240

Please sign in to comment.