dell / omsdk

Dell EMC OpenManage Python SDK
Apache License 2.0
57 stars 20 forks source link

OMSDK incompatible with Python 3.12 #43

Closed lestercheung closed 5 months ago

lestercheung commented 8 months ago

Problem

OMSDK does not work with Python 3.12

Details

It's trying to import the imp module which has been removed from 3.12.

Repro Steps

Works in 3.9:

(py3.9) ➜  ~ python3.9
Python 3.9.6 (default, Dec  7 2023, 05:42:47)
[Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from omsdk.sdkinfra import sdkinfra
>>>

Not working in 3.12:

(py3) ➜ ~ python 
Python 3.12.1 (main, Dec  7 2023, 20:45:44) [Clang 15.0.0 (clang-1500.1.0.2.5)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import omsdk
>>> from omsdk.sdkinfra import sdkinfra
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/bugreport/.local/py3/lib/python3.12/site-packages/omsdk/sdkinfra.py", line 24, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
>>>

Impact

The dellemc_idrac_storage_volume Ansible module depends on this.

NeedBy

Update sdkinfra.py to use importlib?

Severity

This prevents any organizations to upgrade to Python3.12 on machines managing Dell machines using Ansible.

thebeanogamer commented 7 months ago

I'm trying to resolve this as it's causing build failures in Fedora. The Python docs (https://docs.python.org/3/whatsnew/3.12.html#imp) have a replacement for imp.load_source but intentionally do not have a replacement for imp.load_compiled as it was never documented behaviour.

Still trying to wrap my head around why omsdk is manually manipulating imports in the way it is. Will update here if I can find a workaround.

kitos9112 commented 6 months ago

Hitting this same issue here too. Not just the aforementioned module but dellemc.openmanage.idrac_firmware_info

We'd appreciate any update

anupamaloke commented 6 months ago

This is currently being worked on by the Dell team and will be addressed in the May month release.