Skip to content

Commit

Permalink
package: replace pkg_resources with importlib
Browse files Browse the repository at this point in the history
  • Loading branch information
tmorrell committed Jul 8, 2024
1 parent abcc6ce commit ef3a056
Show file tree
Hide file tree
Showing 6 changed files with 11 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
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ install_requires =
lxml>=4.5.2
requests>=2.12.2
idutils>=1.0.0
importlib-metadata>=6.11.0

[options.extras_require]
tests =
Expand Down

0 comments on commit ef3a056

Please sign in to comment.