8000 Add `stubdefaulter` to `create_baseline_stubs.py` by Avasam · Pull Request #10127 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Add stubdefaulter to create_baseline_stubs.py #10127

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
8000
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions requirements-tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ pre-commit-hooks==4.4.0 # must match .pre-commit-confi
pycln==2.1.3 # must match .pre-commit-config.yaml
pytype==2023.4.27; platform_system != "Windows" and python_version < "3.11"
pyyaml==6.0
stubdefaulter==0.1.0
termcolor>=2.3
tomli==2.0.1
tomlkit==0.11.8
Expand Down
8 changes: 7 additions & 1 deletion scripts/create_baseline_stubs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,19 @@ def run_stubgen(package: str, output: str) -> None:
subprocess.run(["stubgen", "-o", output, "-p", package, "--export-less"], check=True)


def run_stubdefaulter(stub_dir: str) -> None:
print(f"Running stubdefaulter: stubdefaulter --packages {stub_dir}")
subprocess.run(["stubdefaulter", "--packages", stub_dir])


def run_black(stub_dir: str) -> None:
print(f"Running black: black {stub_dir}")
subprocess.run(["black", stub_dir])


def run_isort(stub_dir: str) -> None:
print(f"Running isort: isort {stub_dir}")
subprocess.run(["python3", "-m", "isort", stub_dir])
subprocess.run([sys.executable, "-m", "isort", stub_dir])


def create_metadata(stub_dir: str, version: str) -> None:
Expand Down Expand Up @@ -152,6 +157,7 @@ def main() -> None:
sys.exit(f"Error: {package_dir} already exists (delete it first)")

run_stubgen(package, stub_dir)
run_stubdefaulter(stub_dir)

run_isort(stub_dir)
run_black(stub_dir)
Expand Down
0