Skip to content

Conversation

@cbarrete
Copy link
Contributor

@cbarrete cbarrete commented Dec 30, 2025

Summary

This PR adds some documentation about integrating Pyrefly with Buck2.
It also cleans up some formatting based on the existing Prettier configuration.

Test Plan

This is just changing documentation, there is no functional impact.

I tried to run test.py, but

env: ‘fbpython’: No such file or directory

I didn't bother to try more since this PR makes no code changes.

Copy link
Contributor

@connernilsen connernilsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @cbarrete, thanks for putting this together!

Can you pull out the formatting changes into a separate PR? There are two things going on here, so I'd like to focus on the changes in each of them separately. The format PR should be quick to review and pull in :).

As for the build system documentation, I'm not sure if we're in a state where we're ready to publicly support things yet. We're still at a point where the versions of Pyrefly and Buck's prelude are still tightly coupled, and breaking/backward incompatible changes are happening relatively often. I also don't think we have the bandwidth to offer much support around this yet.

If we're adding this documentation, I'd like to make it clear that it's pretty unstable and will continue to be for a while, and that while feature requests and bug reports are welcome, support will likely be lower priority than other issues for a while.

Let me know your thoughts around this, and I'm very open to discussion if you disagree with my requests or have other questions/ideas.

script](https://buck2.build/docs/bxl/) to get the necessary information about
the targets to typecheck.

The following optional configuration options are also supported:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you update the options below to follow the format used for other config options?

Something like the following would be preferred

#### Buck2

<description>

**`<option>`**

<description>

- Type: ...
- Default: ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd be happy to, but this is a more complex option than all others, because it has multiple variants, and its value is a product type.

I've done my best, let me know if you'd like me to tweak it further.


`<arg-flag>` is either `--file` or `--target`, depending on the type of
`<arg>`, and `<arg>` is an absolute path to a file or a build system's target.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may also be worth describing the JSON we consume. If you don't want to do it yourself, I can fill that in for you. If you do though, the structure is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've done what I could based on the sample value in a unit test I found.
Let me know if this is good enough.

There is a .prettierrc file in the website directory, but it was not
consistently applied.
@cbarrete
Copy link
Contributor Author

Thanks for the feedback! I've tried to address all your comments, let me know how it looks to you.

Also, apologies for the awkward stacking, I'm not very used to branch-based code review tools.

I've opened #1969 under this review for the formatting changes alone.

I've also added a big disclaimer that this is not well supported yet.
Frankly, I've opened this PR to help a friend that is starting to use Buck2 for Python. While I think that "unstable" docs are better than nothing, I would understand if you didn't want to merge this commit at this time. All I'd like in return is for it to be documented when it does become stable, if that's not too much to ask!

@connernilsen
Copy link
Contributor

Awesome, this is looking great! I'll pull it in and start the review process internally. Thanks for working on this.

Also, apologies for the awkward stacking, I'm not very used to branch-based code review tools.

No worries, I also haven't worked with open source git stuff in a while, so I may ask for some things that might be unreasonable, and it's totally fine to push back if my requests are weird.

I've also added a big disclaimer that this is not well supported yet.

Frankly, I've opened this PR to help a friend that is starting to use Buck2 for Python. While I think that "unstable" docs are better than nothing, I would understand if you didn't want to merge this commit at this time. All I'd like in return is for it to be documented when it does become stable, if that's not too much to ask!

That was the big thing I wanted to see addressed before the documentation was added. I think this is looking great so far, so I'll see if anyone else on the team thinks there's anything that needs to change with this, and I'll try to get it merged in soon.

@meta-codesync
Copy link

meta-codesync bot commented Jan 5, 2026

@connernilsen has imported this pull request. If you are a Meta employee, you can view this in D90133880.

Copy link
Contributor

@kinto0 kinto0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@meta-codesync
Copy link

meta-codesync bot commented Jan 5, 2026

@connernilsen merged this pull request in 9ef4d84.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants