Skip to content
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

Usable with Pyright? #140

Open
chrisstpierre opened this issue Feb 3, 2020 · 6 comments
Open

Usable with Pyright? #140

chrisstpierre opened this issue Feb 3, 2020 · 6 comments

Comments

@chrisstpierre
Copy link

If this cannot be used with pyright (isntead of mypy), then what needs to happen so that it can be used with pyright?

@JukkaL
Copy link
Contributor

JukkaL commented Jul 21, 2020

Maybe somebody can give it a try and report your findings? None of the maintainers are familiar with pyright. At least functionality provided by the mypy plugin wouldn't be there, but the stubs might still be of some value.

@killthekitten
Copy link

killthekitten commented Jul 22, 2020

Just to get it started: there are some mentions of sqlalchemy and sqlalchemy-stubs in the pyright issue tracker.

Most notable being:

I haven't experimented with the config file so far, so I get a lot of import-related errors for the project that passes the checks with mypy.

From the first glance, with the pyright plugin enabled, the typechecks are not catching what they should.

I might be missing something, but it seems it can't pick up sqlalchemy-stubs out of the box.

@killthekitten
Copy link

It is simple to try it yourself:

npm install --global pyright
pyright --help

Then, do the usual:

pyright yourfile.py

@zeronone
Copy link

zeronone commented Aug 4, 2020

Just installing sqlalchemy-stubs worked for me.

From pyright docs (https://github.com/microsoft/pyright/blob/master/docs/import-resolution.md)

For a given package, try to resolve first using a stub package. Stub packages, as defined in PEP 561, are named the same as the original package but with “-stubs” appended.

@killthekitten
Copy link

killthekitten commented Aug 5, 2020

@zeronone that's nice to hear! Could you elaborate which features worked for you? I'm concerned about plugins in the first place, i.e. this

def column_hook(ctx: FunctionContext) -> Type:

@zeronone
Copy link

zeronone commented Aug 6, 2020

Oh sorry, I misunderstood. Yes the plugins don't work. Only the basic inference works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants