-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate code automatically via tools provided by JetBrains? #5
Comments
Yeah, it's work in progress: pygobject/pgi-docgen#176 |
what about Fakegir? |
@AdamVerner Fakegir generates stubs from gir xml files, while the JetBrains tool generates them by doing a runtime introspection. Last time I checked, the stubs generated by the JetBrains tool were way more exhaustive and accurate. |
year 2020 now, still find you tips works fine with litlte mod: if you have pycharm installed, no need to clone the intellij-community repo. just replace the command below
with
git clone --depth 1 https://github.com/JetBrains/intellij-community.git /tmp/idea
mkdir /tmp/out
for typelib in Atk GLib GModule GObject Gdk GdkPixbuf Gio Gtk Pango; do
python3 /tmp/idea/python/helpers/generator3/__main__.py -d /tmp/out -p gi.repository.$typelib $(python3 -c "import gi; gi.require_versions({'Atk': '1.0', 'GModule': '2.0', 'Gdk': '3.0', 'GdkPixbuf': '2.0', 'Gtk': '3.0', 'Pango': '1.0'}); from gi.repository import $typelib; print($typelib.__path__[-1])")
done make pyCharm can use it mv /tmp/out/gi ~/.local/lib/python3.8/site-packages/gi-stubs but there's little troubleshoot: otherwise there will be a warning: anyway, the generated stubs works quite well, in my word, it is better than |
update: I’ve make a new repo and pushed the auto generated stubs: |
@ttys3 are these supposed to work with pyright? |
I will close this, stubs like this can be generated with generate script in this repo for modules which users need. Apart from that the real signatures have to be added manually. |
# This is the 1st commit message: other: Reformat codebase with black # This is the commit message #2: Add Adw # This is the commit message #3: Add types for functions # This is the commit message pygobject#4: Add types for ActionRow # This is the commit message pygobject#5: Add types for Adw.Animation # This is the commit message pygobject#6: Add types for Adw.Application # This is the commit message pygobject#7: Add types for Adw.ApplicationWindow # This is the commit message pygobject#8: Update Gdk to 4.0 # This is the commit message pygobject#9: Move Gdk into correct location # This is the commit message pygobject#10: Add types for Adw.Avatar # This is the commit message pygobject#11: Add types for Adw # This is the commit message pygobject#12: Removed Typing import # This is the commit message pygobject#13: Add types for Adw
# This is the 1st commit message: other: Reformat codebase with black # This is the commit message #2: Add Adw # This is the commit message #3: Add types for functions # This is the commit message pygobject#4: Add types for ActionRow # This is the commit message pygobject#5: Add types for Adw.Animation # This is the commit message pygobject#6: Add types for Adw.Application # This is the commit message pygobject#7: Add types for Adw.ApplicationWindow # This is the commit message pygobject#8: Update Gdk to 4.0 # This is the commit message pygobject#9: Move Gdk into correct location # This is the commit message pygobject#10: Add types for Adw.Avatar # This is the commit message pygobject#11: Add types for Adw # This is the commit message pygobject#12: Removed Typing import # This is the commit message pygobject#13: Add types for Adw
And stubs can be found under
/tmp/out
. Currently this repository seems to be much incomplete?The text was updated successfully, but these errors were encountered: