From 04d1e851923817d44093029269a8e307c8353ef4 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 11:23:28 -0600 Subject: [PATCH 01/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 735269b..63a2edb 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -4,6 +4,7 @@ import asyncio import pathlib from typing import Dict, Any, Union, Tuple, List +from __future__ import annotations import yaqd_core @@ -18,7 +19,7 @@ def __init__( self._measured: MeasureType = dict() # values must be numbers or arrays self._channel_names: List[str] = [] self._channel_units: Dict[str, str] = dict() - self._channel_shapes: Dict[str, Tuple[int]] = dict() + self._channel_shapes: Dict[str, Tuple[..., int]] = dict() self._measurement_id = 0 self._measured["measurement_id"] = self._measurement_id From 30f657e2d12a485bba69e1fb455f0ed4a12a0c21 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 11:26:11 -0600 Subject: [PATCH 02/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 63a2edb..7e8ebdf 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -1,10 +1,11 @@ +from __future__ import annotations + __all__ = ["IsSensor"] import asyncio import pathlib from typing import Dict, Any, Union, Tuple, List -from __future__ import annotations import yaqd_core From d7d148bb9251d5ad8397981efb7e69a08abac1ab Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 11:26:59 -0600 Subject: [PATCH 03/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 7e8ebdf..e5968ad 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -20,7 +20,7 @@ def __init__( self._measured: MeasureType = dict() # values must be numbers or arrays self._channel_names: List[str] = [] self._channel_units: Dict[str, str] = dict() - self._channel_shapes: Dict[str, Tuple[..., int]] = dict() + self._channel_shapes: Dict[str, Tuple[int, ...]] = dict() self._measurement_id = 0 self._measured["measurement_id"] = self._measurement_id From b716abbd3ab6d2fc41a6be6589cf22298838ea0e Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 12:03:28 -0600 Subject: [PATCH 04/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index e5968ad..0ab17ef 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,7 +5,7 @@ import asyncio import pathlib -from typing import Dict, Any, Union, Tuple, List +from typing import Any import yaqd_core @@ -14,13 +14,13 @@ class IsSensor(yaqd_core.IsDaemon): def __init__( - self, name: str, config: Dict[str, Any], config_filepath: pathlib.Path + self, name: str, config: dict[str, Any], config_filepath: pathlib.Path ): super().__init__(name, config, config_filepath) self._measured: MeasureType = dict() # values must be numbers or arrays - self._channel_names: List[str] = [] - self._channel_units: Dict[str, str] = dict() - self._channel_shapes: Dict[str, Tuple[int, ...]] = dict() + self._channel_names: list[str] = [] + self._channel_units: dict[str, str] = dict() + self._channel_shapes: dict[str, tuple[int, ...]] = dict() self._measurement_id = 0 self._measured["measurement_id"] = self._measurement_id From 27141df2a23a2980e4ab0d51305ed92175cd82e5 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 12:05:01 -0600 Subject: [PATCH 05/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 0ab17ef..6ba6b4a 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -9,7 +9,7 @@ import yaqd_core -MeasureType = Dict[str, Union[float]] +MeasureType = dict[str, Union[float]] class IsSensor(yaqd_core.IsDaemon): From 0aa71b5098a289710ef377ad4dfec3d07ac8aa6a Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 16 Feb 2025 23:23:52 -0600 Subject: [PATCH 06/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 6ba6b4a..7442888 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -9,7 +9,7 @@ import yaqd_core -MeasureType = dict[str, Union[float]] +MeasureType = dict[str, float] class IsSensor(yaqd_core.IsDaemon): From c517765b03d6169303e72886159cb20b4577d18b Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:27:30 -0600 Subject: [PATCH 07/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 7442888..feb44fc 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,11 +5,12 @@ import asyncio import pathlib -from typing import Any +from typing import Any, NewType import yaqd_core -MeasureType = dict[str, float] + +MeasureType = NewType("MeasureType", dict[str, float]) class IsSensor(yaqd_core.IsDaemon): From c6b0b9108c7ddcde0e45f57c246b130adf314da0 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:35:04 -0600 Subject: [PATCH 08/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index feb44fc..f9d8564 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,12 +5,12 @@ import asyncio import pathlib -from typing import Any, NewType +from typing import Any, Dict, NewType import yaqd_core -MeasureType = NewType("MeasureType", dict[str, float]) +MeasureType = NewType("MeasureType", Dict[str, float]) class IsSensor(yaqd_core.IsDaemon): From d98dc108f6845b655ec34ef2d0b9c783a1f238d1 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 10:39:42 -0600 Subject: [PATCH 09/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index f9d8564..53c4b6b 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,12 +5,12 @@ import asyncio import pathlib -from typing import Any, Dict, NewType +from typing import Any, Dict, TypeAlias import yaqd_core -MeasureType = NewType("MeasureType", Dict[str, float]) +MeasureType: TypeAlias = dict[str, float] class IsSensor(yaqd_core.IsDaemon): From 3c08c6e412a0dde068ff7de091dc931a92404912 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:20:17 -0600 Subject: [PATCH 10/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 53c4b6b..591a94c 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,12 +5,16 @@ import asyncio import pathlib -from typing import Any, Dict, TypeAlias +from typing import Any, Dict, TYPE_CHECKING import yaqd_core - -MeasureType: TypeAlias = dict[str, float] +if TYPE_CHECKING: + try: + from typing import TypeAlias + MeasureType: TypeAlias = dict[str, float] + except ImportError: # python <=3.8 + MeasureType = Dict[str, float] class IsSensor(yaqd_core.IsDaemon): From 415ba2befcf4db49fb04a3bdf4aa5d26f6e4a393 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 17:20:30 +0000 Subject: [PATCH 11/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/_is_sensor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 591a94c..d3a9407 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -12,6 +12,7 @@ if TYPE_CHECKING: try: from typing import TypeAlias + MeasureType: TypeAlias = dict[str, float] except ImportError: # python <=3.8 MeasureType = Dict[str, float] From e054ab280f5e5b71afec27ff8a87a0f3232ba5df Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:34:18 -0600 Subject: [PATCH 12/30] propagate to HasMeasureTrigger --- yaqd-core/yaqd_core/_has_measure_trigger.py | 5 +++-- yaqd-core/yaqd_core/_is_sensor.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/yaqd-core/yaqd_core/_has_measure_trigger.py b/yaqd-core/yaqd_core/_has_measure_trigger.py index a3f3447..30fa478 100644 --- a/yaqd-core/yaqd_core/_has_measure_trigger.py +++ b/yaqd-core/yaqd_core/_has_measure_trigger.py @@ -3,11 +3,12 @@ import asyncio import pathlib -from typing import Dict, Any, Optional +from typing import Dict, Any, Optional, TYPE_CHECKING from abc import ABC, abstractmethod from yaqd_core import IsSensor, IsDaemon -from ._is_sensor import MeasureType +if TYPE_CHECKING: + from ._is_sensor import MeasureType class HasMeasureTrigger(IsSensor, IsDaemon, ABC): diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index d3a9407..b938c76 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -9,6 +9,7 @@ import yaqd_core + if TYPE_CHECKING: try: from typing import TypeAlias From 717ebb2b7819db4ac0b68974d82d089438182466 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 17:34:30 +0000 Subject: [PATCH 13/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/_has_measure_trigger.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yaqd-core/yaqd_core/_has_measure_trigger.py b/yaqd-core/yaqd_core/_has_measure_trigger.py index 30fa478..1f9dfd2 100644 --- a/yaqd-core/yaqd_core/_has_measure_trigger.py +++ b/yaqd-core/yaqd_core/_has_measure_trigger.py @@ -7,6 +7,7 @@ from abc import ABC, abstractmethod from yaqd_core import IsSensor, IsDaemon + if TYPE_CHECKING: from ._is_sensor import MeasureType From 34853207fbb8b1c6254950d89080d5da7d71231f Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:35:17 -0600 Subject: [PATCH 14/30] Update _is_sensor.py --- yaqd-core/yaqd_core/_is_sensor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index b938c76..63b7e12 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,7 +5,7 @@ import asyncio import pathlib -from typing import Any, Dict, TYPE_CHECKING +from typing import Any, TYPE_CHECKING import yaqd_core @@ -16,6 +16,7 @@ MeasureType: TypeAlias = dict[str, float] except ImportError: # python <=3.8 + from typing import Dict MeasureType = Dict[str, float] From f21d365181c88c3a8ac46f773dd76c36e7652686 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 17:35:45 +0000 Subject: [PATCH 15/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/_is_sensor.py | 1 + 1 file changed, 1 insertion(+) diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 63b7e12..4d12044 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -17,6 +17,7 @@ MeasureType: TypeAlias = dict[str, float] except ImportError: # python <=3.8 from typing import Dict + MeasureType = Dict[str, float] From a57f059335365568933a70e64167b4320799e3f1 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:44:35 -0600 Subject: [PATCH 16/30] remove MeasureType --- yaqd-core/yaqd_core/_has_measure_trigger.py | 13 ++++++------- yaqd-core/yaqd_core/_is_sensor.py | 17 +++-------------- 2 files changed, 9 insertions(+), 21 deletions(-) diff --git a/yaqd-core/yaqd_core/_has_measure_trigger.py b/yaqd-core/yaqd_core/_has_measure_trigger.py index 1f9dfd2..ed25962 100644 --- a/yaqd-core/yaqd_core/_has_measure_trigger.py +++ b/yaqd-core/yaqd_core/_has_measure_trigger.py @@ -1,31 +1,30 @@ +from __future__ import annotations + __all__ = ["HasMeasureTrigger"] import asyncio import pathlib -from typing import Dict, Any, Optional, TYPE_CHECKING +from typing import Any from abc import ABC, abstractmethod from yaqd_core import IsSensor, IsDaemon -if TYPE_CHECKING: - from ._is_sensor import MeasureType - class HasMeasureTrigger(IsSensor, IsDaemon, ABC): def __init__( - self, name: str, config: Dict[str, Any], config_filepath: pathlib.Path + self, name: str, config: dict[str, Any], config_filepath: pathlib.Path ): super().__init__(name, config, config_filepath) self._looping = False if self._config["loop_at_startup"]: self.measure(loop=True) - def get_measured(self) -> MeasureType: + def get_measured(self) -> dict: return super().get_measured() @abstractmethod - async def _measure(self) -> MeasureType: + async def _measure(self) -> dict: """Do measurement, filling _measured dictionary. Returns dictionary with keys channel names, values numbers or arrays. diff --git a/yaqd-core/yaqd_core/_is_sensor.py b/yaqd-core/yaqd_core/_is_sensor.py index 4d12044..1e050f9 100644 --- a/yaqd-core/yaqd_core/_is_sensor.py +++ b/yaqd-core/yaqd_core/_is_sensor.py @@ -5,28 +5,17 @@ import asyncio import pathlib -from typing import Any, TYPE_CHECKING +from typing import Any import yaqd_core -if TYPE_CHECKING: - try: - from typing import TypeAlias - - MeasureType: TypeAlias = dict[str, float] - except ImportError: # python <=3.8 - from typing import Dict - - MeasureType = Dict[str, float] - - class IsSensor(yaqd_core.IsDaemon): def __init__( self, name: str, config: dict[str, Any], config_filepath: pathlib.Path ): super().__init__(name, config, config_filepath) - self._measured: MeasureType = dict() # values must be numbers or arrays + self._measured: dict = dict() # values must be numbers or arrays self._channel_names: list[str] = [] self._channel_units: dict[str, str] = dict() self._channel_shapes: dict[str, tuple[int, ...]] = dict() @@ -48,7 +37,7 @@ def get_channel_units(self): """Get channel units.""" return self._channel_units - def get_measured(self) -> MeasureType: + def get_measured(self) -> dict: assert "measurement_id" in self._measured return self._measured From 1cebbbc8c518a739f0726747ebfbeb2c6603a4dd Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 11:53:18 -0600 Subject: [PATCH 17/30] Update CHANGELOG.md --- yaqd-core/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/yaqd-core/CHANGELOG.md b/yaqd-core/CHANGELOG.md index ea5dabb..5f8d640 100644 --- a/yaqd-core/CHANGELOG.md +++ b/yaqd-core/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ## [Unreleased] +### Fixed +- type hints for IsSensor attributes are appropriate for _n_-dimensional data + ## [2023.11.0] ### Fixed From 4304b6fe446be9004ebb37611f3257e52534c287 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 13:19:40 -0600 Subject: [PATCH 18/30] remove redundant actions --- .github/workflows/python-pytest.yml | 5 +++-- .github/workflows/run-entry-points.yml | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index e4d7945..fbd782b 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -1,9 +1,10 @@ name: pytest on: - push: pull_request: - + types: [opened, reopened] + push: + jobs: build: diff --git a/.github/workflows/run-entry-points.yml b/.github/workflows/run-entry-points.yml index f25ba88..b1bb23c 100644 --- a/.github/workflows/run-entry-points.yml +++ b/.github/workflows/run-entry-points.yml @@ -1,8 +1,9 @@ name: run entry points on: - push: pull_request: + types: [opened, reopened] + push: jobs: build: From 864ea88dfd19cd7fdb507bace693b26becbd6432 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 13:19:50 -0600 Subject: [PATCH 19/30] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0795ef9..04a55c5 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Repository for yaq core python packages: Each of these projects is distributed as a separate package. -These core packages are kept in one repository primarily such that, when needed, changes can be made simulatiously to multiple packages whithout breaking tests. +These core packages are kept in one repository primarily such that, when needed, changes can be made simultaneously to multiple packages without breaking tests. Repository maintainers: - [Kyle Sunden](https://github.com/ksunden) From c5c0dd888ac895a8b252db39b72b14207d9064ed Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 13:21:44 -0600 Subject: [PATCH 20/30] expand test py versions --- .github/workflows/python-pytest.yml | 2 +- .github/workflows/run-entry-points.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index fbd782b..23b182e 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/run-entry-points.yml b/.github/workflows/run-entry-points.yml index b1bb23c..2ef96e8 100644 --- a/.github/workflows/run-entry-points.yml +++ b/.github/workflows/run-entry-points.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} From 686e2a9654e8ab96bb1bb28490a848197437e7dc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 17 Feb 2025 19:33:34 +0000 Subject: [PATCH 21/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/python-pytest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index 23b182e..8c58a1f 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -3,8 +3,8 @@ name: pytest on: pull_request: types: [opened, reopened] - push: - + push: + jobs: build: From 318942ce26ed56e2ed0ee67611a669f12a8fee0c Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 17 Feb 2025 13:33:43 -0600 Subject: [PATCH 22/30] Update pyproject.toml --- yaqd-core/pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/yaqd-core/pyproject.toml b/yaqd-core/pyproject.toml index 4d2fac2..9b6f3cb 100644 --- a/yaqd-core/pyproject.toml +++ b/yaqd-core/pyproject.toml @@ -20,6 +20,7 @@ classifiers=[ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering", ] @@ -37,7 +38,7 @@ path = "yaqd_core/__version__.py" [tool.black] line-length = 99 -target-version = ['py37', 'py38'] +target-version = ['py311', "py312"] include = '\.pyi?$' exclude = ''' /( From 94d1f57b68c508e5d3d936020615acd14ffbacc6 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Sun, 19 Oct 2025 10:28:49 -0500 Subject: [PATCH 23/30] initiate tests again --- yaqd-core/yaqd_core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/__init__.py b/yaqd-core/yaqd_core/__init__.py index 4d6729f..4397d34 100644 --- a/yaqd-core/yaqd_core/__init__.py +++ b/yaqd-core/yaqd_core/__init__.py @@ -1,6 +1,6 @@ """Core python package for implementing yaq deamons, and associated utilities.""" -from . import logging +from . import logging from .__version__ import __version__ from ._is_daemon import * From 66f12fca0a4e98262e0b8d83e880daaecdd75952 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 19 Oct 2025 15:30:59 +0000 Subject: [PATCH 24/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/__init__.py b/yaqd-core/yaqd_core/__init__.py index 4397d34..4d6729f 100644 --- a/yaqd-core/yaqd_core/__init__.py +++ b/yaqd-core/yaqd_core/__init__.py @@ -1,6 +1,6 @@ """Core python package for implementing yaq deamons, and associated utilities.""" -from . import logging +from . import logging from .__version__ import __version__ from ._is_daemon import * From 58e5f408106ae3419780aaa4bd644f510f9f18c8 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 00:51:03 -0500 Subject: [PATCH 25/30] try python 3.13 curious if the freze issue still persists --- .github/workflows/python-pytest.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-pytest.yml b/.github/workflows/python-pytest.yml index 8c58a1f..7cc9631 100644 --- a/.github/workflows/python-pytest.yml +++ b/.github/workflows/python-pytest.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] os: [ubuntu-latest, windows-latest] runs-on: ${{ matrix.os }} From 473bfa0ad6b12b24a4db56701c4f549af4c1d17a Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:47:01 -0500 Subject: [PATCH 26/30] Update _is_daemon.py --- yaqd-core/yaqd_core/_is_daemon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index c6f03e1..b1c46a9 100755 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -87,7 +87,7 @@ def __init__( self._busy_sig = asyncio.Event() self._not_busy_sig = asyncio.Event() - self._loop = asyncio.get_event_loop() + self._loop = asyncio.get_running_loop() try: self._state_filepath.parent.mkdir(parents=True, exist_ok=True) @@ -298,6 +298,9 @@ async def shutdown_all(cls, sig, loop): # are not themselves cancelled. [d.close() for d in cls._daemons] tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] + for task in tasks: + if "process" in task.get_coro().__repr__(): + tasks.pop(tasks.index(task)) await asyncio.gather(*tasks, return_exceptions=True) [d._save_state() for d in cls._daemons] if hasattr(signal, "SIGHUP") and sig == signal.SIGHUP: From 01e7e317b0e4d620adde166ecf7b5810037508c0 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 10:54:07 -0500 Subject: [PATCH 27/30] Update _is_daemon.py --- yaqd-core/yaqd_core/_is_daemon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index b1c46a9..3a85920 100755 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -299,7 +299,7 @@ async def shutdown_all(cls, sig, loop): [d.close() for d in cls._daemons] tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] for task in tasks: - if "process" in task.get_coro().__repr__(): + if "serve_forever" in task.get_coro().__repr__(): tasks.pop(tasks.index(task)) await asyncio.gather(*tasks, return_exceptions=True) [d._save_state() for d in cls._daemons] From 20741082480a8f0370f53030bf4fa00b2bba6a53 Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 12:28:57 -0500 Subject: [PATCH 28/30] Update _is_daemon.py --- yaqd-core/yaqd_core/_is_daemon.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index 3a85920..57aa83c 100755 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -297,10 +297,15 @@ async def shutdown_all(cls, sig, loop): # This is done after cancelling so that shutdown tasks which require the loop # are not themselves cancelled. [d.close() for d in cls._daemons] - tasks = [t for t in asyncio.all_tasks() if t is not asyncio.current_task()] + tasks = [ + t for t in asyncio.all_tasks() + if ( + t is not asyncio.current_task() + and "serve_forever" not in t.get_coro().__repr__() + ) + ] for task in tasks: - if "serve_forever" in task.get_coro().__repr__(): - tasks.pop(tasks.index(task)) + logger.info(task.get_coro()) await asyncio.gather(*tasks, return_exceptions=True) [d._save_state() for d in cls._daemons] if hasattr(signal, "SIGHUP") and sig == signal.SIGHUP: From 6374e576f826469d444c8269f84aa62fa05c65ec Mon Sep 17 00:00:00 2001 From: Daniel Kohler <11864045+ddkohler@users.noreply.github.com> Date: Mon, 20 Oct 2025 14:40:49 -0500 Subject: [PATCH 29/30] Update pyproject.toml --- yaqd-core/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yaqd-core/pyproject.toml b/yaqd-core/pyproject.toml index 9b6f3cb..8bdd546 100644 --- a/yaqd-core/pyproject.toml +++ b/yaqd-core/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "yaqd-core" -author = [{name="yaq developers"}] +authors = [{name="yaq developers"}] requires-python = ">=3.7" dependencies = ["platformdirs", "tomli", "tomli-w", "fastavro>=1.4.0"] readme="README.md" From 9e491818d5d6351b0aee7fd1f61aadfa6c3c1b7f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 20 Oct 2025 20:30:11 +0000 Subject: [PATCH 30/30] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- yaqd-core/yaqd_core/_is_daemon.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yaqd-core/yaqd_core/_is_daemon.py b/yaqd-core/yaqd_core/_is_daemon.py index 57aa83c..c2940fe 100755 --- a/yaqd-core/yaqd_core/_is_daemon.py +++ b/yaqd-core/yaqd_core/_is_daemon.py @@ -298,9 +298,10 @@ async def shutdown_all(cls, sig, loop): # are not themselves cancelled. [d.close() for d in cls._daemons] tasks = [ - t for t in asyncio.all_tasks() + t + for t in asyncio.all_tasks() if ( - t is not asyncio.current_task() + t is not asyncio.current_task() and "serve_forever" not in t.get_coro().__repr__() ) ]