cleder / crepr

Create a ❤️__repr__🤗️ for your python classes from the definition found in __init__
MIT License
6 stars 4 forks source link

Use exec_module instead of load_module #55

Open cleder opened 1 month ago

cleder commented 1 month ago
DeprecationWarning: the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead

https://docs.python.org/3/library/importlib.html#importlib.machinery.SourcelessFileLoader.load_module https://docs.python.org/3/library/importlib.html#importlib.abc.Loader.load_module

cleder commented 1 month ago

A bit of googling for python importlib the load_module() method is deprecated and slated for removal in Python 3.12; use exec_module() instead gave me these pointers:

https://bugs.python.org/issue43540 https://github.com/sktime/skbase/pull/190

Brajesh1213 commented 1 month ago

I would like to contribute to this

Brajesh1213 commented 1 month ago

I encountered an issue when running pytest on the repository. Specifically, the test suite is failing with the following error: [ repr/tests/run_test.py::test_get_module - crepr.crepr.CreprError: Error: file 'tests/classes/kw_only_test.py' not found.

failed crepr/tests/run_test.py::test_get_init_args - crepr. crepr.CreprError: Error: file 'tests/classes/kw_only_test.py' not found.

] I reviewed the get_module function in crepr.py to ensure it is correctly located and loaded

Can you please help me deal with this pytest error

cleder commented 1 month ago

merge develop into your fork, should be fixed now