Closed seisman closed 5 months ago
Oops, didn't see this when I opened #3277. I managed to fit things under 50 statements to fix the lint error, but we could move the show_versions()
function if needed?
I prefer to move the show_versions
function to:
pygmt/__init__.py
file shorter_get_ghostscript_version
out of the show_versions
function so that we can better test them.Ok, I can move the function. Looking around, maybe we can put it under _show_versions.py
following https://github.com/corteva/rioxarray/blob/0.15.5/rioxarray/_show_versions.py and https://github.com/scikit-learn/scikit-learn/blob/1.5.0/sklearn/utils/_show_versions.py? Other libraries like xarray
puts it under util/print_versions.py
, and pandas
puts it under utils/_print_versions.py
The "Style Checks" workflow fails with ruff 0.4.6 because the
show_versions()
function has too many branches (https://github.com/GenericMappingTools/pygmt/actions/runs/9277819313/job/25527714073):The
show_versions()
function is also long with ~100 lines. Perhaps we should move it out of thepygmt/__init__.py
file. Maybepygmt/show_versions.py
?https://github.com/GenericMappingTools/pygmt/blob/09e23522f99f80b724a572850198a01aa0d986e4/pygmt/__init__.py#L80