#Jetbrains pycharm + Dagger?

1 messages · Page 1 of 1 (latest)

vocal oracle
#

Hi,

Does anybody know why pycharm can't make the python sdk work? I did some searching but it doesn't appear to be an issue on github (except: https://github.com/dagger/dagger/issues/3701 - which appears to be a correctness thing) or here on discord so I thought I'd just ask in case I've missed or misunderstood something.
None of the dagger modules or methods are found. If I run the main.py file with either python3.11 main.py or dagger run main.py the thing works. But, for instance autocompletion or error detection don't work. I've tried it on multiple machines and OS's and I've included screenshots from my mac.
It does work in with nodejs (in pycharm) and in goland with go. It also works when I open the same python directory in vscode. It seems to be only pycharm and the python sdk. I'd really like to use dagger and push it at work but many of my colleagues use pycharm and only know python.

GitHub

Todo No mypy warnings1 Add to lint step for CI (lint:typing) Build with mypyc? Support Pyright (Microsoft's type checker, default in VS Code) Make sure PyCharm is well supported as well Footnot...

gritty rain
#

I've used Pycharm for most of my years working with Python so I get it 🙂 It's my intention for it to support autocomplete when working with dagger, thanks for bringing it to my attention. I haven't used it for a while so I'll have to install and try it out.

gritty rain
#

Try replacing dagger.Connection() as client: with dagger.connection(): (notice lower case connection) and then replace references of client with dagger.

vocal oracle
#

Thanks for the suggestion Helder, that almost makes it work. It seems that the chained operations loose the type information. So the dagger.container() now shows the correct info and type return but any subsequent method on the Container is lost somewhere in the ether.

gritty rain
#

Yeah, that def needs fixing.

gritty rain