From 7cd87b74106f5ded2c1575d7f106ed3e7c5cf475 Mon Sep 17 00:00:00 2001 From: Phil Blowey Date: Fri, 27 Feb 2026 13:05:34 +0000 Subject: [PATCH 1/5] migrate to importlib --- HISTORY.rst | 1 + fast_dp/output.py | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index daf1592..b9856df 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -6,6 +6,7 @@ History ------------------ * 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..50dc83d 100644 --- a/fast_dp/output.py +++ b/fast_dp/output.py @@ -1,9 +1,10 @@ from __future__ import annotations +from importlib.resources import files import json import os -import pkg_resources + def write_json( @@ -34,9 +35,10 @@ 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 From 82a9cb925b36fbcbf6dac50b8b1a7c5c44e82743 Mon Sep 17 00:00:00 2001 From: Phil Blowey Date: Wed, 4 Mar 2026 10:00:14 +0000 Subject: [PATCH 2/5] Update history A release for 1.7 exists but seems to have been made outside of the repository. The release doesn't seem to contain changes that are not present in the repository so changes since 1.6.2 are being added to the history under the 2.0.0 release. --- HISTORY.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index b9856df..68ac780 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,7 +2,7 @@ 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 From 759b75b56cb1eb4e1c4d866759d31dc9447aa8c2 Mon Sep 17 00:00:00 2001 From: Phil Blowey Date: Wed, 4 Mar 2026 10:15:13 +0000 Subject: [PATCH 3/5] Fix bumpversion config --- .bumpversion.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}" From f79db5b86fd113357e2ee27ec2cf36e3756e91d1 Mon Sep 17 00:00:00 2001 From: Phil Blowey Date: Wed, 4 Mar 2026 10:30:19 +0000 Subject: [PATCH 4/5] Remove bump2version changes Will add these in a different commit --- .bumpversion.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}" From 9c8c11884fccf5254c4a98d45f7cc7c6a2483b2c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Mar 2026 10:34:12 +0000 Subject: [PATCH 5/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- fast_dp/output.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fast_dp/output.py b/fast_dp/output.py index 50dc83d..8e456a4 100644 --- a/fast_dp/output.py +++ b/fast_dp/output.py @@ -1,10 +1,8 @@ from __future__ import annotations -from importlib.resources import files import json import os - - +from importlib.resources import files def write_json( @@ -38,7 +36,6 @@ def get_ispyb_template(): 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