From b9fb35c6e5b942a65a28504be368daffc6ff14bc Mon Sep 17 00:00:00 2001 From: Marcin Copik Date: Wed, 20 Sep 2023 14:39:18 +0200 Subject: [PATCH 1/2] Fix fparser imports to make them compatible with newer package versions --- dace/frontend/fortran/ast_components.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/dace/frontend/fortran/ast_components.py b/dace/frontend/fortran/ast_components.py index 1e5bfb4528..d95fa87e58 100644 --- a/dace/frontend/fortran/ast_components.py +++ b/dace/frontend/fortran/ast_components.py @@ -1,6 +1,5 @@ # Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved. -from fparser.two.Fortran2008 import Fortran2008 as f08 -from fparser.two import Fortran2008 +from fparser.two import Fortran2008 as f08 from fparser.two import Fortran2003 as f03 from fparser.two import symbol_table @@ -608,7 +607,7 @@ def type_declaration_stmt(self, node: FASTNode): if i.string.lower() == "parameter": symbol = True - if isinstance(i, Fortran2008.Attr_Spec_List): + if isinstance(i, f08.Attr_Spec_List): dimension_spec = get_children(i, "Dimension_Attr_Spec") if len(dimension_spec) == 0: @@ -1052,7 +1051,7 @@ def specification_part(self, node: FASTNode): decls = [self.create_ast(i) for i in node.children if isinstance(i, f08.Type_Declaration_Stmt)] - uses = [self.create_ast(i) for i in node.children if isinstance(i, f08.Use_Stmt)] + uses = [self.create_ast(i) for i in node.children if isinstance(i, f03.Use_Stmt)] tmp = [self.create_ast(i) for i in node.children] typedecls = [i for i in tmp if isinstance(i, ast_internal_classes.Type_Decl_Node)] symbols = [] From 6c9a16d85ff6e2881b72528df913e492ab98ba18 Mon Sep 17 00:00:00 2001 From: Marcin Copik Date: Wed, 20 Sep 2023 14:39:55 +0200 Subject: [PATCH 2/2] Bump fparser to 0.1.3 --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index 33cd58a0bf..ea4db45916 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,7 +6,7 @@ charset-normalizer==3.1.0 click==8.1.3 dill==0.3.6 Flask==2.3.2 -fparser==0.1.2 +fparser==0.1.3 idna==3.4 importlib-metadata==6.6.0 itsdangerous==2.1.2 diff --git a/setup.py b/setup.py index b1737aed5a..6f97086543 100644 --- a/setup.py +++ b/setup.py @@ -74,7 +74,7 @@ include_package_data=True, install_requires=[ 'numpy', 'networkx >= 2.5', 'astunparse', 'sympy<=1.9', 'pyyaml', 'ply', 'websockets', 'requests', 'flask', - 'fparser >= 0.1.2', 'aenum >= 3.1', 'dataclasses; python_version < "3.7"', 'dill', + 'fparser >= 0.1.3', 'aenum >= 3.1', 'dataclasses; python_version < "3.7"', 'dill', 'pyreadline;platform_system=="Windows"', 'typing-compat; python_version < "3.8"' ] + cmake_requires, extras_require={