This crate bundles typeshed type stubs into the Pyrefly binary, providing type information for Python's standard library and third-party packages without requiring external files at runtime.
pyrefly_bundled embeds compressed archives of typeshed .pyi (Python Interface) files directly into the Pyrefly executable. This allows Pyrefly to access type stubs for the Python standard library and third-party packages without needing to download or locate them on the file system at runtime.
The build script (build.rs) runs during compilation and:
TYPESHED_ROOT env var or third_party/typeshed)include_bytes! macroThe update.py script is used to fetch and update the bundled typeshed version:
uv run ./update.py
This script:
.py and .pyi files from stdlib/ and stubs/ directoriesthird_party/typeshed/You can also specify a custom URL for the download using the --url flag. This can be helpful, for example, when you changed the update.py script and want to download & process the exact same typeshed revision as before. URL for the current typeshed revision can be found in the metadata file third_party/typeshed/typeshed_metadata.json.
This code is licensed under the MIT license. See the LICENSE file in the root directory.