Releases: pywinrt/pywinrt
Releases · pywinrt/pywinrt
v2.2.0
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
Added
- Added
winrt.Microsoft.Windows.ApplicationModel.DynamicDepedency.Bootstrap
interop package. - Added
_iids_
and_runtime_class_name_
properties tosystem.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
orhstring
. - 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 passingNone
to APIs that require asystem.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
v2.0.0
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 withbox
andunbox
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
toSystem.Object
. - Fixed
KeyError
when accessing accessing values of mappings that returnNone
. - 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
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 fromwinrt-runtime
package.
v2.0.0-beta.1
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:
- Change
winsdk.
towinrt.
in your imports. - Change your dependencies to include each required namespace, e.g. winrt-Windows.Foundation.
- 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 topywinrt.exe
. - Added
-header-path
option topywinrt.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
inComArray
. - Fixed
NotImplementedError
for delegates witharray_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 frompywinrt.exe
. - Removed
winrt.system.Guid
type alias. - Removed
winrt.system.Boolean
type alias. - Removed support for Python 3.8.
v1.0.0-beta.10
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
Fixed
- Fixed compiling generated code with clang and gcc.
v1.0.0-beta.8
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
tosystem
subpackage. - Moved fundamental type aliases to
system
package and made runtime types. - Array output parameters now return
system.Array
instead oflist
. - 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
v1.0.0-beta.7
Changed
- Attempting to delete attributes now returns
AttributeError
instead ofTypeError
.
Fixed
- Fixed crash when accessing new APIs on older versions of Windows (winsdk#13).