diff --git a/omero/plugins/web.py b/omero/plugins/web.py index 9653eb9a8b..6dbc3d6a03 100644 --- a/omero/plugins/web.py +++ b/omero/plugins/web.py @@ -21,7 +21,7 @@ from omero_ext.argparse import SUPPRESS from omero_ext.path import path -from pkg_resources import resource_string +from importlib_resources import files from omero.install.windows_warning import windows_warning, WINDOWS_WARNING @@ -342,8 +342,8 @@ def config(self, args, settings): if settings.APPLICATION_SERVER not in settings.WSGI_TYPES: self.ctx.die(679, "Web template configuration requires" "wsgi or wsgi-tcp.") - template_file = "%s.conf.template" % server - c = resource_string("omeroweb", "templates/" + template_file).decode("utf-8") + template_file = "templates/%s.conf.template" % server + c = files("omeroweb").joinpath(template_file).read_text() self.ctx.out(c % d) def syncmedia(self, args): diff --git a/setup.py b/setup.py index 71bf4abe85..8c89e6e6ac 100755 --- a/setup.py +++ b/setup.py @@ -55,7 +55,7 @@ def read(fname): # minimum requirements for `omero web start` "concurrent-log-handler>=0.9.20", "Django>=4.2.3,<4.3", - "django-pipeline==2.1.0", + "django-pipeline", "django-cors-headers==3.7.0", "whitenoise>=5.3.0", "gunicorn>=19.3", @@ -64,6 +64,7 @@ def read(fname): "pytz", "portalocker", "packaging", + "importlib-resources", ], include_package_data=True, tests_require=["pytest"],