What’s new?
The sections below will give you the most relevant news from the PyTango releases. For help moving to a new release, or for the complete list of changes, see the following links:
What’s new in PyTango 9.5.0?
Date: 2023-10-26 9.5.0rc1
Type: major release
Changed
PyTango requires at least cppTango 9.5.0. See the migration guide.
When using the asyncio green mode, a
PyTangoUserWarningwill be emitted during theinit_device()call, if the user’sDevicemethods are not coroutines (i.e., defined withasync def).Use
127.0.0.1as the default host for (Multi)DeviceTestContext instead of trying to find an external IP. This allows tests to work on systems that only have a loopback interface, and also reduces firewall warnings when running tests (at least on macOS). If using it from the command line like,python -m tango.test_context MyDS.MyDevice, an external IP is still the default.All warnings generated by PyTango are now instances of
PyTangoUserWarning, which inherits from Python’sUserWarning.Some of the dependencies packaged with the binary wheels on PyPI have changed. The bundled versions are:
Dependency |
Linux |
Windows |
MacOS |
|---|---|---|---|
cpptango |
9.5.0 |
9.5.0 |
9.5.0 |
omniorb / omniorb-libs |
4.3.1 |
4.3.0 |
4.3.1 |
libzmq / zeromq |
4.3.5 |
4.0.5-2 |
4.3.5 |
cppzmq |
4.10.0 |
4.7.1 |
4.10.0 |
libjpeg-turbo |
3.0.0 |
2.0.3 |
3.0.0 |
tango-idl |
5.1.1 |
5.1.2 |
5.1.2 |
boost |
1.82.0 |
1.83.0 |
1.82.0 |
Added
Short-name access can be used for (Multi)DeviceTestContext devices. See migration guide
Experimental feature: use Python type hints to declare Device more easily. Read more in the new section: Use Python type hints when declaring a device.
set_write_value()now supports IMAGE attributes.Forwarded attributes are partially supported in the (Multi)DeviceTestContext. We say partially, because a cppTango limitation (at least version 9.5.0) means root attributes on devices running in “nodb” mode (like those in launched by the TestContext) don’t work. However, it does work if the test device accesses a root attribute on a Tango device running with a Tango database.
Support for
EncodedAttributein high-level API devices.Added
free_itandclean_dbarguments totango.server.Device.remove_attribute()andtango.LatestDeviceImpl.remove_attribute()methods.Support Tango server debugging with PyCharm, PyDev and VS Code. Breakpoints now work for command and attribute handler methods, as well as other standard
Devicemethods, when running through a debugger that is based on pydevd. However, it doesn’t currently work with dynamic attributes and commands. If necessary, the feature can be disabled by setting the environment variablePYTANGO_DISABLE_DEBUG_TRACE_PATCHING=1.Added support for Python 3.12.
Fixed
Fixed various issues with
DeviceProxywith non-synchronous green mode devices launched withDeviceTestContextandMultiDeviceTestContext. This also fixes support for tests decorated with@pytest.mark.asyncio.
Removed
Breaking change to the API: the
DevIntdata type was removed, due to its removal from cppTango. See the migration guide.Deprecated signature,
get_write_value(self, lst)(), was removed.
What’s new in PyTango 9.4.2?
Date: 2023-07-27
Type: minor release
Changed
New python and NumPy version policy is implemented.
Added
Correct code coverage of server’s methods can be obtained
server_init_hook was added to high-level and low-level API
macOS wheels now are provided
Fixed
DevEncoded attributes and commands read methods are now segfault safe
DevEncoded attributes and commands now decoded with utf-8
DevEncoded attributes and commands can be extracted and written as str, bytes and bytesarray
If string encoding with Latin-1 fails, UnicodeError will be raised instead of segfaulting
When user gives empty spectrum properties to the DeviceTestContext, they will be patched with one space symbol “ “ for each element
In case patching failed or any other problems with FileDatabase, instead of crash PyTango will raise an exception and print out generated file
Regression when applying additional decorators on attribute accessor functions. Method calls would have the wrong signature and fail.
Removed
Support for Python < 3.9. See version policy
What’s new in PyTango 9.4.1?
Date: 2023-03-15
Type: major release (breaking changes compared to 9.4.0)
Changed
Removed additional function signatures for high-level attribute read/write/is_allowed methods that were added in 9.4.0 resulting in a regression. For example, the high-level write method API for dynamic attributes of the form
write_method(self, attr, value)has been removed, leaving onlywrite_method(self, attr). Similarly, unbound functions that could be used without a reference to the device object, likeread_function(), are no longer supported - onlyread_function(device). See the migration guide.- The dependencies packaged with the binary PyPI wheels are as follows:
- Linux:
cpptango: 9.4.1
omniorb: 4.2.5 (changed since PyTango 9.4.0)
libzmq: v4.3.4
cppzmq: v4.7.1
libjpeg-turbo: 2.0.9
tango-idl: 5.1.1
boost: 1.80.0 (with patch for Python 3.11 support)
- Windows:
cpptango: 9.4.1
omniorb: 4.2.5
libzmq: v4.0.5-2
cppzmq: v4.7.1
libjpeg-turbo: 2.0.3
tango-idl: 5.1.2
boost: 1.73.0
Fixed
Regression for undecorated read attribute accessor functions in derived device classes. E.g., if we have
class A(Device)with attribute reading via methodA.read_my_attribute, then readingmy_attributefromclass B(A)would fail. More generally, repeated wrapping of methods related to attributes, commands and standard methods (likeinit_device) is now avoided.Regression when applying additional decorators on attribute accessor functions. Method calls would have the wrong signature and fail.
What’s new in PyTango 9.4.0?
Date: 2023-02-15
Type: major release
Warning
significant regressions - use newer release!
Changed
PyTango requires at least cppTango 9.4.1. See the migration guide.
Breaking change to the API when using empty spectrum and image attributes. Clients reading an empty attribute will get an empty sequence (list/tuple/numpy array) instead of a
Nonevalue. Similarly, devices that have an empty sequence written will receive that in the write method instead of aNonevalue. See the migration guide on empty attributes and extract as.Python dependencies: numpy is no longer optional - it is required. Other new requirements are packaging and psutil.
Binary wheels for more platforms, including Linux, are available on PyPI. Fast installation without compiling and figuring out all the dependencies!
- The dependencies packaged with the binary PyPI wheels are as follows:
- Linux:
cpptango: 9.4.1
omniorb: 4.2.4
libzmq: v4.3.4
cppzmq: v4.7.1
libjpeg-turbo: 2.0.9
tango-idl: 5.1.1
boost: 1.80.0 (with patch for Python 3.11 support)
- Windows:
cpptango: 9.4.1
omniorb: 4.2.5
libzmq: v4.0.5-2
cppzmq: v4.7.1
libjpeg-turbo: 2.0.3
tango-idl: 5.1.2
boost: 1.73.0
When using the
--portcommandline option without--host, theORBendpointforgio::tcppassed to cppTango will use"0.0.0.0"as the host instead of an empty string. This is to workaround a regression with cppTango 9.4.1. Note that if the--ORBendPointcommandline option is specified directly, it will not be modified. This will lead to a crash if an empty host is used, e.g.,--ORBendPoint giop:tcp::1234.
Added
User methods for attribute access (read/write/is allowed), and for commands (execute/is allowed) can be plain functions. They don’t need to be methods on the device class anymore. There was some inconsistency with this previously, but now it is the same for static and dynamic attributes, and for commands. Static and dynamic commands can also take an
fisallowedkeyword argument. See the migration guide.Device methods for reading and writing dynamic attributes can use the high-level API instead of getting and setting values inside
Attrobjects. See the migration guide.High-level API support for accessing and creating DevEnum spectrum and image attributes. See the migration guide.
Developers can optionally allow Python attributes to be added to a
DeviceProxyinstance by callingunfreeze_dynamic_interface(). The default behaviour is still to raise an exception when accessing unknown attributes. See the migration guide.Attribute decorators have additional methods:
getter(),read()andis_allowed(). See the migration guide.Python 3.11 support.
MacOS support. This is easiest installing from Conda-forge. Compiling locally is not recommended. See Getting started.
Integrated development environment (IDE) autocompletion for methods inherited from
tango.server.Deviceandtango.LatestDeviceImpl. Attributes from the full class hierarchy are now more easily accessible directly in your editor.
Fixed
Log stream calls that include literal
%symbols but no args now work properly without raising an exception. E.g.,self.debug_stream("I want to log a %s symbol"). See the migration guide.Writing a
numpy.arrayto a spectrum attribute of typestrno longer crashes.Reading an enum attribute with
ATTR_INVALIDquality via the high-level API now returnsNoneinstead of crashing. This behaviour is consistent with the other data types.
Removed
Support for Python 2.7 and Python 3.5.
The option to install PyTango without numpy.