-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
WIP: Test in a minimal Python configuration #11281
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
Conversation
This removes most of the optional Python modules and makes sure basic matplotlib functionality still works.
# separate, more limited process. | ||
|
||
PYTEST_REQUIREMENTS = [ | ||
'_posixsubprocess', 'select', 'binascii', 'pyexpat', '_socket' |
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.
What's your plan with these? Especially subprocess, which I guess is likely unavailable in js systems, but has become a hard dependency now that we killed matplotlib.compat.subprocess? (In reality I think systems that have no support for subprocess should still provide a shim module that throws in the Popen constructor, which is easy to provide and avoids all downstream projects from having to provide such a shim.)
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 don't have a certain plan, other than to run the tests in a separate Python from py.test itself, which should be possible with pytest-xdist. It's made even more complicated by the fact that matplotlib's own testing framework also needs subprocess (to run inkscape and ghostscript etc.) Lord knows what the performance will be like. I sort of see this as a first pass of "better than nothing for now."
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.
Again, how hard would it be for pyodide to just provide shims of subprocess and multiprocessing similar to https://github.com/matplotlib/matplotlib/blob/v2.2.2/lib/matplotlib/compat/subprocess.py (which we have recently removed)?
That'll make life easier for all downstream projects...
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.
What we be the purpose of this if it didn't actually work? Just to get things to import?
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.
Yes. It seems to be a bit excessive to ask each and every project to wrap their "import subprocess" (most of which are at the toplevel) in a try... except; at least if you provide shims then the discussion becomes "what features of the project don't work when subprocess isn't present" rather than "the thing doesn't even import".
if modulename not in KEEP_MODULES: | ||
yield modulename | ||
|
||
# Some other commonly-missing modules that aren't in Setup.dist |
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.
If you're going to hardcode a list there you may as well do without Setup.dist and just hardcode the entire list...
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.
Perhaps. Some of the stuff is optional due to Setup.dist, and some things are turned on/off by environment tests in CPython's configure script. The latter is harder to pick out automatically, but maybe not impossible.
See also https://bugs.python.org/issue34895 for cpython work on listing "optional" modules. |
Closing as abandoned, but of course re-open if still pursuing this ;-) |
This removes most of the optional Python modules and makes sure basic
matplotlib functionality still works. See discussion in #11263 for motivation.
Marking as "WIP" just because this stuff usually takes a while to get right on Travis.
PR Summary
PR Checklist