diff --git a/.github/workflows/server.yml b/.github/workflows/server.yml index b074a1f..5276952 100644 --- a/.github/workflows/server.yml +++ b/.github/workflows/server.yml @@ -14,15 +14,27 @@ on: jobs: build-server: runs-on: ubuntu-latest + container: ${{ matrix.container }} strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + include: + - python-version: "3.6" + container: "python:3.6" + - python-version: "3.7" + container: "python:3.7" + - python-version: "3.8" + - python-version: "3.9" + - python-version: "3.10" + - python-version: "3.11" + - python-version: "3.12" + - python-version: "3.13" defaults: run: working-directory: server steps: - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} + if: ${{ !matrix.container }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} diff --git a/server/recceiver/cfstore.py b/server/recceiver/cfstore.py index da6bcfa..1b68990 100755 --- a/server/recceiver/cfstore.py +++ b/server/recceiver/cfstore.py @@ -8,6 +8,7 @@ import time from collections import defaultdict from operator import itemgetter +from typing import Dict, List, Set from channelfinder import ChannelFinderClient from requests import ConnectionError, RequestException @@ -397,7 +398,7 @@ def dict_to_file(dict, iocs, conf): json.dump(list, f) -def create_channel(name: str, owner: str, properties: list[dict[str, str]]): +def create_channel(name: str, owner: str, properties: List[Dict[str, str]]): return { "name": name, "owner": owner, @@ -405,7 +406,7 @@ def create_channel(name: str, owner: str, properties: list[dict[str, str]]): } -def create_property(owner: str, name: str, value: str): +def create_property(owner: str, name: str, value: str) -> Dict[str, str]: return { "name": name, "owner": owner, @@ -741,8 +742,8 @@ def create_default_properties(owner, iocTime, recceiverid, channels_dict, iocs, def __merge_property_lists( - newProperties: list[dict[str, str]], channel: dict[str, list[dict[str, str]]], managed_properties=set() -) -> list[dict[str, str]]: + newProperties: List[Dict[str, str]], channel: Dict[str, List[Dict[str, str]]], managed_properties: Set[str] = set() +) -> List[Dict[str, str]]: """ Merges two lists of properties ensuring that there are no 2 properties with the same name In case of overlap between the new and old property lists the