-
Notifications
You must be signed in to change notification settings - Fork 228
Let PyGMT work with the conda GMT package on Windows #434
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6f61ef3
Separate out the libgmt loading tests
leouieda 553c09a
Try to find the Windows library
leouieda c968986
Use .dll instead of .lib
leouieda 4409772
Update pygmt/clib/loading.py
leouieda f21bf74
Re-enable Windows CI in current PR
seisman 298de3b
Fix how DLLs are found
seisman 3f55de7
Set two variables to let pygmt work with conda GMT
seisman 0514bf0
Use the ghostscript from conda-forge
seisman 81ed8f4
Open netcdf grid using with statement
weiji14 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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") |
This file contains hidden or 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
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.
Uh oh!
There was an error while loading. Please reload this page.