CadQuery / CQ-editor

CadQuery GUI editor based on PyQT
Apache License 2.0
723 stars 111 forks source link

Python 3.12 fix: use importlib instead of imp #428

Closed thasti closed 1 month ago

thasti commented 5 months ago

The imp library has been deprecated since Python 3.4 and was finally removed in Python 3.12. For the isolated usecase within CQ-editor, replacing imp by its successor importlib seems to do the trick. importlib.reload was introduced in Python 3.4, so this would break support for older Python releases. Let me know in case support for older Python versions must be retained.

Additional info: I am not encountering any other issues running CQ-editor on Python 3.12, this appears to be the only fix required.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (03df6fa) 88.68% compared to head (6e5718e) 88.68%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #428 +/- ## ======================================= Coverage 88.68% 88.68% ======================================= Files 19 19 Lines 1564 1564 Branches 190 190 ======================================= Hits 1387 1387 Misses 143 143 Partials 34 34 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

adam-urbanczyk commented 1 month ago

Thanks @thasti