Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw a readable error on too old Python #1120

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

mokibit
Copy link
Contributor

@mokibit mokibit commented Jan 25, 2025

podman-compose v1.0.6 is the last to support Python3.6. When newer podman-compose version is used with too old Python, podman-compose gives only a confusing error. This commit gives a clear message to use upgraded Python version.
A descriptive error can not be thrown, as line "from future imports" must occur at the beginning of the file, but older Python (older than Python3.7) does not recognize future and throws an errorimmediately.
Therefore, a comment is used to inform the user to update his Python version.
Fixes #982.

@mokibit mokibit force-pushed the inform-user-to-use-newer-python branch 3 times, most recently from 7943b10 to 7fdbbd8 Compare January 25, 2025 14:07
@mokibit mokibit force-pushed the inform-user-to-use-newer-python branch from 7fdbbd8 to 38d85eb Compare January 26, 2025 20:04
@mokibit mokibit changed the title Add information for the user to update Python version Throw a readable error on too old Python Jan 26, 2025
@mokibit mokibit force-pushed the inform-user-to-use-newer-python branch from 38d85eb to 5199c22 Compare January 27, 2025 19:47
podman-compose v1.0.6 is the last to support Python3.6. When newer
podman-compose version is used with too old Python, podman-compose gives
only a confusing error. This commit gives a clear message to use
upgraded Python version.
A descriptive error can not be thrown, as line "from __future__ imports"
must occur at the beginning of the file, but older Python (older than
Python3.7) does not recognize __future__ and throws an error
immediately.
Therefore, a comment is used to inform the user to update his Python
version.

Signed-off-by: Monika Kairaityte <[email protected]>
@mokibit mokibit force-pushed the inform-user-to-use-newer-python branch from 5199c22 to bdb3e4e Compare January 27, 2025 19:49
@p12tic p12tic merged commit 51d180d into containers:main Jan 27, 2025
8 checks passed
@mokibit mokibit deleted the inform-user-to-use-newer-python branch January 27, 2025 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

podman-compose should throw a readable error on too old python
2 participants