Skip to content

Commit

Permalink
Add docs on how to update the vendored stubs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexWaygood committed May 8, 2024
1 parent b24e813 commit 93432f7
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions crates/red_knot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Red Knot

The Red Knot crate contains code working towards multifile analysis, type inference and, ultimately, type-checking. It's very much a work in progress for now.

## Vendored types for the stdlib

Red Knot vendors [typeshed](https://github.com/python/typeshed)'s stubs for the standard library. The vendored stubs can be found in `crates/red_knot/vendor/typeshed`. The file `crates/red_knot/vendor/typeshed/source_commit.txt` tells you the typeshed commit that our vendored stdlib stubs currently correspond to.

Updating the vendored stubs is currently done manually. On a Unix machine, follow the following steps (if you have a typeshed clone in a `typeshed` directory, and a Ruff clone in a `ruff` directory):

```shell
cp -r typeshed/stdlib ruff/crates/red_knot/vendor/typeshed/stdlib
cp typeshed/README.md ruff/crates/red_knot/vendor/typeshed
cp typeshed/LICENSE ruff/crates/red_knot/vendor/typeshed
git -C typeshed rev-parse HEAD > ruff/crates/red_knot/vendor/typeshed/source_commit.txt
```

0 comments on commit 93432f7

Please sign in to comment.