containers / podman-compose

a script to run docker-compose.yml using podman
GNU General Public License v2.0
5.01k stars 477 forks source link

podman-compose should throw a readable error on too old python #982

Open jsayer101 opened 3 months ago

jsayer101 commented 3 months ago

Describe the bug

Same issue as closed #862. We try to run podman-compose with Python 3.6.8

Traceback (most recent call last):
  File "/usr/local/bin/podman-compose", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/podman_compose.py", line 3504, in main
    asyncio.run(async_main())
AttributeError: module 'asyncio' has no attribute 'run'

To Reproduce On RHEL8X / Python 3.6.8

$ sudo -H pip3 install --upgrade pip
$ sudo pip3 install podman-compose 

$ podman-compose --version

Expected behavior Works...

Actual behavior Got an error

Output

$ podman-compose version

Traceback (most recent call last):
  File "/usr/local/bin/podman-compose", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/podman_compose.py", line 3504, in main
    asyncio.run(async_main())
AttributeError: module 'asyncio' has no attribute 'run'
$ podman-compose up

Traceback (most recent call last):
  File "/usr/local/bin/podman-compose", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/podman_compose.py", line 3504, in main
    asyncio.run(async_main())
AttributeError: module 'asyncio' has no attribute 'run'

Environment:

More infos We have RHEL8X systems that works well with Python 3.6.8 and

podman-compose version: 1.0.6
['podman', '--version', '']
using podman version: 4.6.1
podman-compose version 1.0.6
podman --version
podman version 4.6.1
exit code: 0
jsayer101 commented 3 months ago

Tested with latest devel, same result.

Actual workaround... Use v1.0.6. (Works well)

pip3 install https://github.com/containers/podman-compose/archive/v1.0.6.tar.gz
p12tic commented 3 months ago

Thanks for opening this bug. Python 3.6 is no longer supported on latest releases. The recommended solution is to use v1.0.6.

I'm not closing the issue because the current behavior is quite confusing. podman-compose should refuse to run and throw a descriptive error if the version of Python is too old.