Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to master #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
9 changes: 5 additions & 4 deletions run.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
9 changes: 4 additions & 5 deletions tests/test_geoboundaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))


Expand Down Expand Up @@ -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",
Expand Down