Set GMT_COMPATIBILITY to 6 when pygmt session starts#432
Conversation
To prevent users getting "pygmt-session [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6".
Prevents regression of pygmt-session [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6. Contains setup, test and teardown of a mock session where the user has a gmt.conf file with GMT_COMPATIBILITY = 5.
| assert os.path.exists("gmt.conf") | ||
| os.remove("gmt.conf") |
There was a problem hiding this comment.
I don't think there is a "gmt.conf" file in the current directory. It should be in the temporary gmt session directory.
There was a problem hiding this comment.
I kinda agree, but wouldn't the assertion fail if there isn't a gmt.conf file? 😕 Things got really confusing for me when I was designing this test with gmt.conf files all over the place, one kept popping up in my pygmt folder with GMT_COMPATIBILITY 5 for some reason.
There was a problem hiding this comment.
Ok, you're right, it's in "/home/.../pygmt/tmp-test-dir-with-unique-name/gmt.conf". I'll remove these lines once the tests on Windows pass in the other PR.
There was a problem hiding this comment.
I still don't understand why the test works, but since the test pass, OK to merge.
There was a problem hiding this comment.
Yeah, it's a complicated test. but removing the line at
pygmt/pygmt/session_management.py
Line 19 in 8df13da
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
|
@MarkWieczorek, do you want to test this branch (using |
|
It works! |
Because it's in a temporary pygmt session folder anyway.
Description of proposed changes
To prevent users getting "pygmt-session [ERROR]: GMT_COMPATIBILITY: Expects values from 6 to 6; reset to 6". Overrides GMT_COMPATIBILITY setting in users
gmt.conffile.Fixes #428, #365
Reminders
make formatandmake checkto make sure the code follows the style guide.doc/api/index.rst.