Installation error with Python 3.12

Installation of pathtools with poetry fails due to importing of imp, which is deprecated in Python 3.12. See this issue on pathtools.