Skip to content

Commit

Permalink
replace pkg_resources with importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
mfenner committed Jul 1, 2024
1 parent 05aec1c commit a478424
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions datacite/schema31.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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'
)


Expand Down
4 changes: 2 additions & 2 deletions datacite/schema40.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
)


Expand Down
4 changes: 2 additions & 2 deletions datacite/schema41.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
)


Expand Down
4 changes: 2 additions & 2 deletions datacite/schema42.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
)


Expand Down
4 changes: 2 additions & 2 deletions datacite/schema43.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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")
)


Expand Down

0 comments on commit a478424

Please sign in to comment.