added checks for python3.8 or lower since ast_comments.unparse() needs python 3.9 or higher.

testing with python 3.8 would make the build fail tests, skipping it there.
This commit is contained in:
hippocritical
2023-03-10 08:59:07 +01:00
parent 1bb697e58c
commit bfc7f48f17
2 changed files with 143 additions and 131 deletions

View File

@@ -1,4 +1,5 @@
import logging
import sys
import time
from pathlib import Path
from typing import Any, Dict
@@ -19,28 +20,34 @@ def start_strategy_update(args: Dict[str, Any]) -> None:
:return: None
"""
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
if sys.version_info <= (3, 8):
print("This code requires Python 3.9 or higher. "
"We cannot continue. "
"Please upgrade your python version to use this command.")
strategy_objs = StrategyResolver.search_all_objects(
config, enum_failed=False, recursive=config.get('recursive_strategy_search', False))
filtered_strategy_objs = []
if 'strategy_list' in args:
for args_strategy in args['strategy_list']:
for strategy_obj in strategy_objs:
if (strategy_obj['name'] == args_strategy
and strategy_obj not in filtered_strategy_objs):
filtered_strategy_objs.append(strategy_obj)
break
for filtered_strategy_obj in filtered_strategy_objs:
start_conversion(filtered_strategy_obj, config)
else:
processed_locations = set()
for strategy_obj in strategy_objs:
if strategy_obj['location'] not in processed_locations:
processed_locations.add(strategy_obj['location'])
start_conversion(strategy_obj, config)
config = setup_utils_configuration(args, RunMode.UTIL_NO_EXCHANGE)
strategy_objs = StrategyResolver.search_all_objects(
config, enum_failed=False, recursive=config.get('recursive_strategy_search', False))
filtered_strategy_objs = []
if 'strategy_list' in args:
for args_strategy in args['strategy_list']:
for strategy_obj in strategy_objs:
if (strategy_obj['name'] == args_strategy
and strategy_obj not in filtered_strategy_objs):
filtered_strategy_objs.append(strategy_obj)
break
for filtered_strategy_obj in filtered_strategy_objs:
start_conversion(filtered_strategy_obj, config)
else:
processed_locations = set()
for strategy_obj in strategy_objs:
if strategy_obj['location'] not in processed_locations:
processed_locations.add(strategy_obj['location'])
start_conversion(strategy_obj, config)
def start_conversion(strategy_obj, config):