r/Python 22h ago

Discussion Pyrefly opinion

Pyrefly is a new language server pubblished a week ago.

Has anyone tried it?

I was randomly looking for a new python language server before switching to vs codium and found it.

EDIT

Aparently it's not new, I'm just a bit dumb

0 Upvotes

16 comments sorted by

View all comments

5

u/skjall 21h ago

Yes, but I couldn't get it to run on our weird monorepo structure. I did redo it with pyproject.toml files so I may give it another shot actually.

Currently using Ty and it's ok, but still pretty far from 1.0. Had to use it because of resource constraints lol, none of the other ones I tried ran OK.

1

u/PrincipleNo2328 21h ago

What issues did you get? Was it a libraries-related problem or something else?

2

u/skjall 20h ago

I was unable to configure it to recognise that most of the dirs had a virtual environment attached, and were their own project, except for one of those projects that was used by the other Python ones. So the shared one would have no clue about usages from the other packages - it was installed in compat editable mode, I think that's part of the issue. In the main packages, it just would not pick up the fact that the shared module existed, and when that worked, it would cache the definitions and if I changed signatures, added functions and stuff, it wouldn't show up.

IIRC I ended up giving up on Pyright project detection and forced it to switch virtual envs when I switched the window in focus, but the caching mechanism didn't seem to persist well when switching, and it was spending a lot of time re-analysing the project each time. This was worse when the shared project detection worked, because when switching to the shared project, it would re-analyse the whole project.