-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
In the build, declare all (compulsory) extension modules together. #14442
Conversation
1552c3c
to
b9bc3e6
Compare
... in a single function. Splitting them over multiple classes doesn't really buy much. Also convert the LibAgg and Qhull classes to toplevel functions, as they play a role similar to add_numpy_flags.
sources = [ | ||
'src/_macosx.m' | ||
] | ||
ext = Extension('matplotlib.backends._macosx', sources) | ||
ext.extra_link_args.extend(['-framework', 'Cocoa']) | ||
if platform.python_implementation().lower() == 'pypy': | ||
ext.extra_compile_args.append('-DPYPY=1') | ||
return ext | ||
yield ext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's clearer to just return a 1-element list here?
yield ext | |
return [ext] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's actually less consistent with the sole other (non-empty) implementation of get_extensions() (the main list), but can do the change if you insist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While return
specifies the return value completely, yield
specifies only one element (of possibly many), so you need more context to infer the full returned result. But I don't really mind.
... in a single function.
Splitting them over multiple classes doesn't really buy much.
Also convert the LibAgg and Qhull classes to toplevel functions,
as they play a role similar to add_numpy_flags.
I plan to do the same to agg and tkagg once #13075 gets in.done.PR Summary
PR Checklist