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

Make possible to use pylance with a local fork of pyright #33

Closed
savannahostrowski opened this issue Jul 2, 2020 · 9 comments
Closed
Labels
enhancement New feature or request

Comments

@savannahostrowski
Copy link
Contributor

Originally posted by @r3m0t in #4 (comment)

@erictraut
Copy link
Contributor

@r3m0t, can you provide more details about why you want to use pylance with a local fork of pyright? What is the use case you have in mind? This can help us explore potential solutions that meet your needs.

@erictraut erictraut added the waiting for user response Requires more information from user label Jul 5, 2020
@r3m0t
Copy link

r3m0t commented Jul 6, 2020

Hi @erictraut, my work uses a monorepo including Python and TypeScript. As our Windows was too old for VFSForGit, a Visual Studio extension handles the files rather than checking them all out to disk. Our tsserver is also customised to read this monorepo, with some js code. As pyright is implemented in js, this could be used with pyright as well.

Another use case is teaching it about some objects in ways that .pyi doesn't support but I haven't looked into this yet.

@erictraut
Copy link
Contributor

You're certain welcome to clone the Pyright sources, modify them, and build a private version of the Pyright VS Code Extension or CLI for your own purposes. You won't be able to make use of the additional features provided by Pylance though.

@archfear
Copy link

archfear commented Jan 10, 2021

On a related note, are there plans for Pylance to use a released version of Pyright rather than a custom fork? We use Pyright on our CI server and it's import that type checking in VS Code and on the CI server behave identically.

@erictraut
Copy link
Contributor

Pylance doesn't use a custom fork of Pyright. The release cadence of Pyright and Pylance are not always 100% sync'ed, so if you see any minor differences between the two, that's probably the explanation. There are also a few small differences in the default configuration settings for the two. Most importantly, "typeCheckingMode" defaults to "basic" in Pyright and "off" in Pylance.

@archfear
Copy link

@erictraut Thanks for the explanation. Are the defaults for useLibraryCodeForTypes different as well? It seemed to be behaving that way. It would be helpful to have the differences in defaults documented so that they can be explicitly set in pyrightconfig.json to ensure consistent behavior.

@erictraut
Copy link
Contributor

Yes, that's the other default that differs between the two. I think those are the only two.

@jakebailey
Copy link
Member

Yes, that's should be all of them. The only other may have been workspace vs open file only mode, but IIRC pyright switched to open file mode a while ago, and none of that matters for the CLI.

@jakebailey
Copy link
Member

I'm going to close this one for now; Pylance and pyright are very tightly integrated and evolve together as we implement things and fix issues, and something as big as allowing pyright to be swapped out will have to wait for a day when we introduce some stable API (which isn't something we've planned either).

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

No branches or pull requests

5 participants