potiuk commented on PR #27946: URL: https://github.com/apache/airflow/pull/27946#issuecomment-1328865055
> I love this idea, however I think using https://mypy.readthedocs.io/en/stable/stubgen.html might be a good idea -- it captures (I think) everything we want but we have far less code to maintain as a result. > > Oh: this might not let us capture only _specific_ "private" things we want. Humbug. Interesting idea. I will see if I can bend the stubgen to our case, I would also prefer not to have our own code doint this AST parsing (I've learned a bit and it's simple, but not having to do it would be a plus). The "diff" part is going to work very similarly and .pyi file seems to fulfill very well the criteria I have for the API definition. The not-really-privte-even-if -it-shoudl be might be indeed a blocker, but maybe I can bend it to our will a bit. Also one difficulty with .pyi file that we would have to parse the file anyway to check if our code is actually using the "exposed" API functions. I am not sure if we can run any check to tell "Am I only using the stuff from that .pyi file and nothing else"? But the idea made me think - maybe we can do something a bit different. Maybe instead of generating the api file we could generate the .pyi files and let the Mypy checks to the verifications for us. I will explore this one. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
