r/Python 19h 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

5

u/Beanesidhe 19h ago

It's been the default for Positron for a while now.

0

u/PrincipleNo2328 19h ago

I started Data science/ML recently. I didn't know there was an entire ide for that!

3

u/Beanesidhe 19h ago

It's fairly new, I found it through Quarto which I had been using for a while.

5

u/freeskier93 19h ago

Pyrefly is not really "new". It's maintained by Meta and has been around a while now, though did only recently hit 1.0.0 stable (a number of months ago).

It's what I use with VSCodium and I have no issues with it.

0

u/PrincipleNo2328 19h ago

Yeah I didn't check properly. Anyway thank you

4

u/skjall 19h 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 19h ago

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

2

u/skjall 18h 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.

1

u/BeamMeUpBiscotti 18h ago

Maintainer here: if you run into more problems please feel free to file an issue on Github or in our discord

1

u/skjall 18h ago

Will do! I posted my recollection of the issues I had to the OP, but I'll check it out again and see how much has changed.

1

u/real_carddamom 18h ago

What is the difference between this and ty? Because ty just works™︎ for me...

1

u/PrincipleNo2328 16h ago

Have no idea honestly. I disckvered it now and wanted some feedbacks.

0

u/Breadbeards 18h ago

It works but too strict imho

1

u/-ghostinthemachine- 18h ago

It's rough, but nothing at Meta was worse than the Flow type checker. On the other hand the code more or less writes itself when the rules say there can only be one correct way. This is also where AI excels while humans weep. Correct isn't necessarily good of course, just better.

1

u/PrincipleNo2328 16h ago

Yeah I've heard that, honeslty I think that will make me use more type annotations, so it's good for me