From 76809daa59bb96a90239d4f44be3e8bf8860d92d Mon Sep 17 00:00:00 2001 From: "christopher.tubbs" Date: Thu, 25 Jan 2024 13:14:42 -0600 Subject: [PATCH] Fixed an issue where following symlinks on Paths no longer works, fixed an issue where django tests weren't correctly building output, restored some type hinting on an enum, and fixed some merge errors --- python/gui/maas_experiment/application_values.py | 3 ++- python/lib/core/dmod/core/common/__init__.py | 2 +- .../dmod/evaluationservice/evaluation_service/wrapper.py | 5 ----- scripts/test_django.py | 4 +++- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/python/gui/maas_experiment/application_values.py b/python/gui/maas_experiment/application_values.py index c352426b6..39f7344a8 100644 --- a/python/gui/maas_experiment/application_values.py +++ b/python/gui/maas_experiment/application_values.py @@ -117,7 +117,8 @@ def get_full_localtimezone(): # If this is a system with 'zoneinfo' set up as part of the environment, parse the name from the linked zone zone_path = Path("/etc/localtime") - zone_path = str(zone_path.readlink()) if zone_path.exists() and zone_path.is_symlink() else "" + zone_path = zone_path.resolve() + zone_path = str(zone_path) if zone_path.exists() else "" # We can predict the path if the zone is linked to a file under 'zoneinfo'. if 'zoneinfo' in zone_path: diff --git a/python/lib/core/dmod/core/common/__init__.py b/python/lib/core/dmod/core/common/__init__.py index dbb82b598..47fe636ae 100644 --- a/python/lib/core/dmod/core/common/__init__.py +++ b/python/lib/core/dmod/core/common/__init__.py @@ -29,7 +29,7 @@ from .types import TextValues -class Status(CommonEnum): +class Status(str, CommonEnum): """ Very basic enumeration used to describe the status of something """ diff --git a/python/services/evaluationservice/dmod/evaluationservice/evaluation_service/wrapper.py b/python/services/evaluationservice/dmod/evaluationservice/evaluation_service/wrapper.py index 03a1de4f1..1a3313d5d 100644 --- a/python/services/evaluationservice/dmod/evaluationservice/evaluation_service/wrapper.py +++ b/python/services/evaluationservice/dmod/evaluationservice/evaluation_service/wrapper.py @@ -61,7 +61,6 @@ def __call__(self, *args: _T, **kwargs: _V) -> typing.Union[_MODEL_TYPE, typing. def wrapper_caller( - function: typing.Callable[[typing.Any, ...], typing.Union[_MODEL_TYPE, QuerySet[_MODEL_TYPE]]], function: wrapper_fn[_T, _V], _wrapper_return_values: WrapperResults, args: typing.Sequence[_T], @@ -114,10 +113,6 @@ def __call_wrapper( *args: _T, **kwargs: _V, ) -> typing.Union[_MODEL_TYPE, typing.Sequence[_MODEL_TYPE]]: - function: typing.Callable[[typing.Any, ...], typing.Union[_MODEL_TYPE, QuerySet[_MODEL_TYPE]]], - *args, - **kwargs - ) -> typing.Union[_MODEL_TYPE, typing.List[_MODEL_TYPE]]: results = WrapperResults() if self.__can_use_concurrency: diff --git a/scripts/test_django.py b/scripts/test_django.py index e5f535c81..c2f18c1f6 100755 --- a/scripts/test_django.py +++ b/scripts/test_django.py @@ -347,8 +347,10 @@ def __interpret_stderr(self): # separated from the previously read if current_description: current_description += os.linesep + current_description += line + else: + current_description = line - current_description += line # Otherwise, we want to just tack the read data onto the content of the message we're building else: # If we're on the final line of the messages, just tack on a new line to our content,