Another possible option instead is to not invoke the add_signal_handler during local Windows development - which is what this PR is trying to do.
Example
1) Attempting to run development in Windows with loop.add_signal_handler
2) == to != for win32 check
3) Checking KeyboardInterrupt works
Other notes
We may also be able to set an event loop policy around if the platform we are running on is in Windows - before we get the event loop afterwards. However like I mentioned above my Python knowledge is limited, especially with how async/event loops are managed. I don't think it's a good idea to introduce it but I did want to mention I took a look anyways.
# If running in windows, set event loop policy instead
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsProactorEventLoopPolicy())
loop = asyncio.ProactorEventLoop()
asyncio.set_event_loop(loop)
What is the issue?
What was changed?
signal.raise_signal(signal.SIGINT)
via https://stackoverflow.com/questions/35772001/how-to-handle-a-signal-sigint-on-a-windows-os-machine/72637975#72637975. The trick is that we are dealing with sub-processes here. My Python knowledge is limited at this time since Windows can't use add_signal_handler - I wasn't quite sure how to best go this way to have the subprocess use it.Example
1) Attempting to run development in Windows with![image](https://github.com/meltano/edk/assets/84326247/e4847ca5-e637-4746-82cc-5b5584d4a37d)
loop.add_signal_handler
2) == to != for win32 check![image](https://github.com/meltano/edk/assets/84326247/58ddcda8-ab72-433c-bcd1-e552433000f4)
3) Checking KeyboardInterrupt works![image](https://github.com/meltano/edk/assets/84326247/6efcd302-3442-424a-a327-b72ef90c1c10)
Other notes
We may also be able to set an event loop policy around if the platform we are running on is in Windows - before we get the event loop afterwards. However like I mentioned above my Python knowledge is limited, especially with how async/event loops are managed. I don't think it's a good idea to introduce it but I did want to mention I took a look anyways.
📚 Documentation preview 📚: https://meltano-edk--274.org.readthedocs.build/en/274/