Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,27 @@
minor=$(python3 --version | cut -d. -f2)
if [ "$minor" -ge 7 ]; then
python -m pip install --upgrade "pip==24.0" --only-binary=:all:
python -m pip install .

Check warning on line 47 in .github/workflows/server.yml

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Using dependencies without locking resolved versions is security-sensitive.

See more on https://sonarcloud.io/project/issues?id=ChannelFinder_recsync&issues=AZ_dnArwfVyGursnNvV3&open=AZ_dnArwfVyGursnNvV3&pullRequest=178
else
# Python 3.6 runs from a checkout (see README), not a pip install.
# Just install the runtime deps, pinned per pyproject.toml.
python -m pip install --upgrade "pip==21.3.1" --only-binary=:all:
python -m pip install \
"channelfinder @ https://github.com/ChannelFinder/pyCFClient/archive/refs/tags/v3.2.0.zip#sha256=ec89537f336c4cb8db18909c4b02176dd5fbd03f5872a6527129879cbf3f7c85" \
"dataclasses==0.8" \
"requests==2.27.1" \
"twisted==21.7.0"
fi
- name: Import smoke test
run: |
minor=$(python3 --version | cut -d. -f2)
if [ "$minor" -lt 7 ]; then
# Intentional for 3.6: run from the checkout, as documented.
PYTHONPATH=. python -c "from twisted.plugins import recceiver_plugin"
else
# Run outside the checkout so this fails if pip didn't install it.
cd /tmp && python -c "from twisted.plugins import recceiver_plugin"
fi
python -m pip install --no-deps .
test-unit:
runs-on: ubuntu-latest
needs: build-server
Expand Down
4 changes: 2 additions & 2 deletions server/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ dependencies = [
"channelfinder @ https://github.com/ChannelFinder/pyCFClient/archive/refs/tags/v3.2.0.zip",
"dataclasses; python_version<'3.7'",
"requests>=2.27.1,<2.28; python_version<'3.7'",
"requests>=2.31,<2.32; python_version<'3.8'",
"requests>=2.31,<2.32; python_version>='3.7' and python_version<'3.8'",
"requests>=2.32.3,<2.33; python_version>='3.8'",
"twisted>=21.7,<22; python_version<'3.7'",
"twisted>=22.10,<23; python_version<'3.8'",
"twisted>=22.10,<23; python_version>='3.7' and python_version<'3.8'",
"twisted>=24.11,<24.12; python_version>='3.8'",
]
optional-dependencies.metrics = [ "prometheus-client" ]
Expand Down
5 changes: 3 additions & 2 deletions server/recceiver/processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
from configparser import ConfigParser as Parser
from os.path import expanduser
from typing import Dict

from twisted.application import service
from twisted.internet import defer, task
Expand All @@ -22,9 +23,9 @@
]


def _env_vars(section: str) -> dict[str, str]:
def _env_vars(section: str) -> Dict[str, str]:
prefix = "RECCEIVER_" + section.upper() + "_"
return {k.removeprefix(prefix).lower(): v for k, v in os.environ.items() if k.startswith(prefix)}
return {k[len(prefix) :].lower(): v for k, v in os.environ.items() if k.startswith(prefix)}


class ConfigAdapter(object):
Expand Down
11 changes: 6 additions & 5 deletions server/recceiver/recast.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import logging
import random
import time
from typing import DefaultDict, Dict, List, Set, Tuple

from twisted.internet import defer, protocol
from twisted.internet.interfaces import IAddress
Expand Down Expand Up @@ -212,11 +213,11 @@ class Transaction:
connected: bool
initial: bool
srcid: int
records_to_add: dict[int, tuple[str, str]]
client_infos: dict[str, str]
record_infos_to_add: dict[int, dict[str, str]]
aliases: collections.defaultdict[int, list[str]]
records_to_delete: set[int]
records_to_add: Dict[int, Tuple[str, str]]
client_infos: Dict[str, str]
record_infos_to_add: Dict[int, Dict[str, str]]
aliases: DefaultDict[int, List[str]]
records_to_delete: Set[int]

def __init__(self, ep: IAddress, id: int) -> None:
self.connected = True
Expand Down
Loading