mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
This tool is a simple wrapper around stubgen and other tools that simplifies the creation of "baseline" stubs with minimal annotation coverage. These stubs allow basic type checking (e.g. number of arguments, whether X is valid as a base class), and once we have baseline stubs, it's easy to contribute incremental changes that add type annotations. Here's a summary of what the tool does: 1. Check that the package is installed 2. Run stubgen 3. Copy generated stubs to the correct directory under `stubs/` 4. Run black 5. Run isort 6. Generate basic metadata with correct package version 7. Update pyright exclusions (needed since there are missing types) 8. Print suggestions about next steps needed to contribute stubs to typeshed For example, to generate stubs for `iso8601`, you can run it like this: ``` python scripts/create_baseline_stubs.py iso8601 ``` Sometimes the project name is different from the runtime package name. In this case run the tool with `--package <runtime-package>`.