diff --git a/.github/workflows/pythonpackage.yaml b/.github/workflows/pythonpackage.yaml index 00f8f04..14a6b2c 100644 --- a/.github/workflows/pythonpackage.yaml +++ b/.github/workflows/pythonpackage.yaml @@ -17,19 +17,54 @@ jobs: os: ["ubuntu-latest", "windows-latest", "macos-latest"] steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install tox - run: | - python -m pip install --upgrade pip - pip install tox - - name: Run tests, flake8 and mypy - run: | - tox - - name: "Upload coverage to Codecov" - uses: "codecov/codecov-action@v3" - with: - fail_ci_if_error: true + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Install tox + run: | + python -m pip install --upgrade pip + pip install tox + + - name: Setup network interfaces + if: ${{ startsWith(matrix.os, 'ubuntu') }} + run: | + set -x + sudo ip link add type veth + sudo ip link set dev veth0 address 02:00:00:00:00:00 name feth0 + sudo ip link set dev veth1 address 02:00:00:00:00:01 name feth1 + sudo ip link set up dev feth0 + sudo ip link set up dev feth1 + sudo ip addr show dev feth0 + sudo ip addr show dev feth1 + + - name: Setup network interfaces + if: ${{ startsWith(matrix.os, 'macos') }} + run: | + set -x + # it looks like macos will only assign the link-local address + # when another address was assigned?? let's just directly assign our + # fixed LL addresses here directly + sudo ifconfig feth0 create lladdr 02:00:00:00:00:00 + sudo ifconfig feth1 create lladdr 02:00:00:00:00:01 + sudo ifconfig feth0 peer feth1 + sudo ifconfig feth0 inet6 fd00::0 + sudo ifconfig feth1 inet6 fd00::1 + sudo ifconfig feth0 up + sudo ifconfig feth1 up + sudo ifconfig feth0 + sudo ifconfig feth1 + + - name: Run tests, flake8 and mypy + run: | + false + tox + + - name: "Upload coverage to Codecov" + uses: "codecov/codecov-action@v4" + with: + fail_ci_if_error: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/src/someip/utils.py b/src/someip/utils.py index 5157869..86fc1e6 100644 --- a/src/someip/utils.py +++ b/src/someip/utils.py @@ -25,7 +25,7 @@ async def wrapper(self, *args, **kwargs): return await f(self, *args, **kwargs) except Exception: self.log.exception( - msg.format(__func__=f.__qualname__, *args, **kwargs) + msg.format(*args, __func__=f.__qualname__, **kwargs) ) else: @@ -36,7 +36,7 @@ def wrapper(self, *args, **kwargs): return f(self, *args, **kwargs) except Exception: self.log.exception( - msg.format(__func__=f.__qualname__, *args, **kwargs) + msg.format(*args, __func__=f.__qualname__, **kwargs) ) return wrapper diff --git a/tests/test_sd.py b/tests/test_sd.py index 7f218ba..0944498 100644 --- a/tests/test_sd.py +++ b/tests/test_sd.py @@ -2377,19 +2377,19 @@ class TestMulticastEndpointsV6( required setup on Linux: ip link add type veth - ip link set dev veth0 address 02:00:00:00:00:00 - ip link set dev veth1 address 02:00:00:00:00:01 - ip link set up dev veth0 - ip link set up dev veth1 + ip link set dev veth0 address 02:00:00:00:00:00 name feth0 + ip link set dev veth1 address 02:00:00:00:00:01 name feth1 + ip link set up dev feth0 + ip link set up dev feth1 """ - bind_lo_addr = "fe80::ff:fe00:0%veth0" - sender_lo_addr = "fe80::ff:fe00:1%veth0" - send_addr = "fe80::ff:fe00:0%veth1" - bind_mc_addr = "ff02::dead:beef%veth0" - send_mc_addr = "ff02::dead:beef%veth1" - bind_interface = "veth0" - send_interface = "veth1" + bind_lo_addr = "fe80::ff:fe00:0%feth0" + sender_lo_addr = "fe80::ff:fe00:1%feth0" + send_addr = "fe80::ff:fe00:0%feth1" + bind_mc_addr = "ff02::dead:beef%feth0" + send_mc_addr = "ff02::dead:beef%feth1" + bind_interface = "feth0" + send_interface = "feth1" AF = socket.AF_INET6 def setUp(self): @@ -2397,7 +2397,7 @@ def setUp(self): socket.if_nametoindex(self.bind_interface) socket.if_nametoindex(self.send_interface) except OSError as exc: - raise unittest.SkipTest("test interfaces veth0 / veth1 not up") from exc + raise unittest.SkipTest("test interfaces feth0 / feth1 not up") from exc def _mc_sockopts(self, sock: socket.socket) -> None: ifindex = socket.if_nametoindex(self.send_interface) diff --git a/tools/find-subscribe.py b/tools/find-subscribe.py index 2d3a09c..208a9dd 100755 --- a/tools/find-subscribe.py +++ b/tools/find-subscribe.py @@ -85,7 +85,7 @@ def auto_int(s): def setup_log(fmt="", **kwargs): try: - import coloredlogs # type: ignore[import] + import coloredlogs # type: ignore[import-not-found] coloredlogs.install(fmt="%(asctime)s,%(msecs)03d " + fmt, **kwargs) except ModuleNotFoundError: logging.basicConfig(format="%(asctime)s " + fmt, **kwargs) diff --git a/tools/get.py b/tools/get.py index 4f6ac97..e55a1fd 100755 --- a/tools/get.py +++ b/tools/get.py @@ -52,7 +52,7 @@ def auto_int(s): def setup_log(fmt="", **kwargs): try: - import coloredlogs # type: ignore[import] + import coloredlogs # type: ignore[import-not-found] coloredlogs.install(fmt="%(asctime)s,%(msecs)03d " + fmt, **kwargs) except ModuleNotFoundError: logging.basicConfig(format="%(asctime)s " + fmt, **kwargs) diff --git a/tools/monitor-sd.py b/tools/monitor-sd.py index 5be8f88..7533905 100755 --- a/tools/monitor-sd.py +++ b/tools/monitor-sd.py @@ -53,7 +53,7 @@ def auto_int(s): def setup_log(fmt="", **kwargs): try: - import coloredlogs # type: ignore[import] + import coloredlogs # type: ignore[import-not-found] coloredlogs.install(fmt="%(asctime)s,%(msecs)03d " + fmt, **kwargs) except ModuleNotFoundError: logging.basicConfig(format="%(asctime)s " + fmt, **kwargs) diff --git a/tools/simpleservice.py b/tools/simpleservice.py index de72619..84c00b2 100755 --- a/tools/simpleservice.py +++ b/tools/simpleservice.py @@ -95,7 +95,7 @@ async def run(local_addr, multicast_addr, port): def setup_log(fmt="", **kwargs): try: - import coloredlogs # type: ignore[import] + import coloredlogs # type: ignore[import-not-found] coloredlogs.install(fmt="%(asctime)s,%(msecs)03d " + fmt, **kwargs) except ModuleNotFoundError: