diff --git a/.github/workflows/py-tests.yml b/.github/workflows/py-tests.yml index 191e2e1929..013baea752 100644 --- a/.github/workflows/py-tests.yml +++ b/.github/workflows/py-tests.yml @@ -22,6 +22,7 @@ jobs: strategy: matrix: platform: ${{ (inputs.all-platforms && fromJSON('["ubuntu-latest", "macos-latest", "windows-latest"]')) || fromJSON('["ubuntu-latest"]') }} + python-version: ${{ (inputs.all-platforms && fromJSON('["3.10", "3.11"]')) || fromJSON('["3.11"]') }} runs-on: ${{ matrix.platform }} steps: - name: Check out lingua-franca repository @@ -39,7 +40,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: ${{ matrix.python-version }} - name: Install dependencies OS X run: | brew install coreutils diff --git a/core/src/main/java/org/lflang/generator/python/PythonGenerator.java b/core/src/main/java/org/lflang/generator/python/PythonGenerator.java index e4477d2d0d..b44436e3a3 100644 --- a/core/src/main/java/org/lflang/generator/python/PythonGenerator.java +++ b/core/src/main/java/org/lflang/generator/python/PythonGenerator.java @@ -480,9 +480,6 @@ protected void generateUserPreamblesForReactor(Reactor reactor, CodeBuilder src) @Override protected void generateReactorClassHeaders( TypeParameterizedReactor tpr, String headerName, CodeBuilder header, CodeBuilder src) { - header.pr( - PythonPreambleGenerator.generateCIncludeStatements( - targetConfig, targetLanguageIsCpp(), hasModalReactors)); super.generateReactorClassHeaders(tpr, headerName, header, src); } @@ -569,7 +566,7 @@ private static String setUpMainTarget( add_subdirectory(core) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}) set(LF_MAIN_TARGET ) - find_package(Python 3.10.0...<3.11.0 REQUIRED COMPONENTS Interpreter Development) + find_package(Python 3.10.0...<3.12.0 REQUIRED COMPONENTS Interpreter Development) Python_add_library( ${LF_MAIN_TARGET} MODULE diff --git a/core/src/main/java/org/lflang/generator/python/PythonPreambleGenerator.java b/core/src/main/java/org/lflang/generator/python/PythonPreambleGenerator.java index 8194f78c63..692bf3d747 100644 --- a/core/src/main/java/org/lflang/generator/python/PythonPreambleGenerator.java +++ b/core/src/main/java/org/lflang/generator/python/PythonPreambleGenerator.java @@ -44,8 +44,8 @@ public static String generateCDefineDirectives( public static String generateCIncludeStatements( TargetConfig targetConfig, boolean CCppMode, boolean hasModalReactors) { CodeBuilder code = new CodeBuilder(); - code.pr(CPreambleGenerator.generateIncludeStatements(targetConfig, CCppMode)); code.pr("#include \"pythontarget.h\""); + code.pr(CPreambleGenerator.generateIncludeStatements(targetConfig, CCppMode)); if (hasModalReactors) { code.pr("#include \"include/modal_models/definitions.h\""); } diff --git a/core/src/main/java/org/lflang/generator/python/PythonReactionGenerator.java b/core/src/main/java/org/lflang/generator/python/PythonReactionGenerator.java index cd008cba8d..6676995c6f 100644 --- a/core/src/main/java/org/lflang/generator/python/PythonReactionGenerator.java +++ b/core/src/main/java/org/lflang/generator/python/PythonReactionGenerator.java @@ -118,7 +118,6 @@ private static String generateCPythonFunctionCaller( + " code again", " }", " " + PyUtil.generateGILReleaseCode(), - " Py_FinalizeEx();", " exit(1);", "}", "", diff --git a/core/src/main/resources/lib/c/reactor-c b/core/src/main/resources/lib/c/reactor-c index 5bbdefd558..eab52f47db 160000 --- a/core/src/main/resources/lib/c/reactor-c +++ b/core/src/main/resources/lib/c/reactor-c @@ -1 +1 @@ -Subproject commit 5bbdefd558b2504cd6fd8e881132b11efdce498b +Subproject commit eab52f47db2a8b5c03ca2ab5509411a281c7f872