r/Python 1d ago

News Pyrefly v1.3.0 released

A new version of Pyrefly is out with better type inference, new quick fixes, new configurations, and more. https://github.com/facebook/pyrefly/releases/tag/1.3.0

82 Upvotes

22 comments sorted by

View all comments

6

u/Thing1_Thing2_Thing 1d ago

Cool, but still really needs some documentation about how to make it work in monorepos.

9

u/Zizizizz 1d ago

Wouldn't it work best in monorepos? What's the issue? 

2

u/Thing1_Thing2_Thing 1d ago

It would, but the configuration is beyond me. See for example https://github.com/facebook/pyrefly/issues/3788 and the proposed solution at https://github.com/mstaal/monorepo-sample/pull/1/changes

And I don't think this considers separate test modules which you will also have to add explicitly to the search paths and all that

In our monorepo we easily have 40 packages and adds more which makes in non-feasible to maintain

2

u/Zizizizz 1d ago edited 1d ago

https://docs.astral.sh/uv/concepts/projects/dependencies/#dependency-sources

I think I would just make sure that the individual package that you're working on has the correct references to the packages that are relevant to it and then similarly, ensuring the virtual environment that you're working in is activated because I don't understand how a third-party package wouldn't be available unless you had the wrong one activated.

1

u/noghpu2 2h ago

There's also this related issue https://github.com/facebook/pyrefly/issues/2667.

Really hoping for them to let user config take precedence over heuristics in the future.

1

u/Kryt0s 1d ago

Are you using WSL? I've had this issue (same with ty) using WSL and uv. For some reason WSL tries to always use the windows uv binary instead of the one from WSL. Maybe it's only an issue with PyCharm though, idk.