I’m currently attempting to get started developing some addons and integrations for AYON, and I’m not directly accessing the backend.
This makes plugin development a tiny bit tedious, to say the least. I’m not developing in the direct environment, I have my own local environment that I code my awful code in and then I package and upload a new version.
With every update to ayon-core and ayon-server I have to either put the whole modules in my local environment temporarily so I can have proper linting, or generate stubs with mypy. That isn’t too much hassle to do, but still it would be appreciated to have .pyi stubs be available by default, maybe as a pip package.
If someone has a suggestion for an easier time, that’d be appreciated as well,
but I would really enjoy having stubs available!
This way, those projects autocomplete live from the other repos and I can just pull latest changes into those relevant repos. It also allows me to very quickly find ‘similar code’ across the codebase because Pycharm detects it across the full project and the CTRL+SHIFT+F search is very quick across all, so if I wanted to see a quick reference of how a particular call is made I’m usually a few clicks away of finding (if I know what to search for).
The nice thing is here that I can also quickly check my code against e.g. PR to ayon-core or even any studio-specific override branch I might need to be working with.
Just wanted to also cross-reference this Discord topic/thread where someone linked a full ‘AYON workspace’ repo (which to me was overkill) but the thread itself contained some comments of everyone describing a bit how they are doing this. For example I explained mine here but e.g. @mustafa_jafar shared a VS Code example here
Ah, I’m seeing in Mustafa’s message that people configure VsCode (which is what I use, I tend to jump around between programming languages on some days so it’s the most convenient) with a “python.analysis.extraPaths”. Mustafa’s solution in combination with stubs for performance is exactly what i’m looking for.
I’ll probably get some runner to do the stubgen and then set up the environment that way. Many thanks!
Just for completeness,
Your issue is not related to Addon development but rather your development environment setup.
From my daily dev, I came up with my AYON Development Workbench