Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DOC/API: set __qualname__ when using class factory #17525

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2020

Conversation

tacaswell
Copy link
Member

@tacaswell tacaswell commented May 28, 2020

PR Summary

In patheffects.py we have a helper function to reduce the
boiler plate in defining the path effect sub-classes. We are setting
the __name__ and __doc__ to (templated) values, but were not
setting the __qualname__ which was leaving the string '' in
the __qualname__. This string is then used by sphinx-gallery to
generate an index of examples that use a given class with files named
like f'{obj.__qualname__}.examples' which works correctly (but not
in the way we want) on liunx but fails on windows as <> are
forbidden in file names.-

This sets the __qualname__ to match the __name__ and fully
simulate defining these classes in the module.

The changes that broke this came in via #15515

In patheffects.py we have a helper function to reduce the
boiler plate in defining the path effect sub-classes.  We are setting
the `__name__` and `__doc__` to (templated) values, but were not
setting the `__qualname__` which was leaving the string '<locals>' in
the `__qualname__`.  This string is then used by sphinx-gallery to
generate an index of examples that use a given class with files named
like `f'{obj.__qualname__}.examples'` which works correctly (but not
in the way we want) on liunx but fails on windows as `<>` are
forbidden in file names.-

This sets the `__qualname__` to match the `__name__` and fully
simulate defining these classes in the module.
@tacaswell tacaswell added this to the v3.2.2 milestone May 28, 2020
@tacaswell tacaswell requested review from story645 and anntzer May 28, 2020 02:59
@QuLogic
Copy link
Member

QuLogic commented May 28, 2020

#15515 is not in 3.2...

@QuLogic QuLogic modified the milestones: v3.2.2, v3.3.0 May 28, 2020
@tacaswell
Copy link
Member Author

Fair! I must have miss-read the follows / precedes information in the git logs.

Copy link
Member

@story645 story645 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on windows gallery now builds

@anntzer anntzer merged commit eaf7e8f into matplotlib:master May 28, 2020
@tacaswell tacaswell deleted the doc_fix_build branch May 28, 2020 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants