Skip to content

Releases: pywinrt/pywinrt

v2.2.0

20 Aug 15:02
Compare
Choose a tag to compare

Added

  • Added __repr__ implementation for projected struct types.
  • Added --component-dlls option to PyWinRT.exe for user component packages.
  • Added winrt.windows.system.interop package.
  • Added winrt.windows.ui.composition.interop package.
  • Added support for Python 3.13.
  • Added extra operators and methods for winrt.windows.numerics types.

Changed

  • General performance improvements.

Fixed

  • Fixed spelling of initialize in __all__ in Windows App bootstrap package.

v2.1.0

23 Jun 22:48
Compare
Choose a tag to compare

Added

  • Added winrt.Microsoft.Windows.ApplicationModel.DynamicDepedency.Bootstrap
    interop package.
  • Added _iids_ and _runtime_class_name_ properties to system.Object.
  • Added __eq__ and __ne__ methods to projected structs.
  • Added projection of inherited members of composed classes.

Changed

  • PyWinRT.exe is now a dotnet tool.
  • Static events are moved to the metaclass.

Fixed

  • Fixed possible crash when checking if API is available at runtime.
  • Fixed memory leak when converting Python object to char16_t or hstring.
  • Fixed importing modules containing delegates with parameters that reference
    other modules.
  • Fixed TypeError when trying to pass composed runtime object to API that
    requires subclass (#25).
  • Fixed TypeError when passing None to APIs that require a system.Object.
  • Fixed ui.xaml.Application.start() methods not releasing GIL.
  • Fixed some type hints not working when not all dependent packages installed.
  • Fixed type hints should not have _from() method in projected static classes.
  • Fixed type hints for methods that return an array.
  • Fixed handling of bool, char, string and IReference types in projected structs.

v2.0.1

28 Apr 20:21
Compare
Choose a tag to compare

Fixed

  • Fixed modules with protected methods/properties failing to compile.

v2.0.0

28 Apr 02:02
Compare
Choose a tag to compare

NOTE: No PyPI packages for this version were published due to some packages failing to compile. Use v2.0.1 instead.

Added

  • Added py.typed to each subpackage.
  • Added winrt.windows.foundation.interop module with box and unbox methods.

Changed

  • Regenerated files for Windows 11 SDK 10.0.22621.0 February 2024 update.
  • Updated to Windows App SDK 1.5.240311000
  • Updated to CppWinRT 2.0.240111.5

Fixed

  • Fixed implicitly converting None to System.Object.
  • Fixed KeyError when accessing accessing values of mappings that return None.
  • Fixed building from source package with non-MSVC compiler (#44).
  • Fixed module load failing on systems without msvcp140.dll (#43).
  • Fixed installing from source in MSYS2 CLANG64 (#47).
  • Fixed installing from source in MSYS2 MINGW64 (#46).
  • Fixed crash when winrt.system.Array() called with no arguments.

v2.0.0-beta.2

30 Nov 02:19
Compare
Choose a tag to compare

Added

  • Added @final decorator to runtime class type hints.
  • Added support for Windows App SDK (Microsoft.Windows namespace).

Fixed

  • Fixed missing __iter__ type hint on sequences.
  • Fixed index type on sequences index operators.
  • Fixed py.typed and _winrt.pyi missing from winrt-runtime package.

v2.0.0-beta.1

31 Aug 16:43
Compare
Choose a tag to compare

Migration guide

Going forward, there are now individual packages for the various WinRT namespaces instead of the monolithic winsdk package. To migrate you code to these packages, you need to do two things:

  1. Change winsdk. to winrt. in your imports.
  2. Change your dependencies to include each required namespace, e.g. winrt-Windows.Foundation.
  3. If you were calling an static methods as instance methods, you will need to change them to be called as class methods.

Note, you can add the all extra to recursively include add dependencies of a namespace package, e.g.winrt-Windows.Foundation[all]. However, this is only provided as a convenience and may pull in many, many dependencies that you don't actually need!

Changelog

Added

  • Added -reference option to pywinrt.exe.
  • Added -header-path option to pywinrt.exe.
  • Added __all__ in generated Python modules.

Changed

  • Changed code generator to generate module per namespace instead of monolith.
  • Moved delegate type aliases from .pyi to .py files.
  • Changed type hints for non-static properties to use @property.
  • Moved static methods to metaclass.

Fixed

  • Fixed mixin of __eq__ for mappings.
  • Fixed parsing structs with guid field.
  • Fixed single byte struct field arg format.
  • Fixed importing enum when not needed.
  • Fixed compiler warning about converting Py_ssize_t in ComArray.
  • Fixed NotImplementedError for delegates with array_view.
  • Fixed possible crash due to not checking return value of convert() in some places.
  • Fixed memory leak in wrapped struct types.
  • Fixed generating delegates with out parameters are return arrays.
  • Fixed setters of static properties.
  • Fixed subpackage names that are Python keywords.

Removed

  • Removed generation of base/core files.
  • Removed -module option from pywinrt.exe.
  • Removed winrt.system.Guid type alias.
  • Removed winrt.system.Boolean type alias.
  • Removed support for Python 3.8.

v1.0.0-beta.10

11 Aug 16:41
Compare
Choose a tag to compare

Added

  • Added positional-only parameters indication to type hints.

Changed

  • Changed how collections.abc protocols are implemented.
  • Changed type hints for buffer protocol to align with PEP 688.

Fixed

  • Fixed structs should not inherit from _winrt.Object.

Removed

  • Removed support for Python 3.7.

v1.0.0-beta.9

15 Apr 22:29
Compare
Choose a tag to compare

Fixed

  • Fixed compiling generated code with clang and gcc.

v1.0.0-beta.8

02 Apr 22:54
Compare
Choose a tag to compare

Added

  • Added new Array type for wrapping COM arrays.
  • Added support for conversion to/from char16_t/str.
  • Added support for slicing IVectorView.

Changed

  • Provide useful error message when NotImplementedError is raised.
  • Use PyType_FromModuleAndSpec in Python >= 3.9.
  • datetime conversion now uses Windows API instead Python APIs with float.
  • Array input arguments must now implement Python buffer protocol (no longer
    accepts list/sequence).
  • Moved top-level package __init__.py to system subpackage.
  • Moved fundamental type aliases to system package and made runtime types.
  • Array output parameters now return system.Array instead of list.
  • Fill arrays now take a buffer as the argument and fill that buffer instead
    of taking a size as the argument and returning a new array.
  • Use typing.ClassVar annotation for static properties.
  • Static properties are now class attributes instead of static methods.

Fixed

  • Fixed checking wrong number of input parameters on methods with array parameters.
  • Fixed use after free of array input arguments (winsdk#20).
  • Fixed missing __await__ on runtime types that inherit IAsyncOperation (winsdk#21).
  • Fixed compile error in generated code for delegates that return non-void.

v1.0.0-beta.7

09 Sep 22:06
Compare
Choose a tag to compare

Changed

  • Attempting to delete attributes now returns AttributeError instead of TypeError.

Fixed

  • Fixed crash when accessing new APIs on older versions of Windows (winsdk#13).