abinit / abipy

Open-source library for analyzing the results produced by ABINIT
http://abinit.github.io/abipy
Other
117 stars 96 forks source link

Replace `monty.os.path.which` with `shutil.which` #264

Closed mbercx closed 1 year ago

mbercx commented 1 year ago

Summary

The which function of the monty.os.path.which module was deprecated some time ago. Here we replace it with the shutil.which function, which has been added since Python v3.3

mbercx commented 1 year ago

@gmatteo I couldn't find any other instances of the import. I think the fix is straightforward and should be fine, but is there some way I can test that I haven't broken anything? ^^

gmatteo commented 1 year ago

@mbercx: Thanks for fixing the problem. The modules in gui are deprecated and will be removed in the next releases so we only need to make sure that monty.os.path.whichdoes not trigger an ImportError while running the tests with pytest. I will merge your PR and another one before releasing abipy v0.9.5