-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
scripts: twister: Don't use match/case statements #78671
scripts: twister: Don't use match/case statements #78671
Conversation
Don't use match/case syntax to allow twister to run with python3 versions < 3.10. Signed-off-by: Dmitrii Golovanov <dmitrii.golovanov@intel.com>
I have no criticism of the PR per se, it should work well. Although I doubt that chaining ourselves to an arbitrary older version of Python is a good choice. Zephyr requires 3.10, our CMake setup demands 3.8, Python devicetree wants at least 3.6 - where do we draw the line? Note that Python 3.8 is almost at its End of Life. Shouldn't we simply add a guard at the start of |
@LukaszMrugala it is a good point to have some log message at Twister instead of a syntax error as well as a guard, although while the min. python requirement is not aligned yet at the project level for all its components, it seems better to avoid enforcing 3.10 new syntax if the same is still doable by simpler/older means. |
I must admit I don't like this. We have a minimum required Python version for a reason. If we start accepting patches for making our scripts compatible with older versions, how will we ever move on? |
agree, however our move to 3.10 was not done properly and not communicated well enough, as mentioned above, looks like besode the official minimal version required, every part of zephyr right now has a requirement on something else, which is very confusing. Add to the list above that the zephyr sdk requires 3.8 :( @golowanow what does actually drive this change? Where do you have 3.8 as a dependency that can't be changed to a newer version? |
this particular change is driven (as described) by user experience, for example: #78345 (comment) or I think the above mentioned circumstances around min python version, might make an issue where Zephyr and Twister are still used on Ubuntu 20.04 with its EOSS Apr/2025 and which is still mentioned on Zephyr Getting Started Guide I definitely agree Twister should have a guard for python version which it ACTUALLY reequires, and it must be aligned with other Zephyr components, better if done simultaneously with some sensible update like Zephyr or SDK new version release. Until that happens, this PR is just a fix for the recent code added to re-implement it differently with ease. |
Don't use match/case syntax to allow twister run with python3 versions < 3.10.
To avoid confusing SyntaxError after recent #78345 with older python3 despite Zephyr requires min 3.10.