Skip to content

Add timer infrastructure#254

Merged
bmr-cymru merged 17 commits intomainfrom
bmr-timer-infra
May 27, 2025
Merged

Add timer infrastructure#254
bmr-cymru merged 17 commits intomainfrom
bmr-timer-infra

Conversation

@bmr-cymru
Copy link
Copy Markdown
Contributor

@bmr-cymru bmr-cymru commented Apr 20, 2025

Resolves: #129
Resolves: #249
Resolves: #250
Resolves: #251
Resolves: #252
Resolves: #253
Resolves: #254
Resolves: #265
Resolves: #266
Resolves: #268
Resolves: #268
Resolves: #270
Resolves: #271
Resolves: #272
Resolves: #273
Resolves: #274

@bmr-cymru bmr-cymru added Enhancement New feature or request InterOp Interoperation and integration with other projects labels Apr 20, 2025
@bmr-cymru bmr-cymru self-assigned this Apr 20, 2025
@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo yum install -y dnf-plugins-core on RHEL 8
  • sudo dnf install -y dnf-plugins-core on Fedora
  • dnf copr enable packit/snapshotmanager-snapm-254
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@bmr-cymru bmr-cymru force-pushed the bmr-timer-infra branch 4 times, most recently from 29ae711 to 28230be Compare April 21, 2025 16:34
@bmr-cymru bmr-cymru moved this to In Progress in Snapshot scheduling Apr 22, 2025
@bmr-cymru bmr-cymru force-pushed the bmr-timer-infra branch 7 times, most recently from 4353096 to 3b1f55f Compare May 20, 2025 19:22
Not setting a valid 'On*' option to define a timer trigger condition
leads to unwanted behaviour when attempting to operate on non-existent
timer unit instances:

  # systemctl status snapm-gc@foobar.timer
  ○ snapm-gc@foobar.timer - Scheduled foobar snapshot set cleanup
       Loaded: bad-setting (Reason: Unit snapm-gc@foobar.timer has a bad unit file setting.)
       Active: inactive (dead)
      Trigger: n/a
     Triggers: ● snapm-gc@foobar.service

  May 21 13:12:13 localhost.localdomain systemd[1]: snapm-gc@foobar.timer: Timer unit lacks value setting. Refusing.

This is somewhat misleading: snamp-gc@foobar.timer *does not exist*:
there is no instance symlink of that name but systemd noticies that the
template lacks a defined On* value and complains.

This may be confusing to users or trigger alerts based on error logs:
define a dumby "daily" value in the base template unit that is overriden
on a per-instance basis via drop-in files.

With this change the errors are no longer triggered, and the systemctl
status output looks like:

  # systemctl status snapm-create@bazquux.timer || echo $?
  ○ snapm-create@bazquux.timer - Scheduled bazquux snapshot set creation
       Loaded: loaded (/usr/lib/systemd/system/snapm-create@.timer; disabled; preset: disabled)
       Active: inactive (dead)
      Trigger: n/a
     Triggers: ● snapm-create@bazquux.service
  3

  (exit status 3 means "unit is not active")

It would be ideal if systemd simply recognised the instance as
non-existent and responded like it would for any other non-existent unit
definition:

  # systemctl status bazquux.timer || echo $?
  Unit bazquux.timer could not be found.
  4

  (exit status 4 means "no such unit - systemctl(1))

Some similar issues have been raised in the past but are still open as
of today:

  systemd/systemd#25708
  systemd/systemd#25680
bmr-cymru added 2 commits May 22, 2025 13:32
Add simple infrastructure for building and running a podman container to
execute systemd integration tests in an isolated environment.

A Containerfile is used to build a Fedora container with a systemd
service, container-tests.service to execute pytest.

A Makefile provides targets to manipulate and interact with the container:

  - prep
  - build
  - run
  - install
  - test
  - clean
  - shell

Resolves: #265
The container_tests/tests should only be included when running in the
systemd container: set the search path for the regular snapm.yaml
workflow to only include tests/

Resolves: #266
@bmr-cymru bmr-cymru force-pushed the bmr-timer-infra branch 2 times, most recently from 3f1c03c to 386e6c7 Compare May 26, 2025 20:06
bmr-cymru added 2 commits May 27, 2025 03:32
Mark un-testable branches in the timers module.

Related: #252
bmr-cymru added a commit that referenced this pull request Jun 6, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 7, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 7, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 7, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 7, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 8, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 8, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 9, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 9, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 9, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 10, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 13, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 14, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 15, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 15, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 15, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 15, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 16, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 16, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 16, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 18, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 19, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 19, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 19, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 19, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 20, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 20, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 20, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 29, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
bmr-cymru added a commit that referenced this pull request Jun 30, 2025
The `Timer.__init__` method uses `x | y` union notation for the
calendarspec argument (which can be a string or a `CalendarSpec`
instance):

    class Timer:
        """
        High-level interface for managing schedling timers.
        """

        def __init__(
            self, timer_type: TimerType, name: str, calendarspec: str | CalendarSpec
        ):
            """
            Initialise a new ``Timer`` object from the provided arguments.

            :param type: A ``TimerType`` enum value representing the type of timer
                         to create.
            :param name: The name of the timer. The value is used as the instance
                         part of the timer unit name.
            :param calendarspec: A valid calendarspec string, or an instance of the
                                 ``CalendarSpec`` class representing the trigger
                                 condition for the timer.
            """

This causes the test suite to fail on epel-9/centos-stream-9 since the
shorthand union notation was introduced in py3.10:

https://docs.python.org/3/library/typing.html#special-forms

Switch to using the conventional notation using `typing.Union`:

    def __init__(
        self, timer_type: TimerType, name: str, calendarspec: Union[str, CalendarSpec]
    ):

This is compatible with all supported Python versions. The problem was
not picked up at the time fcae54d / #254 was merged since nothing at
the time actually imported the timers module. This became apparent with
commit 0246fd5 which imports the `Schedule` interface (which in turn
imports `Timer`).

Fixes: fcae54d
Resolves: #311
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment