From fcfd5c09f4ffc7ae12bf6162921cf5c1e859f51c Mon Sep 17 00:00:00 2001 From: Alex Mykyta Date: Tue, 8 Nov 2022 21:09:58 -0800 Subject: [PATCH] fixup --- src/peakrdl_regblock/exporter.py | 2 +- src/peakrdl_regblock/hwif/__init__.py | 6 +++--- src/peakrdl_regblock/hwif/generators.py | 4 ++-- tests/requirements.txt | 4 +++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/peakrdl_regblock/exporter.py b/src/peakrdl_regblock/exporter.py index 195503e..40f1395 100644 --- a/src/peakrdl_regblock/exporter.py +++ b/src/peakrdl_regblock/exporter.py @@ -135,7 +135,7 @@ def export(self, node: Union[RootNode, AddrmapNode], output_dir:str, **kwargs: A if generate_hwif_report: path = os.path.join(output_dir, f"{module_name}_hwif.rpt") - hwif_report_file = open(path, "w") + hwif_report_file = open(path, "w", encoding='utf-8') # pylint: disable=consider-using-with else: hwif_report_file = None diff --git a/src/peakrdl_regblock/hwif/__init__.py b/src/peakrdl_regblock/hwif/__init__.py index 809644e..40fe146 100644 --- a/src/peakrdl_regblock/hwif/__init__.py +++ b/src/peakrdl_regblock/hwif/__init__.py @@ -1,6 +1,6 @@ -from typing import TYPE_CHECKING, Union, List, Set, Dict +from typing import TYPE_CHECKING, Union, Set, Dict, Optional, TextIO -from systemrdl.node import AddrmapNode, Node, SignalNode, FieldNode, AddressableNode, RegNode +from systemrdl.node import AddrmapNode, SignalNode, FieldNode, RegNode from systemrdl.rdltypes import PropertyReference from ..utils import get_indexed_path @@ -23,7 +23,7 @@ class Hwif: def __init__( self, exp: 'RegblockExporter', package_name: str, in_hier_signal_paths: Set[str], out_of_hier_signals: Dict[str, SignalNode], - reuse_typedefs: bool, hwif_report_file: int + reuse_typedefs: bool, hwif_report_file: Optional[TextIO] ): self.exp = exp self.package_name = package_name diff --git a/src/peakrdl_regblock/hwif/generators.py b/src/peakrdl_regblock/hwif/generators.py index a3c05f8..42ed7b3 100644 --- a/src/peakrdl_regblock/hwif/generators.py +++ b/src/peakrdl_regblock/hwif/generators.py @@ -17,7 +17,7 @@ def __init__(self, hwif: 'Hwif', hwif_name: str) -> None: self.hwif_report_stack = [hwif_name] - def push_struct(self, type_name: str, inst_name: str, array_dimensions: Optional[List[int]] = None) -> None: + def push_struct(self, type_name: str, inst_name: str, array_dimensions: Optional[List[int]] = None) -> None: # type: ignore super().push_struct(type_name, inst_name, array_dimensions) if array_dimensions: @@ -31,7 +31,7 @@ def pop_struct(self) -> None: super().pop_struct() self.hwif_report_stack.pop() - def add_member(self, name: str, width: int = 1) -> None: + def add_member(self, name: str, width: int = 1) -> None: # type: ignore # pylint: disable=arguments-differ super().add_member(name, width) if width > 1: diff --git a/tests/requirements.txt b/tests/requirements.txt index 357f5bc..b69ec8c 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,4 +1,6 @@ -pytest +# hold back: https://github.com/kevlened/pytest-parallel/issues/118 +pytest<7.2 + parameterized pytest-parallel jinja2-simple-tags