-
Notifications
You must be signed in to change notification settings - Fork 224
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
Fix ModuleNotFoundError error when IPython is not installed #1247
Conversation
Maybe follow the style of 329e480 to only install IPython on the Python3.9/NumPy1.20 tests, but not on the Python 3.7/NumPy1.17 tests? |
@@ -7,7 +7,7 @@ | |||
|
|||
try: | |||
import IPython | |||
except KeyError: | |||
except ModuleNotFoundError: | |||
IPython = None # pylint: disable=invalid-name |
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 can't see any reporting on Codecov (because the codecov upload doesn't work with test failures due to #1217), but I'm assuming this line has code coverage?
Ok, when IPython isn't installed, there are a few failures on the Python 3.7/NumPy 1.17 tests:
We can either do 1) Use something like pytest.importorskip or 2) Catch the |
Neither is good for the |
As mentioned in #1247 (comment), I'm not happy with either way. Currently, I prefer to only commit the fix (79f329b) and don't try to work on the test/coverage, so that people can still use PyGMT even IPython is not installed (Fix #1241). |
This reverts commit db36410.
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.
As mentioned in #1247 (comment), I'm not happy with either way. Currently, I prefer to only commit the fix (79f329b) and don't try to work on the test/coverage, so that people can still use PyGMT even IPython is not installed (Fix #1241).
Yep, sounds ok with me.
…appingTools#1247) * Fix the exception when IPython is not installed * Install IPython on the Python 3.9/NumPy 1.20 test build only * Revert "Install IPython on the Python 3.9/NumPy 1.20 test build only" This reverts commit db36410.
Description of proposed changes
Fixes #1241.
A test is needed but currently I have no idea how to test it.
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash commands are:
/format
: automatically format and lint the code/test-gmt-dev
: run full tests on the latest GMT development version