pywinrt / python-winsdk

Python package with bindings for Windows SDK
https://python-winsdk.readthedocs.io
MIT License
74 stars 8 forks source link

split namespaces into packages #1

Closed dlech closed 1 year ago

dlech commented 2 years ago

It could be nice if we were able to create a separate Python package for each WinRT namespace, similar to how PyObjC works. This way apps could only include the packages they use instead of one big monolithic package. Although there could still be a meta "install everything" package too.

Safihre commented 1 year ago

@dlech Is there currently a way to make a "lighter" version of the package? I would like to add Windows 10/11 style toast notifications to our application (SABnzbd), but adding winsdk would double our application's file size. Thanks so much!

dlech commented 1 year ago

You can create your own package with only the namespaces you need like https://github.com/dlech/bleak-winrt.

Safihre commented 1 year ago

Thanks a lot, that's encouraging! Do I understand correctly that I just have to modify these 2 lines? That's it? And then run the Github actions workflow. https://github.com/dlech/bleak-winrt/blob/a6c1f3fd073a7b5678304ea6bc08b9b067544320/generate.ps1#L23

dlech commented 1 year ago

Do I understand correctly that I just have to modify these 2 lines?

Yes, that is where you need to select the required WinRT namespaces.

That's it?

You will also need to change the package name (any instance of bleak_winrt or bleak-winrt), for example at https://github.com/dlech/bleak-winrt/blob/a6c1f3fd073a7b5678304ea6bc08b9b067544320/generate.ps1#L34C26-L34C27 and in other files too.

Safihre commented 1 year ago

Thank you 👍

dlech commented 1 year ago

Individual per-winrt-namespace packages have been published on PyPI now. Please refer to https://github.com/pywinrt/pywinrt for the source of those packages.