GenericMappingTools / pygmt

A Python interface for the Generic Mapping Tools.
https://www.pygmt.org
BSD 3-Clause "New" or "Revised" License
747 stars 216 forks source link

Not working with GMT 6.0.0rc1 #310

Closed claudiodsf closed 5 years ago

claudiodsf commented 5 years ago

Hi, I just installed GMT 6.0.0rc1 on macOS through homebrew and pygmt from source, but when try importing pygmt, I get the following error:

GMTVersionError: Using an incompatible GMT version 6.0.0rc1. Must be newer than 6.0.0.
welcome[bot] commented 5 years ago

👋 Thanks for opening your first issue here! Please make sure you filled out the template with as much detail as possible. You might also want to take a look at our contributing guidelines and code of conduct.

claudiodsf commented 5 years ago

The problem can be reduced to this:

>>> from packaging.version import Version
>>> Version('6.0.0rc1') < Version('6.0.0')
True
claudiodsf commented 5 years ago

By the way, the error message should say:

Must be equal or newer than 6.0.0.
seisman commented 5 years ago

Yes, 6.0.0rc1 is a pre-release version. I think the solution is to change the required_version to 6.0.0rc1.

https://github.com/GenericMappingTools/pygmt/blob/997b88c855c12ffacd2c4b911f3fa83244ce8d7b/pygmt/clib/session.py#L114-L115

claudiodsf commented 5 years ago

Yep, I agree.

seisman commented 5 years ago

Could you submit a PR?

claudiodsf commented 5 years ago

Ok