diff --git a/.bumpversion.cfg b/.bumpversion.cfg index fc82d07..3b72253 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -8,8 +8,8 @@ serialize = {major}.{minor} [bumpversion:file:pyproject.toml] -search = version="{current_version}" -replace = version="{new_version}" +search = version = "{current_version}" +replace = version = "{new_version}" [bumpversion:file:fast_dp/__init__.py] search = __version__ = "{current_version}" diff --git a/HISTORY.rst b/HISTORY.rst index daf1592..68ac780 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,10 +2,11 @@ History ======= -2.0.0 (xxxx-xx-xx) +2.0.0 (2026-03-04) ------------------ * fast_dp no longer supports Python 2.7 or 3.5 * change default plugin for Eiger data to durin-plugin.so +* migrate from pkg_resources to importlib.resources 1.6.2 (2020-03-14) ------------------ diff --git a/fast_dp/output.py b/fast_dp/output.py index a7778ec..8e456a4 100644 --- a/fast_dp/output.py +++ b/fast_dp/output.py @@ -2,8 +2,7 @@ import json import os - -import pkg_resources +from importlib.resources import files def write_json( @@ -34,9 +33,9 @@ def write_json( def get_ispyb_template(): """Read the ispyb.xml template from the package resources.""" - xml_template = pkg_resources.resource_string( - "fast_dp", "templates/ispyb.xml" - ).decode("utf-8") + template_path = files("fast_dp") / "templates" / "ispyb.xml" + xml_template = template_path.read_text(encoding="utf-8") + assert xml_template, "Error retrieving XML template" return xml_template