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

newest pyright 1.1.344 into pylance? (current has 1.1.336) #5329

Closed
FrancescElies opened this issue Jan 5, 2024 · 4 comments
Closed

newest pyright 1.1.344 into pylance? (current has 1.1.336) #5329

FrancescElies opened this issue Jan 5, 2024 · 4 comments
Assignees
Labels
user responded Was "waiting for user response" and they responded

Comments

@FrancescElies
Copy link

Problem

We are upgrading our repositories to python 3.12 and pyright 1.1.344.

We are group of mixed people some just use python from time to time, others daily.

I personally don't use vscode daily but fits the needs of most people in several languages including python,
to avoid having to support internally several IDEs we decided ourselves a while ago for vscode, thus we kept saying:
"if you don't want to setup your editor for python just use vscode, if you want to use something else you are on your own".

Now during the upgrade we are in the situation where vscode reports different problems than the latest pyright used inside the venv.
At the time of writing (5 Jan 2024)

  • Pylance is at v2023.12.1 (using pyright 1.1.336 under the hood)
  • pyright is at 1.1.344
  • numpy is at 1.26.2

If there are mismatches between the editor and ci it makes makes people that are not very close to python say something in this line
"you see, I told you python is not a good language to work with"

Reprex

# myfile.py
import numpy as np
x = np.float64(4.2) / 2.1

image
But when pyright (1.1.344) is called over the cli won't report any errors.

Questions

Question 1

How often can we expect pyright to be merged into pylance? Sometimes is more than once a month sometimes takes longer

* 2023-11-15 a78e2b10f - [PylanceBot] Pull Pylance with Pyright 1.1.336 (#6457) [GitHub] E
| * 2023-11-01 64c9c3ff9 - [PylanceBot] Pull Pylance with Pyright 1.1.334 (#6287) [GitHub] E
| | * 2023-07-14 8e021d2ae - [PylanceBot] Pull Pylance with Pyright 1.1.317 (#5505) [GitHub] E
| | | * 2023-04-19 5b6a1d3b7 - [PylanceBot] Pull Pylance with Pyright 1.1.304 (#4975) [GitHub] E
| | | | * 2023-04-12 50d44cf9d - [PylanceBot] Pull Pylance with Pyright 1.1.303 (#4946) [GitHub] E
| | | | | * 2023-03-01 93a4ef878 - [PylanceBot] Pull Pylance with Pyright 1.1.296 (#4716) [GitHub] E

Question 2

Is there a way to instruct pylance to use pyright from current activated environment?
If is not possible how should we approach the problem of the editor reporting different problems than e.g. ci, or pyright being called over the cli?

Question 3

Would it be possible to get the pyright version to be reported in vscode too? Currently only the commit hash is being shown

image

Notes

My vscode experience is limited I just find myself in the situation of not using vscode daily but need to take care of the python dev experience for non-daily-python coders.

Any hints or advice are appreciated

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Jan 5, 2024
@debonte debonte assigned debonte and unassigned KacieKK Jan 5, 2024
@debonte
Copy link
Contributor

debonte commented Jan 5, 2024

How often can we expect pyright to be merged into pylance? Sometimes is more than once a month sometimes takes longer

Great question. I added a wiki page with a high-level overview of our release process/schedule. Our release schedule changed recently and we didn't advertise that to our users.

Currently Pylance is lagging behind Pyright more than usual. In an effort to better support virtual file systems, symlinks, remote files, etc, we recently changed Pyright to track files via URI rather than file path. Making this change in Pyright was quite time consuming. We're now making the same type of changes in Pylance, and that effort is even more complex. Ingestion of new Pyright builds is blocked until that work finishes.

Is there a way to instruct pylance to use pyright from current activated environment?

No. This comment provides some details on why that's not possible.

If is not possible how should we approach the problem of the editor reporting different problems than e.g. ci, or pyright being called over the cli?

See our current guidance. If this won't solve your issues, we'd be interested in better understanding your needs.

Would it be possible to get the pyright version to be reported in vscode too? Currently only the commit hash is being shown

That's a good idea. I opened a separate issue to track it: #5331

@debonte debonte added waiting for user response Requires more information from user and removed needs repro Issue has not been reproduced yet labels Jan 5, 2024
@FrancescElies
Copy link
Author

Currently Pylance is lagging behind Pyright more than usual. In an effort to better support virtual file systems, symlinks, remote files, etc, we recently microsoft/pyright#6519 to track files via URI rather than file path. Making this change in Pyright was quite time consuming. We're now making the same type of changes in Pylance, and that effort is even more complex. Ingestion of new Pyright builds is blocked until that work finishes.

Thanks for the detailed explanation

See our current guidance. If this won't solve your issues, we'd be interested in better understanding your needs.

I guess we will wait for the newest pyright to be included in pylance, there are improvements in pyright we definitely would like to have.

That's a good idea. I opened a separate issue to track it: #5331

👍

Everything is now clear, closing.

Hopefully, one day, business interests will merge with the goal of open-sourcing more of Pylance, and the division between Pylance and Pyright will gradually blur

@github-actions github-actions bot added user responded Was "waiting for user response" and they responded and removed waiting for user response Requires more information from user labels Jan 8, 2024
@DetachHead
Copy link

DetachHead commented Mar 29, 2024

I guess we will wait for the newest pyright to be included in pylance, there are improvements in pyright we definitely would like to have.

you could use my pyright fork, basedpyright. we've solved this problem by making the vscode extension use the version of the pyright package that's installed in your venv.

Hopefully, one day, business interests will merge with the goal of open-sourcing more of Pylance, and the division between Pylance and Pyright will gradually blur

we've re-implemented some of pylance's exclusive features such as semantic highlighting, inlay hints and quick fixes for import suggestions. though there's still quite a few features we don't have yet, which is why we support using both pylance and basedpyright

@FrancescElies
Copy link
Author

@DetachHead thanks for posting about basedpyright, didn't know about that project.

The project seems to address two of our main pain points, not being able to use same pyright version in our venv and the vscode monoculture problem where only features like inlay hints are avaiilable, we wished similar suff for other editors too (e.g. #4169).

We will definitely give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user responded Was "waiting for user response" and they responded
Projects
None yet
Development

No branches or pull requests

4 participants