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
8 changes: 4 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

- run: mk docs
if: |
matrix.python-version == '3.12'
matrix.python-version == '3.13'
&& matrix.system == 'ubuntu-latest'

- run: mk python-test
Expand All @@ -71,16 +71,16 @@ jobs:
env:
TWINE_USERNAME: __token__
if: |
matrix.python-version == '3.12'
matrix.python-version == '3.13'
&& matrix.system == 'ubuntu-latest'
&& env.TWINE_PASSWORD != ''
&& github.ref_name == 'master'

- run: |
mk python-release owner=libre-embedded \
repo=runtimepy version=5.15.8
repo=runtimepy version=5.15.9
if: |
matrix.python-version == '3.12'
matrix.python-version == '3.13'
&& matrix.system == 'ubuntu-latest'
&& env.GITHUB_API_TOKEN != ''
&& github.ref_name == 'master'
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ max-public-methods=22
max-branches=13

[MESSAGES CONTROL]
disable=too-few-public-methods,duplicate-code
disable=too-few-public-methods,duplicate-code,invalid-name

[FORMAT]
good-names=id,x,y,tx,rx
37 changes: 18 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
=====================================
generator=datazen
version=3.2.3
hash=c354cb6439439285d244ad2bdcc32cc8
hash=05cf908a25a85c1f6c9a0c48ec9e6ca8
=====================================
-->

# runtimepy ([5.15.8](https://pypi.org/project/runtimepy/))
# runtimepy ([5.15.9](https://pypi.org/project/runtimepy/))

