diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6cc4895..3e65992 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,9 +14,10 @@ jobs: build: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: # pick lower and upper versions only - python-version: ["3.8", "3.12"] + python-version: ["3.9", "3.12"] steps: - uses: actions/checkout@v4 @@ -56,6 +57,12 @@ jobs: run: | pytest -v gridit --doctest-modules + - name: Run tests with older packages + if: matrix.python-version == '3.9' + run: | + pip install "pandas<2.0" "geopandas<1.0" "fiona<1.10" "shapely<2.0" "numpy<2.0" + pytest -v -n2 --cov --cov-append + - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v4 with: diff --git a/pyproject.toml b/pyproject.toml index 73b61f3..c36f965 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ classifiers = [ "Programming Language :: Python :: 3 :: Only", "Topic :: Scientific/Engineering :: GIS", ] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "numpy", ] diff --git a/tests/test_cli.py b/tests/test_cli.py index 3ae5022..acb659a 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -110,7 +110,10 @@ def test_grid_from_bbox_array_from_vector_attribute(tmp_path, grid_from_bbox_arg ) assert not (tmp_path / "out.prj").exists() with fiona.open(out_shp) as ds: - resulting_properties = dict(ds.schema["properties"]) + resulting_properties = { + k: v.replace("int32", "int") + for k, v in dict(ds.schema["properties"]).items() + } expected_properties = { "idx": "int:4", "row": "int:2", @@ -179,14 +182,18 @@ def test_grid_from_vector_array_from_netcdf(tmp_path): } ) with fiona.open(out_shp) as ds: - assert dict(ds.schema["properties"]) == { - "idx": "int:4", - "row": "int:2", - "col": "int:2", - "quantile(0": "float:22.20", - "max": "float:22.20", - } assert len(ds) == 4620 + resulting_properties = { + k: v.replace("int32", "int") + for k, v in dict(ds.schema["properties"]).items() + } + assert resulting_properties == { + "idx": "int:4", + "row": "int:2", + "col": "int:2", + "quantile(0": "float:22.20", + "max": "float:22.20", + } @requires_pkg("flopy") diff --git a/tests/test_file.py b/tests/test_file.py index 09834c7..fdbf192 100644 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -163,7 +163,11 @@ def test_write_vector(tmp_path, grid_basic, grid_projection): assert not ds.crs schema = ds.schema assert schema["geometry"] == "Polygon" - assert dict(ds.schema["properties"]) == { + schema_properties = { + k: v.replace("int32", "int") + for k, v in dict(ds.schema["properties"]).items() + } + assert schema_properties == { "idx": "int:3", "row": "int:2", "col": "int:2", @@ -203,7 +207,11 @@ def test_write_vector(tmp_path, grid_basic, grid_projection): assert ds.crs is not None schema = ds.schema assert schema["geometry"] == "Polygon" - assert dict(ds.schema["properties"]) == { + schema_properties = { + k: v.replace("int32", "int") + for k, v in dict(ds.schema["properties"]).items() + } + assert schema_properties == { "idx": "int:3", "row": "int:2", "col": "int:2", @@ -243,7 +251,11 @@ def test_write_vector(tmp_path, grid_basic, grid_projection): assert ds.crs is not None schema = ds.schema assert schema["geometry"] == "Polygon" - assert dict(ds.schema["properties"]) == { + schema_properties = { + k: v.replace("int32", "int") + for k, v in dict(ds.schema["properties"]).items() + } + assert schema_properties == { "idx": "int", "row": "int", "col": "int",