diff --git a/.github/workflows/ci_tests_legacy.yaml b/.github/workflows/ci_tests_legacy.yaml index 47d8a6ee887..716032b6045 100644 --- a/.github/workflows/ci_tests_legacy.yaml +++ b/.github/workflows/ci_tests_legacy.yaml @@ -1,8 +1,8 @@ -# Test PyGMT with GMT legacy versions on Linux/macOS/Windows +# Test PyGMT with GMT legacy versions and old Python dependencies on Linux/macOS/Windows # -# This workflow runs regular PyGMT tests with GMT legacy versions. Due to the minor -# baseline image changes between GMT versions, the workflow only runs the tests but -# doesn't do image comparisons. +# This workflow runs regular PyGMT tests with GMT legacy versions and old versions of +# all optional and required Python dependencies. Due to minor baseline image changes +# between GMT versions, the workflow runs the tests but doesn't do image comparisons. # # It is scheduled to run every Tuesday on the main branch. # @@ -12,7 +12,7 @@ on: # push: # branches: [ main ] # Uncomment the 'pull_request' line below to trigger the workflow in PR - # pull_request: + pull_request: # types: [ready_for_review] # paths: # - 'pygmt/**' @@ -62,23 +62,6 @@ jobs: python=3.10 gmt=${{ matrix.gmt_version }} ghostscript<10 - numpy<2 - pandas - xarray - netCDF4 - packaging - contextily - geopandas - ipython - pyarrow - rioxarray - sphinx-gallery - make - pip - python-build - pytest - pytest-doctestplus - pytest-mpl # Download cached remote files (artifacts) from GitHub - name: Download remote data from GitHub @@ -95,10 +78,22 @@ jobs: env: GH_TOKEN: ${{ github.token }} + # Install uv package manager + - name: Install uv + uses: astral-sh/setup-uv@v3 + # Install the package that we want to test - name: Install the package - run: make install + run: | + uv venv + source .venv/bin/activate + uv run --with pip==23 --resolution lowest-direct --all-extras --dev make install + uv pip list # Run the tests but skip images - name: Run tests - run: make test_no_images PYTEST_EXTRA="-r P" + run: | + source .venv/bin/activate + uv run --with pytest==8,pytest-mpl==0.17,pytest-doctestplus==1.2 --resolution lowest-direct --all-extras --dev make test_no_images PYTEST_EXTRA="-r P" + env: + GMT_LIBRARY_PATH: $CONDA_PREFIX/lib diff --git a/pygmt/tests/test_clib_to_numpy.py b/pygmt/tests/test_clib_to_numpy.py index 02b65062da8..88845d31f2a 100644 --- a/pygmt/tests/test_clib_to_numpy.py +++ b/pygmt/tests/test_clib_to_numpy.py @@ -10,6 +10,7 @@ import pandas as pd import pytest from packaging.version import Version +from pygmt._show_versions import _get_module_version from pygmt.clib.conversion import _to_numpy from pygmt.helpers.testing import skip_if_no @@ -323,7 +324,13 @@ def test_to_numpy_pyarrow_array_pyarrow_dtypes_numeric_with_na(dtype, expected_d "utf8", # alias for string "large_string", "large_utf8", # alias for large_string - "string_view", + pytest.param( + "string_view", + marks=pytest.mark.skipif( + Version(_get_module_version("pyarrow")) < Version("16"), + reason="string_view type was added since pyarrow 16", + ), + ), ], ) def test_to_numpy_pyarrow_array_pyarrow_dtypes_string(dtype): diff --git a/pyproject.toml b/pyproject.toml index 8400da80625..88cc042848c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,18 +33,18 @@ dependencies = [ "numpy>=1.24", "pandas>=2.0", "xarray>=2023.04", - "netCDF4", - "packaging", + "netCDF4>=1.7", + "packaging>=22.0", ] dynamic = ["version"] [project.optional-dependencies] all = [ - "contextily", - "geopandas", - "IPython", # 'ipython' is not the correct module name. - "pyarrow", - "rioxarray", + "contextily>=1.2", + "geopandas>=0.14", + "IPython>=8", # 'ipython' is not the correct module name. + "pyarrow>=13", + "rioxarray>=0.14", ] [project.urls]