GenericMappingTools / pygmt

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

WIP: Test lowest versions of all required and optional dependencies #3639

Open weiji14 opened 1 week ago

weiji14 commented 1 week ago

Description of proposed changes

Test lowest versions of all direct dependencies of PyGMT listed in the pyproject.toml file (both required and optional dependencies).

This implements the idea at https://github.com/GenericMappingTools/pygmt/issues/3615#issuecomment-2472660976 on .github/workflows/ci_tests_legacy.yaml (instead of ci_tests.yaml) by using the uv package manager's --resolution lowest-direct strategy (https://docs.astral.sh/uv/concepts/resolution/#resolution-strategy).

Related to optional dependency policy at https://github.com/GenericMappingTools/pygmt/issues/3456, and complements #3615 by testing lowest versions of transitive dependencies more thoroughly. The following version pins have been set:

Package Pin Reason
netCDF4 >=1.7 https://github.com/GenericMappingTools/pygmt/pull/3639#discussion_r1851215454
packaging >=22.0 See commit msg in d1fa38d2393c613af8ef4149744beb6e7681683e
contextily >=1.2 added xyzservices as requirement, https://github.com/GenericMappingTools/pygmt/pull/3639#discussion_r1853062032
geopandas >=0.14 trying to move to geopandas 1.x soon, see https://github.com/GenericMappingTools/pygmt/issues/3456#issuecomment-2472641931
IPython >=8 nice round number
pyarrow >=13 better datetime64 unit preservation https://github.com/GenericMappingTools/pygmt/pull/3639#discussion_r1853479174
rioxarray >=0.14 v0.14.0 released Mar 2023 is pinned to rasterio>=1.2 and Python>=3.9

Testing locally

If it helps, this is how I'm testing locally using nektos/act:

Reminders

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform specific operations. Supported slash command is:

seisman commented 1 week ago

I'm unsure if "uv" is a good solution here, since it installs packages from PyPI only, but GMT is only available on conda-forge. It means we will mix packages from conda-forge and PyPI, which is usually not recommended.

seisman commented 1 week ago

BTW, the "Install package" step has errors but the step still passes.

weiji14 commented 1 week ago

I'm unsure if "uv" is a good solution here, since it installs packages from PyPI only, but GMT is only available on conda-forge. It means we will mix packages from conda-forge and PyPI, which is usually not recommended.

We have a similar situation in ci_tests_dev.yaml where we install some packages from conda, compile GMT manually, and install Python dependencies from PyPI. But yeah, definitely not recommended (which is why I'm running this on ci_tests_legacy.yaml instead of ci_tests.yaml). This PR is more of a proof of concept right now, and will at least allow us to check what lower bound pins might be needed.

BTW, the "Install package" step has errors but the step still passes.

Yes, I noticed that. Struggling to see if there's an upstream issue on this at https://github.com/astral-sh/uv/issues. Need to find a way to make it return a non-zero exit code.