Skip to content

Why is autodoc_enhancements.py giving MatplotlibDeprecationWarning ? #125

Closed

Description

@pllim
The validCap attribute was deprecated in Matplotlib 3.4 and will be removed two minor releases later.
  return getattr(obj, attr, *defargs)
.../sphinx_automodapi/autodoc_enhancements.py:71: MatplotlibDeprecationWarning: 
The validJoin attribute was deprecated in Matplotlib 3.4 and will be removed two minor releases later.
  return getattr(obj, attr, *defargs)
.../sphinx_automodapi/autodoc_enhancements.py:71: MatplotlibDeprecationWarning: 

xref astropy/astropy#11458

Activity

  1. pllim commented on Apr 2, 2021

    @pllim
    MemberAuthor

    The problem is upstream. See matplotlib/matplotlib#19839

  2. pllim commented on Apr 2, 2021

    @pllim
    MemberAuthor

    Fore future reference, this patch helped smoked out the cause:

    --- a/sphinx_automodapi/autodoc_enhancements.py
    +++ b/sphinx_automodapi/autodoc_enhancements.py
    @@ -1,6 +1,8 @@
     """
     Miscellaneous enhancements to help autodoc along.
     """
    +import warnings
    +
     from sphinx.ext.autodoc import AttributeDocumenter
     
     __all__ = []
    @@ -58,7 +60,12 @@ def type_object_attrgetter(obj, attr, *defargs):
                     return base.__dict__[attr]
                 break
     
    -    return getattr(obj, attr, *defargs)
    +    with warnings.catch_warnings():
    +        warnings.simplefilter('error')
    +        print(f'****** {obj} *** {attr} *** {defargs}')
    +        x = getattr(obj, attr, *defargs)
    +
    +    return x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions