diff --git a/basedpyright/run_node.py b/basedpyright/run_node.py index 5ccefca5a6..42c0e86a49 100644 --- a/basedpyright/run_node.py +++ b/basedpyright/run_node.py @@ -7,4 +7,4 @@ def run(script_name: str): - node.run([Path(__file__).parent / f"{script_name}.js", *sys.argv[1:]]) + _ = node.run([Path(__file__).parent / f"{script_name}.js", *sys.argv[1:]]) diff --git a/pdm_build.py b/pdm_build.py index 67ef68ae2e..645e3f1fa3 100644 --- a/pdm_build.py +++ b/pdm_build.py @@ -3,12 +3,20 @@ from json import loads from pathlib import Path from shutil import copyfile, copytree +from typing import TYPE_CHECKING -from nodejs import npm +# https://github.com/samwillis/nodejs-pypi/pull/23 +if TYPE_CHECKING: + # https://github.com/astral-sh/ruff/issues/9528 + from subprocess import run as run_ # noqa: S404 + + run = run_ +else: + from nodejs.npm import run if not Path("node_modules").exists(): - _ = npm.run(["ci"], check=True) -_ = npm.run(["run", "build:cli:dev"], check=True) + _ = run(["ci"], check=True) +_ = run(["run", "build:cli:dev"], check=True) npm_package_dir = Path("packages/pyright") pypi_package_dir = Path("basedpyright")