From 135b33f6de9071d688046081e0c0012cd22ebb4b Mon Sep 17 00:00:00 2001 From: Mike Date: Wed, 23 Feb 2022 09:44:26 +1300 Subject: [PATCH 1/3] Update for latest HDX Python API --- requirements.txt | 4 ++-- run.py | 9 +++++---- tests/test_geoboundaries.py | 9 ++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/requirements.txt b/requirements.txt index ffb07ce..e2667b2 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -python-slugify==5.0.2 -hdx-python-api==5.3.3 +python-slugify==6.1.0 +hdx-python-api==5.5.4 diff --git a/run.py b/run.py index a417ddf..10bcdf4 100755 --- a/run.py +++ b/run.py @@ -8,13 +8,12 @@ from os import environ from os.path import join +from geoboundaries import generate_dataset, get_data +from hdx.api.configuration import Configuration from hdx.facades.simple import facade -from hdx.hdx_configuration import Configuration from hdx.utilities.downloader import Download from hdx.utilities.path import progress_storing_tempdir -from geoboundaries import generate_dataset, get_data - logger = logging.getLogger(__name__) lookup = "hdx-ext-scraper-geoboundaries" @@ -36,7 +35,9 @@ def main(): ) if dataset: dataset.update_from_yaml() - dataset["notes"] = f"This dataset contains the following administrative boundaries: {', '.join(boundarytypes)}. \n \n{dataset['notes']}" + dataset[ + "notes" + ] = f"This dataset contains the following administrative boundaries: {', '.join(boundarytypes)}. \n \n{dataset['notes']}" dataset.create_in_hdx( remove_additional_resources=True, hxl_update=False, diff --git a/tests/test_geoboundaries.py b/tests/test_geoboundaries.py index 2fd6c60..60cb0ab 100755 --- a/tests/test_geoboundaries.py +++ b/tests/test_geoboundaries.py @@ -6,14 +6,13 @@ from os.path import join import pytest +from geoboundaries import generate_dataset, get_data +from hdx.api.configuration import Configuration +from hdx.api.locations import Locations from hdx.data.vocabulary import Vocabulary -from hdx.hdx_configuration import Configuration -from hdx.hdx_locations import Locations from hdx.location.country import Country from hdx.utilities.loader import load_json -from geoboundaries import generate_dataset, get_data - alljson = load_json(join("tests", "fixtures", "apiinput.json")) @@ -63,7 +62,7 @@ def test_get_data(self, downloader): def test_generate_dataset(self, configuration): boundarytypes, dataset, resource_names = generate_dataset("AFG", alljson) - assert boundarytypes == ['ADM0', 'ADM1', 'ADM2'] + assert boundarytypes == ["ADM0", "ADM1", "ADM2"] assert dataset == { "name": "geoboundaries-admin-boundaries-for-afghanistan", "title": "Afghanistan - Subnational Administrative Boundaries", From a43ce2dc3f7ce4f091303e2eb7832a77a3c3792f Mon Sep 17 00:00:00 2001 From: Mike Date: Tue, 1 Mar 2022 14:19:00 +1300 Subject: [PATCH 2/3] Update for latest HDX Python API --- requirements.txt | 4 ++-- test-requirements.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements.txt b/requirements.txt index e2667b2..4d6e6e8 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ -python-slugify==6.1.0 -hdx-python-api==5.5.4 +python-slugify==6.1.1 +hdx-python-api==5.5.6 diff --git a/test-requirements.txt b/test-requirements.txt index 1595e22..2e751c2 100755 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,3 @@ -pytest==6.2.5 -pytest-cov==2.12.1 +pytest==7.0.1 +pytest-cov==3.0.0 -r requirements.txt From 4085a2dc3d5c3ec0a2aced8012503f873c280b88 Mon Sep 17 00:00:00 2001 From: Mike Date: Mon, 14 Mar 2022 13:42:05 +1300 Subject: [PATCH 3/3] Update for latest HDX Python API --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 4d6e6e8..6592179 100755 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ python-slugify==6.1.1 -hdx-python-api==5.5.6 +hdx-python-api==5.5.8