diff --git a/datacite/schema31.py b/datacite/schema31.py index cc5a054..cd23022 100644 --- a/datacite/schema31.py +++ b/datacite/schema31.py @@ -10,7 +10,7 @@ """DataCite v3.1 JSON to XML transformations.""" -import pkg_resources +import importlib.resources as importlib_resources from lxml import etree from lxml.builder import E @@ -37,7 +37,7 @@ } validator = validator_factory( - pkg_resources.resource_filename("datacite", "schemas/datacite-v3.1.json") + importlib_resources.files('datacite') / 'schemas/datacite-v3.1.json' ) diff --git a/datacite/schema40.py b/datacite/schema40.py index e19927b..68508df 100644 --- a/datacite/schema40.py +++ b/datacite/schema40.py @@ -10,7 +10,7 @@ """DataCite v4.0 JSON to XML transformations.""" -import pkg_resources +import importlib.resources as importlib_resources from lxml import etree from lxml.builder import E @@ -37,7 +37,7 @@ } validator = validator_factory( - pkg_resources.resource_filename("datacite", "schemas/datacite-v4.0.json") + importlib_resources.files("datacite", "schemas/datacite-v4.0.json") ) diff --git a/datacite/schema41.py b/datacite/schema41.py index 66fd165..b10a7a0 100644 --- a/datacite/schema41.py +++ b/datacite/schema41.py @@ -10,7 +10,7 @@ """DataCite v4.1 JSON to XML transformations.""" -import pkg_resources +import importlib.resources as importlib_resources from lxml import etree from lxml.builder import E @@ -37,7 +37,7 @@ } validator = validator_factory( - pkg_resources.resource_filename("datacite", "schemas/datacite-v4.1.json") + importlib_resources.files("datacite", "schemas/datacite-v4.1.json") ) diff --git a/datacite/schema42.py b/datacite/schema42.py index bb57476..0953b42 100644 --- a/datacite/schema42.py +++ b/datacite/schema42.py @@ -11,7 +11,7 @@ """DataCite v4.2 JSON to XML transformations.""" -import pkg_resources +import importlib.resources as importlib_resources from lxml import etree from lxml.builder import E @@ -38,7 +38,7 @@ } validator = validator_factory( - pkg_resources.resource_filename("datacite", "schemas/datacite-v4.2.json") + importlib_resources.files("datacite", "schemas/datacite-v4.2.json") ) diff --git a/datacite/schema43.py b/datacite/schema43.py index 5bef9f0..785cea5 100644 --- a/datacite/schema43.py +++ b/datacite/schema43.py @@ -11,7 +11,7 @@ """DataCite v4.3 JSON to XML transformations.""" -import pkg_resources +import importlib.resources as importlib_resources from lxml import etree from lxml.builder import E @@ -38,7 +38,7 @@ } validator = validator_factory( - pkg_resources.resource_filename("datacite", "schemas/datacite-v4.3.json") + importlib_resources.files("datacite", "schemas/datacite-v4.3.json") )