From 4f239613c6d627114998a9943648111150f32a40 Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 15:37:17 +0200 Subject: [PATCH 01/11] Trigger tests against PR --- .github/workflows/build-and-release.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 8fb0b1e..878cdd3 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -4,6 +4,10 @@ on: push: tags: - '**' + pull_request: + branches: + - develop + - master jobs: From dbeb6adbdcdbaee9a9f69aac6cc2da9237d11632 Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 15:37:52 +0200 Subject: [PATCH 02/11] Run create release and related jobs only on tags --- .github/workflows/build-and-release.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index 878cdd3..cf5d8cf 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -14,9 +14,12 @@ jobs: create_release: name: Create Release runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} job_status: ${{ job.status }} + steps: - name: Checkout project uses: actions/checkout@v3 From ec69b25504c0d70aae5696624ab238fbb15e93eb Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:39:02 +0000 Subject: [PATCH 03/11] =?UTF-8?q?[pre-commit.ci]=20Corrections=20automatiq?= =?UTF-8?q?ues=20appliqu=C3=A9es=20par=20les=20git=20hooks.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_layer.py | 2 -- tests/test_pyramid.py | 19 +++++++++---------- tests/test_raster.py | 2 +- tests/test_storage.py | 23 +++++++++++------------ tests/test_tile_matrix_set.py | 24 ++++++++++++------------ tests/test_utils.py | 13 ++++++------- tests/test_vector.py | 10 +++++----- 7 files changed, 44 insertions(+), 49 deletions(-) diff --git a/tests/test_layer.py b/tests/test_layer.py index 9cd314b..a4df1b3 100644 --- a/tests/test_layer.py +++ b/tests/test_layer.py @@ -2,8 +2,6 @@ from unittest import mock from unittest.mock import * -import pytest - from rok4.enums import PyramidType from rok4.exceptions import * from rok4.layer import Layer diff --git a/tests/test_pyramid.py b/tests/test_pyramid.py index e71dd15..f44eed7 100644 --- a/tests/test_pyramid.py +++ b/tests/test_pyramid.py @@ -7,14 +7,13 @@ from rok4.enums import SlabType, StorageType from rok4.exceptions import * from rok4.pyramid import * -from rok4.tile_matrix_set import TileMatrixSet from rok4.utils import * @mock.patch("rok4.pyramid.get_data_str", side_effect=StorageError("FILE", "Not found")) def test_wrong_file(mocked_get_data_str): with pytest.raises(StorageError): - pyramid = Pyramid.from_descriptor("file:///pyramid.json") + Pyramid.from_descriptor("file:///pyramid.json") @mock.patch( @@ -23,7 +22,7 @@ def test_wrong_file(mocked_get_data_str): ) def test_bad_json(mocked_get_data_str): with pytest.raises(FormatError) as exc: - pyramid = Pyramid.from_descriptor("file:///pyramid.json") + Pyramid.from_descriptor("file:///pyramid.json") assert ( str(exc.value) @@ -35,7 +34,7 @@ def test_bad_json(mocked_get_data_str): @mock.patch("rok4.pyramid.get_data_str", return_value='{"format": "TIFF_PBF_MVT","levels":[]}') def test_missing_tms(mocked_get_data_str): with pytest.raises(MissingAttributeError) as exc: - pyramid = Pyramid.from_descriptor("file:///pyramid.json") + Pyramid.from_descriptor("file:///pyramid.json") assert str(exc.value) == "Missing attribute 'tile_matrix_set' in 'file:///pyramid.json'" mocked_get_data_str.assert_called_once_with("file:///pyramid.json") @@ -49,7 +48,7 @@ def test_missing_tms(mocked_get_data_str): @mock.patch("rok4.pyramid.TileMatrixSet", side_effect=StorageError("FILE", "TMS not found")) def test_wrong_tms(mocked_tms_constructor, mocked_get_data_str): with pytest.raises(StorageError) as exc: - pyramid = Pyramid.from_descriptor("file:///pyramid.json") + Pyramid.from_descriptor("file:///pyramid.json") assert str(exc.value) == "Issue occured using a FILE storage : TMS not found" mocked_tms_constructor.assert_called_once_with("PM") @@ -64,7 +63,7 @@ def test_wrong_tms(mocked_tms_constructor, mocked_get_data_str): @mock.patch("rok4.pyramid.TileMatrixSet") def test_raster_missing_raster_specifications(mocked_tms_class, mocked_get_data_str): with pytest.raises(MissingAttributeError) as exc: - pyramid = Pyramid.from_descriptor("file:///pyramid.json") + Pyramid.from_descriptor("file:///pyramid.json") assert str(exc.value) == "Missing attribute 'raster_specifications' in 'file:///pyramid.json'" mocked_get_data_str.assert_called_once_with("file:///pyramid.json") @@ -83,7 +82,7 @@ def test_wrong_level(mocked_tms_class, mocked_get_data_str): mocked_tms_class.return_value = tms_instance with pytest.raises(Exception) as exc: - pyramid = Pyramid.from_descriptor("file:///pyramid.json") + Pyramid.from_descriptor("file:///pyramid.json") mocked_tms_class.assert_called_once_with("PM") mocked_get_data_str.assert_called_once_with("file:///pyramid.json") @@ -102,7 +101,7 @@ def test_wrong_level(mocked_tms_class, mocked_get_data_str): @mock.patch("rok4.pyramid.TileMatrixSet", autospec=True) def test_vector_missing_tables(mocked_tms_class, mocked_get_data_str): with pytest.raises(MissingAttributeError) as exc: - pyramid = Pyramid.from_descriptor("file:///pyramid.json") + Pyramid.from_descriptor("file:///pyramid.json") assert str(exc.value) == "Missing attribute levels[].'tables' in 'file:///pyramid.json'" mocked_get_data_str.assert_called_once_with("file:///pyramid.json") @@ -119,7 +118,7 @@ def test_raster_ok(mocked_put_data_str, mocked_tms_class, mocked_get_data_str): tms_instance = MagicMock() tms_instance.name = "PM" tms_instance.srs = "EPSG:3857" - tms_instance.sr = sr_src = srs_to_spatialreference("EPSG:3857") + tms_instance.sr = srs_to_spatialreference("EPSG:3857") tm_instance = MagicMock() tm_instance.id = "0" @@ -191,7 +190,7 @@ def test_vector_ok(mocked_tms_class, mocked_get_data_str): except Exception as exc: assert False, f"Pyramid creation raises an exception: {exc}" - with pytest.raises(Exception) as exc: + with pytest.raises(Exception): pyramid.get_tile_data_raster("12", 5, 6) diff --git a/tests/test_raster.py b/tests/test_raster.py index 8bf80f0..064d4bc 100644 --- a/tests/test_raster.py +++ b/tests/test_raster.py @@ -10,7 +10,7 @@ import math import random from unittest import TestCase, mock -from unittest.mock import MagicMock, Mock, call, mock_open, patch +from unittest.mock import MagicMock, call, mock_open import pytest diff --git a/tests/test_storage.py b/tests/test_storage.py index f2649e5..f5c4889 100644 --- a/tests/test_storage.py +++ b/tests/test_storage.py @@ -4,7 +4,6 @@ import botocore.exceptions import pytest -from rados import ObjectNotFound from rok4.enums import StorageType from rok4.exceptions import * @@ -55,13 +54,13 @@ def test_get_path_from_infos(): @mock.patch.dict(os.environ, {}, clear=True) def test_s3_missing_env(): with pytest.raises(MissingEnvironmentError): - data = get_data_str("s3://bucket/path/to/object") + get_data_str("s3://bucket/path/to/object") @mock.patch.dict(os.environ, {}, clear=True) def test_ceph_missing_env(): with pytest.raises(MissingEnvironmentError): - data = get_data_str("ceph://bucket/path/to/object") + get_data_str("ceph://bucket/path/to/object") @mock.patch.dict( @@ -71,7 +70,7 @@ def test_ceph_missing_env(): ) def test_s3_invalid_envs(): with pytest.raises(StorageError): - data = get_data_str("s3://bucket/path/to/object") + get_data_str("s3://bucket/path/to/object") @mock.patch.dict( @@ -79,17 +78,17 @@ def test_s3_invalid_envs(): ) @mock.patch("rok4.storage.boto3.client") def test_s3_invalid_endpoint(mocked_s3_client): - s3_instance = MagicMock() + MagicMock() mocked_s3_client.side_effect = Exception("Invalid URL") with pytest.raises(StorageError): - data = get_data_str("s3://bucket/path/to/object") + get_data_str("s3://bucket/path/to/object") @mock.patch.dict(os.environ, {}, clear=True) @mock.patch("builtins.open", side_effect=FileNotFoundError("not_found")) def test_file_read_error(mock_file): with pytest.raises(FileNotFoundError): - data = get_data_str("file:///path/to/file.ext") + get_data_str("file:///path/to/file.ext") mock_file.assert_called_with("/path/to/file.ext", "rb") @@ -117,7 +116,7 @@ def test_s3_read_nok(mocked_s3_client): s3_instance.get_object.side_effect = Exception("Bucket or object not found") mocked_s3_client.return_value = s3_instance with pytest.raises(StorageError): - data = get_data_str("s3://bucket/path/to/object") + get_data_str("s3://bucket/path/to/object") @mock.patch.dict( @@ -171,7 +170,7 @@ def test_http_read_error(mock_http): requests_instance.content = "NULL" requests_instance.status_code = 404 mock_http.return_value = requests_instance - data = get_data_str("http://path/to/file.ext") + get_data_str("http://path/to/file.ext") mock_http.assert_called_with("http://path/to/file.ext", stream=True) @@ -179,7 +178,7 @@ def test_http_read_error(mock_http): @mock.patch.dict(os.environ, {}, clear=True) def test_http_read_range_error(): with pytest.raises(NotImplementedError): - data = get_data_binary("http://path/to/file.ext", (0, 100)) + get_data_binary("http://path/to/file.ext", (0, 100)) @mock.patch.dict(os.environ, {}, clear=True) @@ -925,7 +924,7 @@ def test_size_path_file_ok(): def test_size_file_nok(): with pytest.raises(StorageError): - size = size_path("file://tests/fixtures/TIFF_PBF_M") + size_path("file://tests/fixtures/TIFF_PBF_M") @mock.patch.dict( @@ -935,7 +934,7 @@ def test_size_file_nok(): ) def test_size_path_ceph_nok(): with pytest.raises(NotImplementedError): - size = size_path("ceph://pool/path") + size_path("ceph://pool/path") @mock.patch.dict( diff --git a/tests/test_tile_matrix_set.py b/tests/test_tile_matrix_set.py index faf03f1..619994a 100644 --- a/tests/test_tile_matrix_set.py +++ b/tests/test_tile_matrix_set.py @@ -11,14 +11,14 @@ @mock.patch.dict(os.environ, {}, clear=True) def test_missing_env(): with pytest.raises(MissingEnvironmentError): - tms = TileMatrixSet("tms") + TileMatrixSet("tms") @mock.patch.dict(os.environ, {"ROK4_TMS_DIRECTORY": "file:///path/to"}, clear=True) @mock.patch("rok4.tile_matrix_set.get_data_str", side_effect=StorageError("FILE", "Not found")) def test_wrong_file(mocked_get_data_str): with pytest.raises(StorageError): - tms = TileMatrixSet("tms") + TileMatrixSet("tms") @mock.patch.dict(os.environ, {"ROK4_TMS_DIRECTORY": "file:///path/to"}, clear=True) @@ -27,8 +27,8 @@ def test_wrong_file(mocked_get_data_str): return_value='"crs":"EPSG:3857","orderedAxes":["X","Y"],"id":"PM"}', ) def test_bad_json(mocked_get_data_str): - with pytest.raises(FormatError) as exc: - tms = TileMatrixSet("tms") + with pytest.raises(FormatError): + TileMatrixSet("tms") mocked_get_data_str.assert_called_once_with("file:///path/to/tms.json") @@ -39,7 +39,7 @@ def test_bad_json(mocked_get_data_str): ) def test_missing_id(mocked_get_data_str): with pytest.raises(MissingAttributeError) as exc: - tms = TileMatrixSet("tms") + TileMatrixSet("tms") assert str(exc.value) == "Missing attribute 'id' in 'file:///path/to/tms.json'" mocked_get_data_str.assert_called_once_with("file:///path/to/tms.json") @@ -51,7 +51,7 @@ def test_missing_id(mocked_get_data_str): ) def test_missing_crs(mocked_get_data_str): with pytest.raises(MissingAttributeError) as exc: - tms = TileMatrixSet("tms") + TileMatrixSet("tms") assert str(exc.value) == "Missing attribute 'crs' in 'file:///path/to/tms.json'" mocked_get_data_str.assert_called_once_with("file:///path/to/tms.json") @@ -63,7 +63,7 @@ def test_missing_crs(mocked_get_data_str): ) def test_wrong_crs(mocked_get_data_str): with pytest.raises(Exception) as exc: - tms = TileMatrixSet("tms") + TileMatrixSet("tms") assert ( str(exc.value) == "Wrong attribute 'crs' ('epsg:123456') in 'file:///path/to/tms.json', not recognize by OSR" @@ -78,7 +78,7 @@ def test_wrong_crs(mocked_get_data_str): ) def test_wrong_axes_order(mocked_get_data_str): with pytest.raises(Exception) as exc: - tms = TileMatrixSet("tms") + TileMatrixSet("tms") assert ( str(exc.value) == "TMS 'file:///path/to/tms.json' own invalid axes order : only X/Y or Lon/Lat are handled" @@ -93,7 +93,7 @@ def test_wrong_axes_order(mocked_get_data_str): ) def test_missing_levels(mocked_get_data_str): with pytest.raises(MissingAttributeError) as exc: - tms = TileMatrixSet("tms") + TileMatrixSet("tms") assert str(exc.value) == "Missing attribute 'tileMatrices' in 'file:///path/to/tms.json'" mocked_get_data_str.assert_called_once_with("file:///path/to/tms.json") @@ -105,7 +105,7 @@ def test_missing_levels(mocked_get_data_str): ) def test_no_levels(mocked_get_data_str): with pytest.raises(Exception) as exc: - tms = TileMatrixSet("tms") + TileMatrixSet("tms") assert str(exc.value) == "TMS 'file:///path/to/tms.json' has no level" mocked_get_data_str.assert_called_once_with("file:///path/to/tms.json") @@ -117,7 +117,7 @@ def test_no_levels(mocked_get_data_str): ) def test_wrong_level(mocked_get_data_str): with pytest.raises(MissingAttributeError) as exc: - tms = TileMatrixSet("tms") + TileMatrixSet("tms") assert str(exc.value) == "Missing attribute tileMatrices[].'id' in 'file:///path/to/tms.json'" mocked_get_data_str.assert_called_once_with("file:///path/to/tms.json") @@ -129,7 +129,7 @@ def test_wrong_level(mocked_get_data_str): ) def test_wrong_level_id(mocked_get_data_str): with pytest.raises(Exception) as exc: - tms = TileMatrixSet("tms") + TileMatrixSet("tms") assert ( str(exc.value) diff --git a/tests/test_utils.py b/tests/test_utils.py index 0b73b9e..584e34d 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,5 +1,4 @@ import math -import os import random from unittest import mock from unittest.mock import * @@ -13,28 +12,28 @@ def test_srs_to_spatialreference_ignf_ok(): try: - sr = srs_to_spatialreference("IGNF:LAMB93") - sr = srs_to_spatialreference("ignf:lamb93") + srs_to_spatialreference("IGNF:LAMB93") + srs_to_spatialreference("ignf:lamb93") except Exception as exc: assert False, f"SpatialReference creation raises an exception: {exc}" def test_srs_to_spatialreference_epsg_ok(): try: - sr = srs_to_spatialreference("EPSG:3857") - sr = srs_to_spatialreference("epsg:3857") + srs_to_spatialreference("EPSG:3857") + srs_to_spatialreference("epsg:3857") except Exception as exc: assert False, f"SpatialReference creation raises an exception: {exc}" def test_srs_to_spatialreference_ignf_nok(): with pytest.raises(Exception): - sr = srs_to_spatialreference("IGNF:TOTO") + srs_to_spatialreference("IGNF:TOTO") def test_srs_to_spatialreference_epsg_nok(): with pytest.raises(Exception): - sr = srs_to_spatialreference("EPSG:123456") + srs_to_spatialreference("EPSG:123456") def test_bbox_to_geometry_ok(): diff --git a/tests/test_vector.py b/tests/test_vector.py index 8f75618..72e9c50 100644 --- a/tests/test_vector.py +++ b/tests/test_vector.py @@ -13,25 +13,25 @@ def test_missing_env(): disconnect_ceph_clients() with pytest.raises(MissingEnvironmentError): - vector = Vector.from_file("ceph:///ign_std/vector.shp") + Vector.from_file("ceph:///ign_std/vector.shp") @mock.patch("rok4.vector.copy", side_effect=StorageError("CEPH", "Not found")) def test_wrong_file(mocked_copy): with pytest.raises(StorageError): - vector = Vector.from_file("ceph:///vector.geojson") + Vector.from_file("ceph:///vector.geojson") def test_wrong_format(): with pytest.raises(Exception) as exc: - vector = Vector.from_file("ceph:///vector.tif") + Vector.from_file("ceph:///vector.tif") assert str(exc.value) == "This format of file cannot be loaded" @mock.patch("rok4.vector.ogr.Open", return_value="not a shape") def test_wrong_content(mocked_copy): with pytest.raises(Exception) as exc: - vector = Vector.from_file("file:///vector.shp") + Vector.from_file("file:///vector.shp") assert str(exc.value) == "The content of file:///vector.shp cannot be read" @@ -39,7 +39,7 @@ def test_wrong_content(mocked_copy): @mock.patch("rok4.vector.ogr.Open", return_value="not a shape") def test_wrong_content_ceph(mocked_open, mocked_copy): with pytest.raises(Exception) as exc: - vector = Vector.from_file("file:///vector.shp") + Vector.from_file("file:///vector.shp") assert str(exc.value) == "The content of file:///vector.shp cannot be read" From 8a161a2a466ba9f1aa1c24a93fd93496472c2f93 Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 16:19:22 +0200 Subject: [PATCH 04/11] Move unit tests in a separate workflow --- .github/workflows/tests.yml | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..b38f3f7 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,62 @@ +name: Tests + +on: + push: + branches: + - develop + - master + pull_request: + branches: + - develop + - master + +jobs: + unit-test: + name: "🎳 Unit tests" + strategy: + fail-fast: true + matrix: + os: + - ubuntu-22.04 + - ubuntu-22.04 + python-version: + - "3.8" + - "3.9" + - "3.10" + - "3.11" + + runs-on: ${{ matrix.os }} + steps: + - name: Get source code + uses: actions/checkout@v3 + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + cache-dependency-path: "pyproject.toml" + + - name: Install system dependencies + run: | + sudo apt update + sudo apt -y install python3-rados python3-gdal + + - name: Install project requirements + run: | + python -m pip install -U pip setuptools wheel + python -m pip install -e .[test] + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3.1.4 + + - name: Run unit tests + run: | + coverage run -m pytest + coverage report -m + + - uses: actions/upload-artifact@v3 + with: + name: python_wheel + path: dist/* + if-no-files-found: error From 6dc86ec8e4b9cc19c5560240e3621c2583b2c2b4 Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 16:20:31 +0200 Subject: [PATCH 05/11] Restore initial trigger --- .github/workflows/build-and-release.yaml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index cf5d8cf..9fa4929 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -3,18 +3,12 @@ name: Test, build and publish artefacts and documentation on: push: tags: - - '**' - pull_request: - branches: - - develop - - master + - "**" jobs: - create_release: name: Create Release runs-on: ubuntu-latest - if: startsWith(github.ref, 'refs/tags/') outputs: upload_url: ${{ steps.create_release.outputs.upload_url }} @@ -36,7 +30,6 @@ jobs: prerelease: false build_and_test: - name: Test and build artefacts needs: create_release outputs: @@ -61,8 +54,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - cache: 'pip' - cache-dependency-path: '**/pyproject.toml' + cache: "pip" + cache-dependency-path: "./pyproject.toml" - name: Install system dependencies run: | @@ -79,7 +72,6 @@ jobs: echo "/usr/lib/python3/dist-packages/" >.venv/lib/python${{ matrix.python-version }}/site-packages/system.pth - name: Run unit tests - if: "matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.8'" run: | source .venv/bin/activate pip install -e .[test] @@ -123,7 +115,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 with: name: dist-py3 @@ -169,11 +160,10 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout project on gh-pages uses: actions/checkout@v3 with: - ref: 'gh-pages' + ref: "gh-pages" token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/download-artifact@v3 From 7271e65c4b46bb826d458a8e61a342e445d453e8 Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 16:25:01 +0200 Subject: [PATCH 06/11] Disable fail fast (temp) --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b38f3f7..7d6d6d0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -14,7 +14,7 @@ jobs: unit-test: name: "🎳 Unit tests" strategy: - fail-fast: true + fail-fast: false matrix: os: - ubuntu-22.04 From 50d862cf82ccbbb6aa2cf0cff934f0eafd6051da Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 16:25:20 +0200 Subject: [PATCH 07/11] Install missing PythonGDAL wrappers --- .github/workflows/tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7d6d6d0..5cf185f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -45,6 +45,7 @@ jobs: - name: Install project requirements run: | python -m pip install -U pip setuptools wheel + python -m pip install GDAL=="`gdal-config --version`.*" python -m pip install -e .[test] - name: Upload coverage to Codecov From 0a3357cdd84c398581feba3e1c5380d791c8a86d Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 16:26:15 +0200 Subject: [PATCH 08/11] Add Ubuntu 20.04 --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5cf185f..0915545 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-22.04 + - ubuntu-20.04 - ubuntu-22.04 python-version: - "3.8" From bd3100b52d461049cc14f5add9b490be6c77e925 Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 16:28:39 +0200 Subject: [PATCH 09/11] Fix GDAL installation --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0915545..c61a292 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -40,6 +40,10 @@ jobs: - name: Install system dependencies run: | sudo apt update + sudo apt install gdal-bin libgdal-dev + export CPLUS_INCLUDE_PATH=/usr/include/gdal + export C_INCLUDE_PATH=/usr/include/gdal + gdal-config --version sudo apt -y install python3-rados python3-gdal - name: Install project requirements From 7042e224787789998bdd43c4a55294f2ad6a2259 Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 16:31:09 +0200 Subject: [PATCH 10/11] Move GDAL install after project --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c61a292..c259b91 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -49,8 +49,8 @@ jobs: - name: Install project requirements run: | python -m pip install -U pip setuptools wheel - python -m pip install GDAL=="`gdal-config --version`.*" python -m pip install -e .[test] + python -m pip install GDAL=="`gdal-config --version`.*" - name: Upload coverage to Codecov uses: codecov/codecov-action@v3.1.4 From c826606e9832495da658595609f80b00518e35ae Mon Sep 17 00:00:00 2001 From: Julien Moura Date: Thu, 31 Aug 2023 16:45:30 +0200 Subject: [PATCH 11/11] print rados version --- .github/workflows/tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c259b91..8560c37 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -44,7 +44,8 @@ jobs: export CPLUS_INCLUDE_PATH=/usr/include/gdal export C_INCLUDE_PATH=/usr/include/gdal gdal-config --version - sudo apt -y install python3-rados python3-gdal + sudo apt install python3-rados python3-gdal + python3 -c "import rados; print(rados.Rados().version())" - name: Install project requirements run: |