From 00b4c2f1825054ef21b2568166a33c40eec25a6d Mon Sep 17 00:00:00 2001 From: Ryan Bunney Date: Wed, 9 Oct 2024 17:15:14 +0800 Subject: [PATCH 1/4] LIU-408: Add support for Python 3.11 and 3.12 - Add `setuptools` as a dependency: https://github.com/pypa/virtualenv/issues/2487 - Bump pyzmq version number: https://pyzmq.readthedocs.io/en/latest/changelog.html#id11 - Bump pydantic version number: https://github.com/pydantic/pydantic/issues/9637 --- .github/workflows/run-unit-tests.yml | 12 +++++++++++- daliuge-common/dlg/common/tool.py | 6 ++---- daliuge-common/setup.py | 4 ++-- daliuge-engine/setup.py | 2 +- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/.github/workflows/run-unit-tests.yml b/.github/workflows/run-unit-tests.yml index 3f93fe992..6da02d246 100644 --- a/.github/workflows/run-unit-tests.yml +++ b/.github/workflows/run-unit-tests.yml @@ -21,7 +21,17 @@ jobs: translator: no - python-version: "3.10" test_number: 2 - desc: "full package" + desc: "full package v3.10" + engine: yes + translator: yes + - python-version: "3.11" + test_number: 3 + desc: "full package v3.11" + engine: yes + translator: yes + - python-version: "3.12" + test_number: 4 + desc: "full package v3.12" engine: yes translator: yes diff --git a/daliuge-common/dlg/common/tool.py b/daliuge-common/dlg/common/tool.py index 574a2c1c4..ae425ece3 100644 --- a/daliuge-common/dlg/common/tool.py +++ b/daliuge-common/dlg/common/tool.py @@ -28,8 +28,7 @@ import sys import time -import pkg_resources - +from importlib.metadata import entry_points logger = logging.getLogger(__name__) @@ -117,9 +116,8 @@ def version(parser, args): cmdwrap("version", "Reports the DALiuGE version and exits", version) - def _load_commands(): - for entry_point in pkg_resources.iter_entry_points("dlg.tool_commands"): + for entry_point in entry_points(group="dlg.tool_commands"): entry_point.load().register_commands() diff --git a/daliuge-common/setup.py b/daliuge-common/setup.py index e416c8154..7d5114326 100644 --- a/daliuge-common/setup.py +++ b/daliuge-common/setup.py @@ -63,8 +63,8 @@ def do_versioning(): install_requires = [ "gputil>=1.4.0", "merklelib@git+https://github.com/pritchardn/merklelib", - "pyzmq==25.1.0", - "pydantic==1.10.13", + "pyzmq==25.1.1", + "pydantic>=2.5", "boto3", "phonenumbers", "mailchecker", diff --git a/daliuge-engine/setup.py b/daliuge-engine/setup.py index dfdc20f85..34c5dca91 100644 --- a/daliuge-engine/setup.py +++ b/daliuge-engine/setup.py @@ -145,7 +145,7 @@ def run(self): "paramiko", "psutil", "python-daemon", - "pyzmq == 25.1.0", + "pyzmq == 25.1.1", # Python 25.1.1 is minimal install that supports Python 3.12 "scp", "pyext @ git+https://github.com/itea1001/PyExt", "pyyaml", From d1d42782e9abea4005ee5157c94f8397354a547d Mon Sep 17 00:00:00 2001 From: Ryan Bunney Date: Tue, 15 Oct 2024 09:48:51 +0800 Subject: [PATCH 2/4] LIU-408: Test <3.10 version for entry points. - This should resolve linter errors. --- daliuge-common/dlg/common/tool.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/daliuge-common/dlg/common/tool.py b/daliuge-common/dlg/common/tool.py index ae425ece3..6657ca88c 100644 --- a/daliuge-common/dlg/common/tool.py +++ b/daliuge-common/dlg/common/tool.py @@ -20,7 +20,6 @@ # MA 02111-1307 USA # """dlg command line utility""" - import importlib import logging import optparse @@ -117,8 +116,13 @@ def version(parser, args): cmdwrap("version", "Reports the DALiuGE version and exits", version) def _load_commands(): - for entry_point in entry_points(group="dlg.tool_commands"): - entry_point.load().register_commands() + if sys.version_info.minor < 10: + all_entry_points = entry_points() + for entry_point in all_entry_points["dlg.tool_commands"]: + entry_point.load().register_commands() + else: + for entry_point in entry_points(group="dlg.tool_commands"): + entry_point.load().register_commands() def print_usage(prgname): From d64e45fe4bae592492223c7114f6e861d6be576e Mon Sep 17 00:00:00 2001 From: Ryan Bunney Date: Tue, 15 Oct 2024 10:16:05 +0800 Subject: [PATCH 3/4] LIU-408: Disable no member error --- daliuge-common/dlg/common/tool.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/daliuge-common/dlg/common/tool.py b/daliuge-common/dlg/common/tool.py index 6657ca88c..a4d2d31d2 100644 --- a/daliuge-common/dlg/common/tool.py +++ b/daliuge-common/dlg/common/tool.py @@ -19,6 +19,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # +# pylint: disable=no-member + """dlg command line utility""" import importlib import logging From 877c4a47b0a5737600cdd54dad85b25b09a2920e Mon Sep 17 00:00:00 2001 From: Ryan Bunney Date: Tue, 15 Oct 2024 11:30:34 +0800 Subject: [PATCH 4/4] LIU-408: Disable correct error --- daliuge-common/dlg/common/tool.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/daliuge-common/dlg/common/tool.py b/daliuge-common/dlg/common/tool.py index a4d2d31d2..6daa77314 100644 --- a/daliuge-common/dlg/common/tool.py +++ b/daliuge-common/dlg/common/tool.py @@ -19,7 +19,6 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, # MA 02111-1307 USA # -# pylint: disable=no-member """dlg command line utility""" import importlib @@ -123,7 +122,7 @@ def _load_commands(): for entry_point in all_entry_points["dlg.tool_commands"]: entry_point.load().register_commands() else: - for entry_point in entry_points(group="dlg.tool_commands"): + for entry_point in entry_points(group="dlg.tool_commands"): # pylint: disable=unexpected-keyword-arg entry_point.load().register_commands()