Skip to content

Commit 973fdf8

Browse files
authored
Merge pull request #118 from tynanford/master
switch type hints to be py36 compatible
2 parents c8c1100 + 49dfd9e commit 973fdf8

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

.github/workflows/server.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,27 @@ on:
1414
jobs:
1515
build-server:
1616
runs-on: ubuntu-latest
17+
container: ${{ matrix.container }}
1718
strategy:
1819
matrix:
19-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
20+
include:
21+
- python-version: "3.6"
22+
container: "python:3.6"
23+
- python-version: "3.7"
24+
container: "python:3.7"
25+
- python-version: "3.8"
26+
- python-version: "3.9"
27+
- python-version: "3.10"
28+
- python-version: "3.11"
29+
- python-version: "3.12"
30+
- python-version: "3.13"
2031
defaults:
2132
run:
2233
working-directory: server
2334
steps:
2435
- uses: actions/checkout@v4
2536
- name: Set up Python ${{ matrix.python-version }}
37+
if: ${{ !matrix.container }}
2638
uses: actions/setup-python@v5
2739
with:
2840
python-version: ${{ matrix.python-version }}

server/recceiver/cfstore.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import time
99
from collections import defaultdict
1010
from operator import itemgetter
11+
from typing import Dict, List, Set
1112

1213
from channelfinder import ChannelFinderClient
1314
from requests import ConnectionError, RequestException
@@ -397,15 +398,15 @@ def dict_to_file(dict, iocs, conf):
397398
json.dump(list, f)
398399

399400

400-
def create_channel(name: str, owner: str, properties: list[dict[str, str]]):
401+
def create_channel(name: str, owner: str, properties: List[Dict[str, str]]):
401402
return {
402403
"name": name,
403404
"owner": owner,
404405
"properties": properties,
405406
}
406407

407408

408-
def create_property(owner: str, name: str, value: str):
409+
def create_property(owner: str, name: str, value: str) -> Dict[str, str]:
409410
return {
410411
"name": name,
411412
"owner": owner,
@@ -741,8 +742,8 @@ def create_default_properties(owner, iocTime, recceiverid, channels_dict, iocs,
741742

742743

743744
def __merge_property_lists(
744-
newProperties: list[dict[str, str]], channel: dict[str, list[dict[str, str]]], managed_properties=set()
745-
) -> list[dict[str, str]]:
745+
newProperties: List[Dict[str, str]], channel: Dict[str, List[Dict[str, str]]], managed_properties: Set[str] = set()
746+
) -> List[Dict[str, str]]:
746747
"""
747748
Merges two lists of properties ensuring that there are no 2 properties with
748749
the same name In case of overlap between the new and old property lists the

0 commit comments

Comments
 (0)