Skip to content

Commit

Permalink
nox typing: disable pyre for now
Browse files Browse the repository at this point in the history
pyre does not understand our _pydantic_compat module and spews errors.
  • Loading branch information
gotmax23 committed Dec 23, 2023
1 parent f8215d7 commit cdc8f7f
Showing 1 changed file with 32 additions and 29 deletions.
61 changes: 32 additions & 29 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,35 +147,38 @@ def typing(session: nox.Session):
install(session, "-e", ".[typing]", *others)
session.run("mypy", "src/antsibull_docs", "src/sphinx_antsibull_ext")

additional_libraries = []
for path in others:
if isinstance(path, Path):
additional_libraries.extend(("--search-path", str(path / "src")))

purelib = session.run(
"python",
"-c",
"import sysconfig; print(sysconfig.get_path('purelib'))",
silent=True,
).strip()
platlib = session.run(
"python",
"-c",
"import sysconfig; print(sysconfig.get_path('platlib'))",
silent=True,
).strip()
session.run(
"pyre",
"--source-directory",
"src",
"--search-path",
purelib,
"--search-path",
platlib,
"--search-path",
"stubs/",
*additional_libraries,
)
# Disable pyre for now. It is incompatible with our _pydantic_compat module
# and spews type errors across the entire codebase.
if False:
additional_libraries = []
for path in others:
if isinstance(path, Path):
additional_libraries.extend(("--search-path", str(path / "src")))

purelib = session.run(
"python",
"-c",
"import sysconfig; print(sysconfig.get_path('purelib'))",
silent=True,
).strip()
platlib = session.run(
"python",
"-c",
"import sysconfig; print(sysconfig.get_path('platlib'))",
silent=True,
).strip()
session.run(
"pyre",
"--source-directory",
"src",
"--search-path",
purelib,
"--search-path",
platlib,
"--search-path",
"stubs/",
*additional_libraries,
)


def check_no_modifications(session: nox.Session) -> None:
Expand Down

0 comments on commit cdc8f7f

Please sign in to comment.