From 59aa483931664ae579c54f1481ea59d4e550d5c5 Mon Sep 17 00:00:00 2001 From: Edoardo Abati <29585319+EdAbati@users.noreply.github.com> Date: Sat, 19 Oct 2024 09:34:47 +0200 Subject: [PATCH] chore: nox doctests only in Python 3.12 (#1222) * only doctest in 3.12 in nox * skip writing file in doctests --- narwhals/dataframe.py | 6 +++--- noxfile.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/narwhals/dataframe.py b/narwhals/dataframe.py index ac814afc7..4645cfbb4 100644 --- a/narwhals/dataframe.py +++ b/narwhals/dataframe.py @@ -582,9 +582,9 @@ def write_parquet(self, file: str | Path | BytesIO) -> Any: We can then pass either pandas, Polars or PyArrow to `func`: - >>> func(df_pd) - >>> func(df_pl) - >>> func(df_pa) + >>> func(df_pd) # doctest:+SKIP + >>> func(df_pl) # doctest:+SKIP + >>> func(df_pa) # doctest:+SKIP """ self._compliant_frame.write_parquet(file) diff --git a/noxfile.py b/noxfile.py index 1fb820c65..aec70add4 100644 --- a/noxfile.py +++ b/noxfile.py @@ -27,7 +27,9 @@ def run_common(session: Session, coverage_threshold: float) -> None: f"--cov-fail-under={coverage_threshold}", "--runslow", ) - session.run("pytest", "narwhals", "--doctest-modules") + + if session.python == "3.12": + session.run("pytest", "narwhals", "--doctest-modules") @nox.session(python=PYTHON_VERSIONS) # type: ignore[misc]