playframework / play1

Play framework
https://www.playframework.com/documentation/1.4.x/home
Other
1.58k stars 683 forks source link

The imp module was removed from python 3.12 #1457

Closed mohsen0 closed 4 months ago

mohsen0 commented 8 months ago

Play Version : 1.7.1

Operating System: Ubuntu 22.04

JDK: not related

Expected Behavior

To be able to run the play cli using python 3.12

Actual Behavior

/opt/hostedtoolcache/play-1.7.1/play deps --verbose --sync --forProd 
Traceback (most recent call last):
  File "/opt/hostedtoolcache/play-1.7.1/play", line 13, in <module>
    from play.cmdloader import CommandLoader
  File "/opt/hostedtoolcache/play-1.7.1/framework/pym/play/cmdloader.py", line 2, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
make: *** [Makefile:68: deps] Error 1
Deprecated since version 3.4, will be removed in version 3.12: The imp module is deprecated in favor of importlib.

https://docs.python.org/3.11/library/imp.html

Reproducible Test Case

Try running play using python 3.12

tazmaniax commented 7 months ago

Is the simple solution to fix the Python version in the GitHub Actions to 3.11.x before the removal in 3.12?

ath0mas commented 7 months ago

Possibly yes to bypass the issue for the actions, but here the problem is more general and like running play on a dev computer.

tazmaniax commented 7 months ago

Agreed, the removal of the dependency on imp, if that is possible, is the more strategic fix that will benefit everyone.

tazmaniax commented 7 months ago

@ath0mas @mohsen0 possible longer-term solution here #1460

xael-fry commented 4 months ago

merge ad fix in https://github.com/playframework/play1/pull/1465