Type Annotations + mypyc compiling ansible

72 views
Skip to first unread message

Cooper Lees

unread,
May 30, 2022, 4:30:11 PM5/30/22
to Ansible Project
Hi All,

I saw https://github.com/ansible/ansible/issues/69424 indicated that type annotations was not considered for the ansible code base. I would like to revist this topic and share the added on ability to potentially "compile" ansible using mypyc to get performance and resource usage wins for anisble itself. 

I personally run ansible-playbook over my personal infra of 6 VPS's and home routers and am very surprised at the resources it uses to do so.

Here is some good points on why this could be a good thing to support:
- We also converted black (as I am a maintainer) to mypyc and saw a ~2x speedup

I understand this is a large undertaking, but was just wanting to see peoples point of views here. Thoughts?

Michael

unread,
Jun 5, 2022, 2:21:11 PM6/5/22
to Ansible Project
Hi, I've started adding type stubs for the Ansible codebase, currently its not public

понедельник, 30 мая 2022 г. в 23:30:11 UTC+3, Cooper Lees:

Matt Martz

unread,
Jun 6, 2022, 12:56:46 PM6/6/22
to ansible...@googlegroups.com
We are working towards type annotations.  I would recommend reading over the proposal[1] that we have largely agreed to.  But regardless, this isn't something that will happen overnight, it will likely take years.  And we don't have any intention of just blanket applying it to the whole code base up front.  It'll be slow, and only added as necessary.  In some cases, it may require rewriting code, which in some cases could also require deprecation cycles.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8ddedde5-fd58-438a-a9da-7b579b5936a1n%40googlegroups.com.


--
Matt Martz
@sivel
sivel.net

Michael Ivanov

unread,
Jun 6, 2022, 2:02:57 PM6/6/22
to ansible...@googlegroups.com
It can be firstly added to typeshed.

пн, 6 июн. 2022 г., 19:56 Matt Martz <ma...@sivel.net>:
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/nFnDyn3kmvQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v8GaAyqCWLiJs1LgmOFRrF6PWwKb2G9oSdQORCnAyO87g%40mail.gmail.com.

Cooper Lees

unread,
Jun 6, 2022, 2:04:28 PM6/6/22
to ansible...@googlegroups.com
Awesome news to hear this is happening. I do appreciate the time required here and the need for refactoring to make Python code more type sane. 

Cheers,
Cooper

You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/nFnDyn3kmvQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAD8N0v8GaAyqCWLiJs1LgmOFRrF6PWwKb2G9oSdQORCnAyO87g%40mail.gmail.com.

Reply all
Reply to author
Forward
0 new messages