PyCharm classes, user-skeletons, generated-skeletons, and pregenerated skeletons.


I'm trying to prepackage library sources and pregenerated stubs together with my plugin to work with a custom SDK.  Prepackaging library sources is necessary because only pyc files are distributed with some libraries without including the sources.  Prepackaging stubs is necessary to avoid costly stub generation for .NET libraries (this python SDK supports .NET lib imports).

My questions are:

1) How should the prepackaged sources be added to the SDK.  Do I add them as "CLASSES"?
2) Would it work if the sources are contained inside a zip/jar/egg. e.g would jar://path/to/!/library_name work as a path?
3) How should pregenerated stubs be added? Do I just extract them to the stubs folder?
4) Is there a way to add pregenerated stubs without extracting them, e.g the same thing as in question #2?


Comment actions Permalink

1) PyCharm mostly ignores the differences between order root types. Adding as CLASSES should work fine.
2) Yes, this should work.
3) To avoid conflicts with PyCharm's own skeletons generator, I believe you should put your stubs into the user skeletons directory. See PyUserSkeletonsUtil in the PyCharm source code.
4) No, unfortunately the skeletons are added as a root in the local file system, so your skeletons also need to be extracted from an archive into a local directory.

Comment actions Permalink

How are stubs and skeletons treated differently from library sources?
In case of binary skeletons for binary python modules I guess IDEA needs to pretend that it is part of a package with at a different path for purposes of relative import resolution. In case of .NET stubs this is not necessary. So would it make any difference to just add them as a library?


Please sign in to leave a comment.