diff --git a/src/sst/core/model/python/pymacros.h b/src/sst/core/model/python/pymacros.h index 40676eec4..621da1748 100644 --- a/src/sst/core/model/python/pymacros.h +++ b/src/sst/core/model/python/pymacros.h @@ -46,6 +46,12 @@ REENABLE_WARNING #define SST_TP_WATCHED #endif +#if PY_MINOR_VERSION >= 13 +#define SST_TP_VERSIONS_USED 0, +#else +#define SST_TP_VERSIONS_USED +#endif + // Number protocol macros #define SST_NB_DIVIDE(x) #define SST_NB_COERCE diff --git a/src/sst/core/model/python/pymodel.cc b/src/sst/core/model/python/pymodel.cc index 469885baa..aa8888ae5 100644 --- a/src/sst/core/model/python/pymodel.cc +++ b/src/sst/core/model/python/pymodel.cc @@ -88,56 +88,57 @@ DISABLE_WARN_DEPRECATED_DECLARATION #endif #endif static PyTypeObject ModuleLoaderType = { - SST_PY_OBJ_HEAD "ModuleLoader", /* tp_name */ - sizeof(ModuleLoaderPy_t), /* tp_basicsize */ - 0, /* tp_itemsize */ - nullptr, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_as_sync */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "SST Module Loader", /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_rich_compare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - mlMethods, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - nullptr, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ - nullptr, /* tp_free */ - nullptr, /* tp_is_gc */ - nullptr, /* tp_bases */ - nullptr, /* tp_mro */ - nullptr, /* tp_cache */ - nullptr, /* tp_subclasses */ - nullptr, /* tp_weaklist */ - nullptr, /* tp_del */ - 0, /* tp_version_tag */ - nullptr, /* tp_finalize */ - SST_TP_VECTORCALL /* Python3.8+ */ - SST_TP_PRINT_DEP /* Python3.8 only */ - SST_TP_WATCHED /* Python3.12+ */ + SST_PY_OBJ_HEAD "ModuleLoader", /* tp_name */ + sizeof(ModuleLoaderPy_t), /* tp_basicsize */ + 0, /* tp_itemsize */ + nullptr, /* tp_dealloc */ + 0, /* tp_vectorcall_offset */ + nullptr, /* tp_getattr */ + nullptr, /* tp_setattr */ + nullptr, /* tp_as_sync */ + nullptr, /* tp_repr */ + nullptr, /* tp_as_number */ + nullptr, /* tp_as_sequence */ + nullptr, /* tp_as_mapping */ + nullptr, /* tp_hash */ + nullptr, /* tp_call */ + nullptr, /* tp_str */ + nullptr, /* tp_getattro */ + nullptr, /* tp_setattro */ + nullptr, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "SST Module Loader", /* tp_doc */ + nullptr, /* tp_traverse */ + nullptr, /* tp_clear */ + nullptr, /* tp_rich_compare */ + 0, /* tp_weaklistoffset */ + nullptr, /* tp_iter */ + nullptr, /* tp_iternext */ + mlMethods, /* tp_methods */ + nullptr, /* tp_members */ + nullptr, /* tp_getset */ + nullptr, /* tp_base */ + nullptr, /* tp_dict */ + nullptr, /* tp_descr_get */ + nullptr, /* tp_descr_set */ + 0, /* tp_dictoffset */ + nullptr, /* tp_init */ + nullptr, /* tp_alloc */ + nullptr, /* tp_new */ + nullptr, /* tp_free */ + nullptr, /* tp_is_gc */ + nullptr, /* tp_bases */ + nullptr, /* tp_mro */ + nullptr, /* tp_cache */ + nullptr, /* tp_subclasses */ + nullptr, /* tp_weaklist */ + nullptr, /* tp_del */ + 0, /* tp_version_tag */ + nullptr, /* tp_finalize */ + SST_TP_VECTORCALL /* Python3.8+ */ + SST_TP_PRINT_DEP /* Python3.8 only */ + SST_TP_WATCHED /* Python3.12+ */ + SST_TP_VERSIONS_USED /* Python3.13+ */ }; #if PY_MAJOR_VERSION == 3 #if PY_MINOR_VERSION == 8 diff --git a/src/sst/core/model/python/pymodel_comp.cc b/src/sst/core/model/python/pymodel_comp.cc index 60cc0bdeb..16efd1746 100644 --- a/src/sst/core/model/python/pymodel_comp.cc +++ b/src/sst/core/model/python/pymodel_comp.cc @@ -615,6 +615,7 @@ PyTypeObject PyModel_ComponentType = { SST_TP_VECTORCALL /* Python3.8+ */ SST_TP_PRINT_DEP /* Python3.8 only */ SST_TP_WATCHED /* Python3.12+ only */ + SST_TP_VERSIONS_USED /* Python3.13+ only */ }; #if PY_MAJOR_VERSION == 3 #if PY_MINOR_VERSION == 8 @@ -726,6 +727,7 @@ PyTypeObject PyModel_SubComponentType = { SST_TP_VECTORCALL /* Python3.8+ */ SST_TP_PRINT_DEP /* Python3.8 only */ SST_TP_WATCHED /* Python3.12+ */ + SST_TP_VERSIONS_USED /* Python3.13+ only */ }; #if PY_MAJOR_VERSION == 3 #if PY_MINOR_VERSION == 8 diff --git a/src/sst/core/model/python/pymodel_link.cc b/src/sst/core/model/python/pymodel_link.cc index d9c34786b..fa617e261 100644 --- a/src/sst/core/model/python/pymodel_link.cc +++ b/src/sst/core/model/python/pymodel_link.cc @@ -144,56 +144,57 @@ DISABLE_WARN_DEPRECATED_DECLARATION #endif #endif PyTypeObject PyModel_LinkType = { - SST_PY_OBJ_HEAD "sst.Link", /* tp_name */ - sizeof(LinkPy_t), /* tp_basicsize */ - 0, /* tp_itemsize */ - (destructor)linkDealloc, /* tp_dealloc */ - 0, /* tp_vectorcall_offset */ - nullptr, /* tp_getattr */ - nullptr, /* tp_setattr */ - nullptr, /* tp_as_sync */ - nullptr, /* tp_repr */ - nullptr, /* tp_as_number */ - nullptr, /* tp_as_sequence */ - nullptr, /* tp_as_mapping */ - nullptr, /* tp_hash */ - nullptr, /* tp_call */ - nullptr, /* tp_str */ - nullptr, /* tp_getattro */ - nullptr, /* tp_setattro */ - nullptr, /* tp_as_buffer */ - Py_TPFLAGS_DEFAULT, /* tp_flags */ - "SST Link", /* tp_doc */ - nullptr, /* tp_traverse */ - nullptr, /* tp_clear */ - nullptr, /* tp_richcompare */ - 0, /* tp_weaklistoffset */ - nullptr, /* tp_iter */ - nullptr, /* tp_iternext */ - linkMethods, /* tp_methods */ - nullptr, /* tp_members */ - nullptr, /* tp_getset */ - nullptr, /* tp_base */ - nullptr, /* tp_dict */ - nullptr, /* tp_descr_get */ - nullptr, /* tp_descr_set */ - 0, /* tp_dictoffset */ - (initproc)linkInit, /* tp_init */ - nullptr, /* tp_alloc */ - nullptr, /* tp_new */ - nullptr, /* tp_free */ - nullptr, /* tp_is_gc */ - nullptr, /* tp_bases */ - nullptr, /* tp_mro */ - nullptr, /* tp_cache */ - nullptr, /* tp_subclasses */ - nullptr, /* tp_weaklist */ - nullptr, /* tp_del */ - 0, /* tp_version_tag */ - nullptr, /* tp_finalize */ - SST_TP_VECTORCALL /* Python3.8+ */ - SST_TP_PRINT_DEP /* Python3.8 only */ - SST_TP_WATCHED /* Python3.12+ */ + SST_PY_OBJ_HEAD "sst.Link", /* tp_name */ + sizeof(LinkPy_t), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)linkDealloc, /* tp_dealloc */ + 0, /* tp_vectorcall_offset */ + nullptr, /* tp_getattr */ + nullptr, /* tp_setattr */ + nullptr, /* tp_as_sync */ + nullptr, /* tp_repr */ + nullptr, /* tp_as_number */ + nullptr, /* tp_as_sequence */ + nullptr, /* tp_as_mapping */ + nullptr, /* tp_hash */ + nullptr, /* tp_call */ + nullptr, /* tp_str */ + nullptr, /* tp_getattro */ + nullptr, /* tp_setattro */ + nullptr, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + "SST Link", /* tp_doc */ + nullptr, /* tp_traverse */ + nullptr, /* tp_clear */ + nullptr, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ + nullptr, /* tp_iter */ + nullptr, /* tp_iternext */ + linkMethods, /* tp_methods */ + nullptr, /* tp_members */ + nullptr, /* tp_getset */ + nullptr, /* tp_base */ + nullptr, /* tp_dict */ + nullptr, /* tp_descr_get */ + nullptr, /* tp_descr_set */ + 0, /* tp_dictoffset */ + (initproc)linkInit, /* tp_init */ + nullptr, /* tp_alloc */ + nullptr, /* tp_new */ + nullptr, /* tp_free */ + nullptr, /* tp_is_gc */ + nullptr, /* tp_bases */ + nullptr, /* tp_mro */ + nullptr, /* tp_cache */ + nullptr, /* tp_subclasses */ + nullptr, /* tp_weaklist */ + nullptr, /* tp_del */ + 0, /* tp_version_tag */ + nullptr, /* tp_finalize */ + SST_TP_VECTORCALL /* Python3.8+ */ + SST_TP_PRINT_DEP /* Python3.8 only */ + SST_TP_WATCHED /* Python3.12+ */ + SST_TP_VERSIONS_USED /* Python3.13+ only */ }; #if PY_MAJOR_VERSION == 3 #if PY_MINOR_VERSION == 8 diff --git a/src/sst/core/model/python/pymodel_stat.cc b/src/sst/core/model/python/pymodel_stat.cc index 712f22bbf..f6414decc 100644 --- a/src/sst/core/model/python/pymodel_stat.cc +++ b/src/sst/core/model/python/pymodel_stat.cc @@ -221,6 +221,7 @@ PyTypeObject PyModel_StatType = { SST_TP_VECTORCALL /* Python3.8+ */ SST_TP_PRINT_DEP /* Python3.8 only */ SST_TP_WATCHED /* Python3.12+ */ + SST_TP_VERSIONS_USED /* Python3.13+ only */ }; #if PY_MAJOR_VERSION == 3 #if PY_MINOR_VERSION == 8 diff --git a/src/sst/core/model/python/pymodel_statgroup.cc b/src/sst/core/model/python/pymodel_statgroup.cc index d34f630db..58c9b4f87 100644 --- a/src/sst/core/model/python/pymodel_statgroup.cc +++ b/src/sst/core/model/python/pymodel_statgroup.cc @@ -214,6 +214,7 @@ PyTypeObject PyModel_StatGroupType = { SST_TP_VECTORCALL /* Python3.8+ */ SST_TP_PRINT_DEP /* Python3.8 only */ SST_TP_WATCHED /* Python3.12+ */ + SST_TP_VERSIONS_USED /* Python3.13+ only */ }; #if PY_MAJOR_VERSION == 3 #if PY_MINOR_VERSION == 8 @@ -347,6 +348,7 @@ PyTypeObject PyModel_StatOutputType = { SST_TP_VECTORCALL /* Python3.8+ */ SST_TP_PRINT_DEP /* Python3.8 only */ SST_TP_WATCHED /* Python3.12+ */ + SST_TP_VERSIONS_USED /* Python3.13+ only */ }; #if PY_MAJOR_VERSION == 3 #if PY_MINOR_VERSION == 8 diff --git a/src/sst/core/model/python/pymodel_unitalgebra.cc b/src/sst/core/model/python/pymodel_unitalgebra.cc index 6a573d0e6..1bdad6817 100644 --- a/src/sst/core/model/python/pymodel_unitalgebra.cc +++ b/src/sst/core/model/python/pymodel_unitalgebra.cc @@ -505,6 +505,7 @@ PyTypeObject PyModel_UnitAlgebraType = { SST_TP_VECTORCALL /* Python3.8+ */ SST_TP_PRINT_DEP /* Python3.8 only */ SST_TP_WATCHED /* Python3.12+ */ + SST_TP_VERSIONS_USED /* Python3.13+ only */ }; #if PY_MAJOR_VERSION == 3 diff --git a/src/sst/core/testingframework/test_engine_globals.py b/src/sst/core/testingframework/test_engine_globals.py index 38e365df8..f235d77a7 100644 --- a/src/sst/core/testingframework/test_engine_globals.py +++ b/src/sst/core/testingframework/test_engine_globals.py @@ -15,11 +15,13 @@ """ import os -from typing import TYPE_CHECKING +from typing import Dict, List, TYPE_CHECKING if TYPE_CHECKING: import configparser + from test_engine_junit import JUnitTestCase + # Verbose Defines VERBOSE_QUIET = 0 VERBOSE_NORMAL = 1 @@ -27,30 +29,30 @@ VERBOSE_DEBUG = 3 # Global Var Defines -TESTRUN_TESTRUNNINGFLAG = None -TESTRUN_SINGTHREAD_TESTSUITE_NAME = None -TESTRUN_JUNIT_TESTCASE_DICTLISTS = None +TESTRUN_TESTRUNNINGFLAG = False +TESTRUN_SINGTHREAD_TESTSUITE_NAME = "" +TESTRUN_JUNIT_TESTCASE_DICTLISTS: Dict[str, List["JUnitTestCase"]] = dict() -TESTOUTPUT_TOPDIRPATH = None -TESTOUTPUT_RUNDIRPATH = None -TESTOUTPUT_TMPDIRPATH = None -TESTOUTPUT_XMLDIRPATH = None +TESTOUTPUT_TOPDIRPATH = "" +TESTOUTPUT_RUNDIRPATH = "" +TESTOUTPUT_TMPDIRPATH = "" +TESTOUTPUT_XMLDIRPATH = "" -TESTENGINE_CONCURRENTMODE = None -TESTENGINE_THREADLIMIT = None -TESTENGINE_DEBUGMODE = None -TESTENGINE_LOGFAILMODE = None -TESTENGINE_IGNORESKIPS = None -TESTENGINE_VERBOSITY = None -TESTENGINE_SSTRUN_NUMRANKS = None -TESTENGINE_SSTRUN_NUMTHREADS = None -TESTENGINE_SSTRUN_GLOBALARGS = None -TESTENGINE_CORE_CONFFILE_PARSER = None -TESTENGINE_CORE_CONFINCLUDE_DICT = None -TESTENGINE_ELEM_CONFINCLUDE_DICT = None +TESTENGINE_CONCURRENTMODE = False +TESTENGINE_THREADLIMIT = 8 +TESTENGINE_DEBUGMODE = False +TESTENGINE_LOGFAILMODE = False +TESTENGINE_IGNORESKIPS = False +TESTENGINE_VERBOSITY = 1 +TESTENGINE_SSTRUN_NUMRANKS = 1 +TESTENGINE_SSTRUN_NUMTHREADS = 1 +TESTENGINE_SSTRUN_GLOBALARGS = "" +TESTENGINE_CORE_CONFFILE_PARSER: "configparser.RawConfigParser" = None # type: ignore [assignment] +TESTENGINE_CORE_CONFINCLUDE_DICT: Dict[str, str] = dict() +TESTENGINE_ELEM_CONFINCLUDE_DICT: Dict[str, str] = dict() TESTENGINE_ERRORCOUNT = 0 -TESTENGINE_SCENARIOSLIST = None -TESTENGINE_TESTNOTESLIST = None +TESTENGINE_SCENARIOSLIST: List[str] = [] +TESTENGINE_TESTNOTESLIST: List[str] = [] # These are some globals to pass data between the top level test engine # and the lower level testscripts @@ -98,8 +100,8 @@ def init_test_engine_globals() -> None: TESTENGINE_VERBOSITY = 1 TESTENGINE_SSTRUN_NUMRANKS = 1 TESTENGINE_SSTRUN_NUMTHREADS = 1 - TESTENGINE_SSTRUN_GLOBALARGS = ["xxx"] - TESTENGINE_CORE_CONFFILE_PARSER = None + TESTENGINE_SSTRUN_GLOBALARGS = "xxx" + TESTENGINE_CORE_CONFFILE_PARSER = None # type: ignore [assignment] TESTENGINE_CORE_CONFINCLUDE_DICT = {} TESTENGINE_ELEM_CONFINCLUDE_DICT = {} TESTENGINE_ERRORCOUNT = 0