core: make ruff rule PLW1510 unfixable (#31868)

See
https://github.com/astral-sh/ruff/discussions/17087#discussioncomment-12675815

Tha autofix is misleading: it chooses to add `check=False` to keep the
runtime behavior but in reality it hides the fact that most probably the
user would prefer `check=True`.
This commit is contained in:
Christophe Bornet 2025-07-07 16:28:30 +02:00 committed by GitHub
parent 9368b92b2c
commit 4134b36db8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View File

@ -103,6 +103,8 @@ ignore = [
"PLC0415",
"PLR2004",
]
unfixable = ["PLW1510",]
flake8-type-checking.runtime-evaluated-base-classes = ["pydantic.BaseModel","langchain_core.load.serializable.Serializable","langchain_core.runnables.base.RunnableSerializable"]
flake8-annotations.allow-star-arg-any = true
flake8-annotations.mypy-init-return = true

View File

@ -51,4 +51,4 @@ from pytest_benchmark.fixture import BenchmarkFixture # type: ignore[import-unt
def test_import_time(benchmark: BenchmarkFixture, import_path: str) -> None:
@benchmark # type: ignore[misc]
def import_in_subprocess() -> None:
subprocess.run([sys.executable, "-c", import_path], check=False)
subprocess.run([sys.executable, "-c", import_path], check=True)