-
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 issues for running on Windows #313
Closed
Changes from 17 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
82e15db
Separate out the libgmt loading tests
leouieda fb04b6d
Try to find the Windows library
leouieda c93734b
Use .dll instead of .lib
leouieda aa70177
Set GMT_LIBRARY_PATH
leouieda b21f424
Update pygmt/clib/loading.py
leouieda dfd34e6
Remove the GMT_LIBRARY_PATH definition
leouieda efbd6ab
Temporarily disable clib info printing
leouieda 611e573
Update to RC2
leouieda 2f65ef9
Merge branch 'master' into windows
seisman ce7d12a
Update to GMT6.0.0rc3
seisman 0613fb2
Merge branch 'master' into windows
seisman 197ebb8
Re-enable Windows CI in current PR
seisman da2cfec
Merge branch 'master' into windows
seisman 5b2fb0d
Merge branch 'master' into windows
seisman 10f66c6
Merge branch 'master' into windows
weiji14 4d45c04
Merge branch 'master' into windows
weiji14 c0f9eef
Merge branch 'master' into windows
weiji14 22fd4b0
Try compiling GMT on Windows builds
leouieda 424e9b9
Merge branch 'master' into windows
leouieda 27afcde
Copy over Azure template from GMT
leouieda 0b7f674
Merge branch 'master' into windows
seisman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
Test the functions that load libgmt | ||
""" | ||
import pytest | ||
|
||
from ..clib.loading import clib_name, load_libgmt, check_libgmt | ||
from ..exceptions import GMTCLibError, GMTOSError, GMTCLibNotFoundError | ||
|
||
|
||
def test_check_libgmt(): | ||
"Make sure check_libgmt fails when given a bogus library" | ||
with pytest.raises(GMTCLibError): | ||
check_libgmt(dict()) | ||
|
||
|
||
def test_load_libgmt(): | ||
"Test that loading libgmt works and doesn't crash." | ||
check_libgmt(load_libgmt()) | ||
|
||
|
||
def test_load_libgmt_fail(): | ||
"Test that loading fails when given a bad library path." | ||
env = {"GMT_LIBRARY_PATH": "not/a/real/path"} | ||
with pytest.raises(GMTCLibNotFoundError): | ||
load_libgmt(env=env) | ||
|
||
|
||
def test_clib_name(): | ||
"Make sure we get the correct library name for different OS names" | ||
for linux in ["linux", "linux2", "linux3"]: | ||
assert clib_name(linux) == ["libgmt.so"] | ||
assert clib_name("darwin") == ["libgmt.dylib"] | ||
assert clib_name("win32") == ["gmt.dll", "gmt_w64.dll", "gmt_w32.dll"] | ||
with pytest.raises(GMTOSError): | ||
clib_name("meh") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 both ctypes.CDLL and check_libgmt don't raise any errors, it means we find the library, then we should break out of the loop. Right?
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.
Of course! Thanks, Dongdong. I stopped coding yesterday because I couldn't even see this basic error anymore :)
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 just realized that this change is part of what's been causing our Windows builds to fail... Since we have a list of dll files to check, if one of the dll fails, the variable
error
turnsTrue
and staysTrue
even if a later dll works. Our Linux and MacOS tests work because there's only one item in the list.