Skip to content

Conversation

@asukaminato0721
Copy link
Contributor

@meta-cla meta-cla bot added the cla signed label Nov 1, 2025
@asukaminato0721 asukaminato0721 marked this pull request as ready for review November 1, 2025 09:28
@asukaminato0721 asukaminato0721 marked this pull request as draft November 1, 2025 09:31
@asukaminato0721
Copy link
Contributor Author

The CI now takes too long...

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.

this is awesome. thank you for looking into this and finding a simple solution that I imagine works really well.

  • it's unclear from the doc-comment if this script is executed on the client or on CI (bundled with the pyrefly binary). can you document it and explain the limitations? from the code, it seems like it's only run on CI.
  • let's try removing that type: ignore. what made you add it (there's no pyrefly.toml)? if this crate is checked with a checker, can we vendor docify to avoid it? or does docify have a bunch of dependencies?

@asukaminato0721
Copy link
Contributor Author

asukaminato0721 commented Nov 4, 2025

How this script works:

It only runs on CI, writes the doc to stub, then bundles with the Pyrefly binary.

The type ignore is ... because this script needs docify, but only requires it at build time, so I use uv to run it, but my type checker will warn about it.

docify is a single script that relies on libcst.

https://github.com/AThePeanut4/docify/blob/main/docify.py

@kinto0
Copy link
Contributor

kinto0 commented Nov 5, 2025

awesome! hit ready for review when you're ready, I'm excited to get this in.

one thing I will change is add a buck target for the build script so we can run it through buck (and maybe remove the lint suppression?)

@asukaminato0721 asukaminato0721 marked this pull request as ready for review November 6, 2025 03:46
Copy link
Contributor

@yangdanny97 yangdanny97 left a comment

Choose a reason for hiding this comment

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

IMO better to run this bundling process whenever we pull in updates for the typeshed stubs, as opposed to every time we build. I believe that is what ty does as well.

That already happens using a Python script, so you could add your docstring copying logic to that directly.

# This source code is licensed under the MIT license found in the

@yangdanny97 yangdanny97 self-assigned this Nov 6, 2025
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.

docstrings on functions written in C

3 participants