Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.11 support #1902

Closed
wants to merge 14 commits into from
3 changes: 2 additions & 1 deletion .github/workflows/py-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -569,7 +566,7 @@ private static String setUpMainTarget(
add_subdirectory(core)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR})
set(LF_MAIN_TARGET <pyModuleName>)
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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\"");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ private static String generateCPythonFunctionCaller(
+ " code again",
" }",
" " + PyUtil.generateGILReleaseCode(),
" Py_FinalizeEx();",
" exit(1);",
"}",
"",
Expand Down
Loading