Skip to content

Allow brave users to run PyGMT with old GMT versions? #1991

Closed
@seisman

Description

@seisman

Currently, the minimum required GMT version is 6.3.0 and it's likely that we will bump the minimum required GMT to 6.4.0 in the next few days (#1989).

After bumping to GMT>=6.4.0, users who use old GMT versions (e.g., GMT 6.3.0) won't be able to use future PyGMT versions unless they upgrade their GMT. Since most PyGMT functions still work with GMT 6.3.0, perhaps we should still allow users to run PyGMT with old GMT versions?

Currently, we raise an error and destroy the session:

pygmt/pygmt/clib/session.py

Lines 191 to 196 in edee1c4

if Version(version) < Version(self.required_version):
self.destroy()
raise GMTVersionError(
f"Using an incompatible GMT version {version}. "
f"Must be equal or newer than {self.required_version}."
)

Instead, we can raise a warning like

PyGMT requires GMT 6.4.0 but you're using GMT x.x.x. Some functions may not work as expected.
It's recommended to upgrade your GMT to >=6.4.0. Otherwise, use it at your own risk.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImproving an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions