Python version(s) for custom plugins

utoddl
Tue, 12 Dec 2023 17:24:08 +0000
Get Help

On the flip side — that is, from the custom content (plugin) creators’ perspective — and spurred by this discussion: Maintain Ansible 9 for longer than 6 months, I have a question. Maybe this is more a Python thing than a strictly Ansible thing, but since all my Python code is somehow Ansible related the two are seriously intertwingled in my head.

Is there a process, tool, utility, etc. that a plugin creator can use to determine the minimum and maximum versions of Python required to safely run a particular .py file? I’m not seriously into the weeds on the differences between various Python versions. My pouring over Python change logs and release notes wouldn’t significantly increase my chances of catching a version related issue in one of my plugins anyway. If there were a tool I could point at a plugin and it would spit out an acceptable version spec, that would go a long way toward solving a problem I’ve simply ignored up until now. A huge bonus would be if such a tool could recommend specific changes, or point to docs about such, to help future-proof such code.

I’m not trying to be lazy — it comes naturally! — but life is short, and I’d rather not dedicate more than necessary to a task that a tool could do better and quicker than I could anyway.

3 posts - 2 participants