[![python](https://img.shields.io/pypi/pyversions/runtimepy.svg)](https://pypi.org/project/runtimepy/)
![Build Status](https://github.com/libre-embedded/runtimepy/workflows/Python%20Package/badge.svg)
Expand Down Expand Up @@ -40,7 +40,7 @@ This package is tested on the following platforms:
# Command-line Options

```
$ ./venv3.12/bin/runtimepy -h
$ ./venv3.13/bin/runtimepy -h

usage: runtimepy [-h] [--version] [-v] [-q] [--curses] [--no-uvloop] [-C DIR]
{arbiter,mtu,server,task,tftp,tui,noop} ...
Expand All @@ -54,7 +54,7 @@ options:
-q, --quiet set to reduce output
--curses whether or not to use curses.wrapper when starting
--no-uvloop whether or not to disable uvloop as event loop driver
-C DIR, --dir DIR execute from a specific directory
-C, --dir DIR execute from a specific directory

commands:
{arbiter,mtu,server,task,tftp,tui,noop}
Expand All @@ -74,7 +74,7 @@ commands:
### `arbiter`

```
$ ./venv3.12/bin/runtimepy arbiter -h
$ ./venv3.13/bin/runtimepy arbiter -h

usage: runtimepy arbiter [-h] [-i] [-w] [--no-poller] configs [configs ...]

Expand All @@ -95,7 +95,7 @@ options:
### `mtu`

```
$ ./venv3.12/bin/runtimepy mtu -h
$ ./venv3.13/bin/runtimepy mtu -h

usage: runtimepy mtu [-h] [--probe-size PROBE_SIZE] [--fallback FALLBACK] [-t]
destination [destination ...]
Expand All @@ -116,7 +116,7 @@ options:
### `server`

```
$ ./venv3.12/bin/runtimepy server -h
$ ./venv3.13/bin/runtimepy server -h

usage: runtimepy server [-h] [-i] [-w] [--no-poller] [--cafile CAFILE]
[--capath CAPATH] [--cadata CADATA]
Expand All @@ -142,7 +142,7 @@ options:
--certfile CERTFILE passed directly to instantiation
--keyfile KEYFILE passed directly to instantiation
--host HOST host address to listen on (default: '0.0.0.0')
-p PORT, --port PORT port to listen on (default: 0)
-p, --port PORT port to listen on (default: 0)
-u, --udp whether or not this is a UDP-based server (otherwise
it must be a TCP-based server)
-l, --loopback if true a client of the same connection type is added
Expand All @@ -152,7 +152,7 @@ options:
### `task`

```
$ ./venv3.12/bin/runtimepy task -h
$ ./venv3.13/bin/runtimepy task -h

usage: runtimepy task [-h] [-i] [-w] [--no-poller] [-r RATE]
factory [configs ...]
Expand All @@ -169,14 +169,14 @@ options:
ensure that a 'wait_for_stop' application method is
run last
--no-poller don't run a connection-metrics poller task
-r RATE, --rate RATE rate (in Hz) that the task should run (default: 10)
-r, --rate RATE rate (in Hz) that the task should run (default: 10)

```

### `tftp`

```
$ ./venv3.12/bin/runtimepy tftp -h
$ ./venv3.13/bin/runtimepy tftp -h

usage: runtimepy tftp [-h] [-p PORT] [-m MODE] [-t TIMEOUT] [-r REEMIT]
{read,write} host our_file [their_file]
Expand All @@ -189,28 +189,27 @@ positional arguments:

options:
-h, --help show this help message and exit
-p PORT, --port PORT port to message (default: 69)
-m MODE, --mode MODE tftp mode to use (default: octet)
-t TIMEOUT, --timeout TIMEOUT
-p, --port PORT port to message (default: 69)
-m, --mode MODE tftp mode to use (default: octet)
-t, --timeout TIMEOUT
timeout for each step
-r REEMIT, --reemit REEMIT
transmit period for each step
-r, --reemit REEMIT transmit period for each step

```

### `tui`

```
$ ./venv3.12/bin/runtimepy tui -h
$ ./venv3.13/bin/runtimepy tui -h

usage: runtimepy tui [-h] [-i ITERATIONS] [-r RATE]

options:
-h, --help show this help message and exit
-i ITERATIONS, --iterations ITERATIONS
-i, --iterations ITERATIONS
maximum number of program iterations (if greater than
zero, default: 0)
-r RATE, --rate RATE frequency (in Hz) to run the interface (default: 60.0
-r, --rate RATE frequency (in Hz) to run the interface (default: 60.0
Hz)

```
Expand Down
2 changes: 1 addition & 1 deletion local/variables/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
major: 5
minor: 15
patch: 8
patch: 9
entry: runtimepy
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta:__legacy__"

[project]
name = "runtimepy"
version = "5.15.8"
version = "5.15.9"
description = "A framework for implementing Python services."
readme = "README.md"
requires-python = ">=3.12"
Expand Down
4 changes: 2 additions & 2 deletions runtimepy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# =====================================
# generator=datazen
# version=3.2.3
# hash=be3f79364e840f1950bc121205810f02
# hash=d9d0de2bb0023948837d59c828acf9fb
# =====================================

"""
Expand All @@ -10,7 +10,7 @@

DESCRIPTION = "A framework for implementing Python services."
PKG_NAME = "runtimepy"
VERSION = "5.15.8"
VERSION = "5.15.9"

# runtimepy-specific content.
METRICS_NAME = "metrics"
Expand Down
2 changes: 2 additions & 0 deletions runtimepy/data/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ body > :first-child {

#runtimepy-tabs {
width: min-content;
max-width: 30vw;
overflow: hidden;
}

#runtimepy-splash {
Expand Down
6 changes: 5 additions & 1 deletion runtimepy/message/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,11 @@ async def process_json(
target = self.targets.evaluate(key)
if target:
assert target.data is not None
key, handler, kind = target.data
( # pylint: disable=unpacking-non-sequence
key,
handler,
kind,
) = target.data

# Use target resolution data (if any) as a base.
with_sub_data = copy(
Expand Down
9 changes: 6 additions & 3 deletions runtimepy/net/arbiter/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,10 @@ async def _init_connections(self) -> None:
self._register_connection(value, key)

# Ensure connections are all initialized.
await _asyncio.gather(
*(x.initialized.wait() for x in self._connections.values())
)
with self.log_time("Connection initialization", reminder=True):
await _asyncio.gather(
*(x.initialized.wait() for x in self._connections.values())
)

async def _build_structs(self, info: AppInfo) -> None:
"""Build structs."""
Expand Down Expand Up @@ -372,6 +373,8 @@ async def _entry(
info: Optional[AppInfo] = None

try:
self.stop_sig.clear()

async with _AsyncExitStack() as stack:
result, info = await self._main(
stack,
Expand Down
6 changes: 5 additions & 1 deletion runtimepy/net/arbiter/info.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,10 @@ class RuntimeStruct(RuntimeStructBase):
final_poll = False

def init_env(self) -> None:
"""Initialize this sample environment."""
"""Initialize this environment."""

async def async_init_env(self) -> None:
"""Initialize this environment."""

@contextmanager
def _final_poll(self) -> _Iterator[None]:
Expand Down Expand Up @@ -109,6 +112,7 @@ async def build(self, app: "AppInfo", **kwargs) -> None:
self.env.register_protocol(self.send, True)

self.init_env()
await self.async_init_env()
self.update_byte_order(byte_order, **kwargs)

def update_byte_order(self, byte_order: ByteOrder, **kwargs) -> None:
Expand Down
3 changes: 2 additions & 1 deletion runtimepy/net/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ class Connection(
byte_order: ByteOrder = DEFAULT_BYTE_ORDER

default_auto_restart = False
ignore_stop_sig = False

def __init__(
self,
Expand Down Expand Up @@ -300,7 +301,7 @@ async def process(
)

# Allow a stop signal to also disable the connection.
if stop_sig is not None:
if stop_sig is not None and not self.ignore_stop_sig:
self._tasks.append(_asyncio.create_task(self._wait_sig(stop_sig)))

self.exited.clear()
Expand Down
2 changes: 2 additions & 0 deletions tasks/default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ config:

Arbitrary configuration (testing).

<div style="width: 800px; background-color: red">test</div>

bottom_markdown: |
# Bottom Markdown

Expand Down
6 changes: 4 additions & 2 deletions tests/commands/test_arbiter.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
# internal
from tests.resources import base_args, resource

TIMEOUT = 120

@mark.timeout(60)

@mark.timeout(TIMEOUT)
def test_arbiter_command_basic():
"""Test basic usages of the 'arbiter' command."""

Expand All @@ -35,7 +37,7 @@ def test_arbiter_command_basic():
)


@mark.timeout(60)
@mark.timeout(TIMEOUT)
def test_arbiter_command_advanced():
"""Test advanced usages of the 'arbiter' command."""

Expand Down
Loading