Skip to content

Commit

Permalink
avoid deprecated pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
mashehu committed Jan 24, 2024
1 parent 0b375c7 commit 069f28b
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions rocrate/vocabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,11 @@
# limitations under the License.

import json
import pkg_resources
import importlib.resources

# FIXME: Avoid eager loading?
RO_CRATE = json.loads(pkg_resources.resource_string(
__name__, "data/ro-crate.jsonld"
))
SCHEMA = json.loads(pkg_resources.resource_string(
__name__, "data/schema.jsonld"
))
RO_CRATE = json.loads(importlib.resources.read_text(__name__, "data/ro-crate.jsonld"))
SCHEMA = json.loads(importlib.resources.read_text(__name__, "data/schema.jsonld"))
SCHEMA_MAP = dict((e["@id"], e) for e in SCHEMA["@graph"])


Expand Down

0 comments on commit 069f28b

Please sign in to comment.