Changelog
Version 2.2.0
The client connection handling has been substantially rewritten. This should eliminate some race conditions, but may also cause changes in behaviour in corner cases, such as the exact circumstances in which callbacks are made and the order in which they occur.
Change
Client.wait_connected()so that it will raise an exception if the client is closed (withClient.close()), rather than blocking forever.Improve handling of back-pressure in
DeviceServer. Previously, oncemax_pendingrequests were active, each connection would continue reading the next request and only block when trying to start it. Now, whenmax_pendingis reached, all connections immediately stop reading.Stop debug logging incoming informs twice.
Add a Developer Manual to the documentation.
Fix a race condition in
SensorWatcherthat could cause an infinite loop.Speed up decoding of
bytesarguments.
Version 2.1.0
Add
AbstractSensorWatcher.filter()to allow only a subset of sensors to be watched.Fix calculation of the randomised exponent backoff for connection attempts.
Update CI to use Ubuntu 24.04.
Version 2.0.2
Support async-timeout 5.0 (and remove support for pre-1.3 versions).
Version 2.0.1
Disconnect a client if it is not able to keep up with
#sensor-statusinforms. Previously this was only checked when broadcasting an inform to all clients, such as#interface-changed.Avoid disconnecting a client with a large backlog during handling of
?sensor-samplingrequests, as this can trigger a large burst of#sensor-statusinforms.Fix unit tests for Python 3.13.
Version 2.0.0
Breaking changes:
When setting the value of a sensor, it is coerced to an instance of the sensor type (see Sensor value coercion). Reading back the sensor value will give this coerced object instead of the original. This only applies if the value was not already of the expected type.
Setting a sensor value to an object of an unsupported type will now raise
TypeError. Previously it was silently accepted, and clients querying the sensor would either get a value of the wrong type, or the query would fail.The
Addressconstructor now raisesTypeErrorif the first argument is not an IP address object.
Other changes:
Use
typing.get_args()instead of an undocumented API.
Version 1.10.0
Use katcp-codec to provide the low-level encoding and decoding of katcp messages, yielding a significant speedup.
Version 1.10.0b1
Use katcp-codec to provide the low-level encoding and decoding of katcp messages, yielding a significant speedup.
Version 1.9.0
Drop support for end-of-life Python 3.7.
Significantly speed up argument decoding for request handlers. Note that any code that calls
register_type()will need to be updated.Add
Client.sensor_reading()andClient.sensor_value()helper methods.Update dependency versions in Github Actions.
Version 1.8.0
Make
Readinga dataclass.Fix server shutdown on Python 3.12.
Update versions of dependencies used in CI.
Remove wheel from
build-system.requires.Make the unit tests pass on Python 3.11.5.
Make the
adjtimexmodule available on non-Linux systems with a stub implementation. It raisesNotImplementedErrorwhen callingget_adjtimex(), andTimeSyncUpdaterwill set the sensors toINACTIVE.
Version 1.7.0
Extend
SensorWatcherto allow incoming sensors to be replicated under multiple names.Log exception traceback when a service task crashes.
Version 1.6.2
Make things work on MacOS again.
CI: Update certifi to a newer version.
Add a type annotation to prevent an internal error in old versions of mypy.
Version 1.6.1
Workaround to prevent old versions of mypy (0.780) from throwing an internal error.
Version 1.6.0
Add
DeviceStatusenum for discrete device-status sensors.Add
TimeSyncUpdaterto assist in writing sensors that monitor time synchronisation.
Version 1.5.1
Make PEP 604 union syntax work in handler annotations.
Speed up message parsing, particularly for messages with thousands of arguments.
Version 1.5.0
Add
SimpleAggregateSensorclass to simplify common use cases for aggregate sensors.Improve error reporting when requests are made with too few arguments, particularly when the handler is wrapped in a decorator.
Allow handler arguments to be annotated as
Optional[T]. It’s not possible to provide aNonevalue on the wire, but this allows the default value to beNonewhile complying with mypy’s strict mode.Update katcpcmd and the examples to use
asyncio.run()instead of manually running the event loop. This eliminates some deprecation warnings.Update pre-commit hook to point to flake8’s new Github URL.
Test on Python 3.11.
Version 1.4.0
Replace
Nonewith''for a default sensor description. If no description is given, the?sensor-listrequest would fail. This is now fixed.Add
AggregateSensorfunctionality, an abstract class of sensors which depend on the readings of others for their values.
Version 1.3.1
Fix a resource leak that prevented full cleanup of client state on the server after the client disconnected (although the garbage collector would have cleaned it up eventually).
Version 1.3.0
Use bulk sensor sampling in
SensorWatcherwhen available.
Version 1.2.0
Add support for Service tasks.
Version 1.1.0
Increment server protocol version to 5.1.
Implement bulk sensor sampling feature of katcp 5.1.
Bump minimum Python version to 3.7, and run test suite against 3.10.
Change type annotation of
Server.serverfromasyncio.AbstractServerto the more specificasyncio.Server.Add
Server.socketsto simplify querying the sockets of a server.Lots of internal code modernisation (f-strings, PEP 526 type annotations, isort, and so on).
Version 1.0.0
Drop support for Python 3.5, and test on versions up to 3.9.
Remove explicit
looparguments.Fix a race condition that could cause lost connections to be logged twice.
Switch testing from nosetests to pytest.
Switch CI from Travis CI to Github Actions.
Use a
pyproject.tomlto specify build-time dependencies.Upgrade Sphinx used for readthedocs to the latest version.
Version 0.8.0
Add
SensorSet.add_add_callback(),SensorSet.remove_add_callback()andSensorSet.remove_remove_callback().
Version 0.7.0
Add auto_strategy parameter to
Sensorconstructor.Disconnect clients that aren’t keeping up with their asynchronous informs.
Version 0.6.1
Fix the type annotations to allow
Client.add_sensor_watcher()to take aAbstractSensorWatcherinstead of aSensorWatcher.Always call sensor watchers in the order they were added.
Version 0.6.0
Add
Server.on_stop().
Version 0.5.0
Make
SensorSetmore generic and move intoaiokatcp.sensorpackage. It no longer takes a list of connections; instead, one may register callbacks to get notification of removals. Note that the constructor interface has changed in a non-compatible way.Add
Client.add_inform_callback()andClient.remove_inform_callback().Add support for Watching sensors.
Version 0.4.4
Support Python 3.7
Version 0.4.3
Fix endless loop of “socket.send() raised except” when client disconnects
Version 0.4.2
Make
Clientwork with servers that don’t support message IDs
Version 0.4.1
Make async-timeout a requirement so that katcpcmd works
Make
SensorSeta subclass ofMappingfor better type checking
Version 0.4.0
Change type system to support abstract types
Suppress logged exception when client connection is reset
Version 0.3.2
Fixes some annotations to work with the latest mypy; no functional changes
Version 0.3.1
Add peer addresses to various log messages
Version 0.3
Add status_func parameter to
Sensorconstructor.
Version 0.2
Add client support
Correctly handle carriage returns (\r)
Bound the number of in-flight requests
Change the exact error message when a sensor does not exist, for better compatibility with
katcp.inspecting_client.
Version 0.1
First release