From bfe6e6d686f03922ec5e68f0d824dcbaad2bec48 Mon Sep 17 00:00:00 2001 From: Dominik Krupke Date: Thu, 5 Sep 2024 20:53:30 +0200 Subject: [PATCH] Making it compatible for Py3.9 again because streamlit runs on that. --- .github/workflows/pytest.yml | 2 +- cpsat_log_parser/blocks/solver.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml index f3d19a4..f0e52cc 100644 --- a/.github/workflows/pytest.yml +++ b/.github/workflows/pytest.yml @@ -7,7 +7,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.12"] + python-version: ["3.9", "3.12"] steps: - uses: actions/checkout@v3 diff --git a/cpsat_log_parser/blocks/solver.py b/cpsat_log_parser/blocks/solver.py index 8320adc..0c0e656 100644 --- a/cpsat_log_parser/blocks/solver.py +++ b/cpsat_log_parser/blocks/solver.py @@ -29,7 +29,7 @@ def _convert_value(value): return value # If it cannot be converted to a number, keep as is -def _parse_block(tokens) -> dict: +def _parse_block(tokens) -> typing.Dict: block_dict = {} while tokens: key = tokens.pop(0).strip() @@ -49,7 +49,7 @@ def _parse_block(tokens) -> dict: block_dict[key] = value return block_dict -def parse_parameters_line(line: str) -> dict[str, str|int|float|bool|list|dict]: +def parse_parameters_line(line: str) -> typing.Dict: """Parse the 'Parameters: ' line and return a dictionary of parameters.""" if not line.startswith('Parameters: '): raise ValueError('The line must begin with "Parameters: "')