Skip to content

Commit c12236a

Browse files
authored
REF: use pkgutil (#8)
* REF: use pkgutil * proper module name
1 parent 4d0d5f3 commit c12236a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

geodatasets/data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import importlib.resources
1+
import pkgutil
22

33
from . import json
44
from .lib import _load_json
55

6-
json = importlib.resources.read_text(json, "database.json")
6+
json = pkgutil.get_data("geodatasets", "json/database.json")
77

88
data = _load_json(json)

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ include = [
3939
]
4040

4141
[tool.setuptools.package-data]
42-
myModule = ["json/providers.json"]
42+
json = ["json/providers.json"]
4343

4444
[tool.coverage.run]
4545
omit = ["geodatasets/tests/*"]

0 commit comments

Comments
 (0)