diff --git a/requirements.txt b/requirements.txt index ffb07ce..6592179 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.1 +hdx-python-api==5.5.8 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/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 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",