Config-less CoreCLR and improved runtime load message by filmor · Pull Request #1942 · pythonnet/pythonnet

@filmor

What does this implement/fix? Explain your changes.

  • Bump clr-loader dependency to 0.2.0 and adjust interface, allows to load a .NET Core Python.NET by just setting PYTHONNET_RUNTIME=coreclr or from pythonnet import set_runtime; set_runtime("coreclr")
  • Improve error message if the runtime fails to load

Does this close any currently open issues?

#1868

Checklist

Check all those that are applicable and complete.

  • Make sure to include one or more tests for your change
  • If an enhancement PR, please create docs and at best an example
  • Ensure you have signed the .NET Foundation CLA
  • Add yourself to AUTHORS
  • Updated the CHANGELOG

@filmor filmor changed the base branch from master to release

September 16, 2022 19:35

@filmor

@lostmsu Do you have any idea why this one doesn't run the CI?

/edit: Sure, now it does :)

@lostmsu

Can you point to the corresponding change in clr_loader?

@lostmsu

@filmor

Meh, I'll have to test it tomorrow on a Windows machine, not really sure what I broke there (and why it works for the clr-loader CI).

@lostmsu

Have you seen the cause of the exception?

OSError: cannot load library 'c:\hostedtoolcache\windows\python\3.7.9\x64\lib\site-packages\clr_loader\ffi\dlls\amd64\ClrLoader.dll': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'c:\hostedtoolcache\windows\python\3.7.9\x64\lib\site-packages\clr_loader\ffi\dlls\amd64\ClrLoader.dll'

The above exception was the direct cause of the following exception:
...

@filmor

Have you seen the cause of the exception?

OSError: cannot load library 'c:\hostedtoolcache\windows\python\3.7.9\x64\lib\site-packages\clr_loader\ffi\dlls\amd64\ClrLoader.dll': error 0x7e. Additionally, ctypes.util.find_library() did not manage to locate a library called 'c:\hostedtoolcache\windows\python\3.7.9\x64\lib\site-packages\clr_loader\ffi\dlls\amd64\ClrLoader.dll'
The above exception was the direct cause of the following exception:
...

Nope, didn't see that one. Then I must have broken the wheel building somehow. I can see that the wheel does not include the file at all right now. So, 0.2.3 it will be ;)

- Supports loading without explicitly specifying the runtime config now
- Exposes information on the loaded runtime

@filmor

@filmor

@filmor filmor deleted the configless-coreclr branch

September 17, 2022 08:52

@DareDevilDenis