From c12236a315004dda4f2afc72fb45dba8835b5b8b Mon Sep 17 00:00:00 2001 From: Martin Fleischmann Date: Sat, 18 Feb 2023 18:42:50 +0100 Subject: [PATCH] REF: use pkgutil (#8) * REF: use pkgutil * proper module name --- geodatasets/data.py | 4 ++-- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/geodatasets/data.py b/geodatasets/data.py index 1381c6d..1e124a4 100644 --- a/geodatasets/data.py +++ b/geodatasets/data.py @@ -1,8 +1,8 @@ -import importlib.resources +import pkgutil from . import json from .lib import _load_json -json = importlib.resources.read_text(json, "database.json") +json = pkgutil.get_data("geodatasets", "json/database.json") data = _load_json(json) diff --git a/pyproject.toml b/pyproject.toml index 2c48e5e..2d7954e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,7 +39,7 @@ include = [ ] [tool.setuptools.package-data] -myModule = ["json/providers.json"] +json = ["json/providers.json"] [tool.coverage.run] omit = ["geodatasets/tests/*"]