mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Deduplicate pinned pyright version (#9299)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -6,7 +6,8 @@ import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
_PYRIGHT_VERSION = "1.1.278" # Must match .github/workflows/tests.yml.
|
||||
import tomli
|
||||
|
||||
_WELL_KNOWN_FILE = Path("tests", "pyright_test.py")
|
||||
|
||||
|
||||
@@ -28,8 +29,11 @@ def main() -> None:
|
||||
print("error running npx; is Node.js installed?", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
os.environ["PYRIGHT_PYTHON_FORCE_VERSION"] = _PYRIGHT_VERSION
|
||||
command = [npx, f"pyright@{_PYRIGHT_VERSION}"] + sys.argv[1:]
|
||||
with open("pyproject.toml", "rb") as config:
|
||||
pyright_version: str = tomli.load(config)["tool"]["typeshed"]["pyright_version"]
|
||||
|
||||
os.environ["PYRIGHT_PYTHON_FORCE_VERSION"] = pyright_version
|
||||
command = [npx, f"pyright@{pyright_version}"] + sys.argv[1:]
|
||||
print("Running:", " ".join(command))
|
||||
|
||||
ret = subprocess.run(command).returncode
|
||||
|
||||
Reference in New Issue
Block a user