From 3c5331225fb0b2dabc3397318ef5edad27f9e6d8 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Wed, 15 Oct 2025 05:26:22 +0800 Subject: [PATCH] python3Packages: transition from pytestFlagsArray --- pkgs/development/python-modules/atopile/default.nix | 11 +++++++---- .../python-modules/dbt-snowflake/default.nix | 4 ++-- .../python-modules/hydra-joblib-launcher/default.nix | 2 +- .../python-modules/langchain-experimental/default.nix | 2 +- pkgs/development/python-modules/mpl-typst/default.nix | 2 +- pkgs/development/python-modules/outlines/default.nix | 2 +- pkgs/development/python-modules/pgspecial/default.nix | 2 +- .../python-modules/pomegranate/default.nix | 8 ++++---- pkgs/development/python-modules/pyoprf/default.nix | 2 +- .../python-modules/scikit-image/default.nix | 7 +++++-- pkgs/development/python-modules/txtai/default.nix | 2 +- 11 files changed, 25 insertions(+), 19 deletions(-) diff --git a/pkgs/development/python-modules/atopile/default.nix b/pkgs/development/python-modules/atopile/default.nix index 44509b3b0c0b..9f0ec060f04d 100644 --- a/pkgs/development/python-modules/atopile/default.nix +++ b/pkgs/development/python-modules/atopile/default.nix @@ -214,10 +214,13 @@ buildPythonPackage (finalAttrs: { "test_muster_specific_targets_with_dependencies" ]; - # in order to use pytest marker, we need to use ppytestFlagsArray - # using pytestFlags causes `ERROR: file or directory not found: slow` - pytestFlagsArray = [ - "-m='not slow and not not_in_ci and not regression'" + disabledTestMarks = [ + "slow" + "not_in_ci" + "regression" + ]; + + pytestFlags = [ "--timeout=10" # any test taking long, timouts with more than 60s "--benchmark-disable" "--tb=line" diff --git a/pkgs/development/python-modules/dbt-snowflake/default.nix b/pkgs/development/python-modules/dbt-snowflake/default.nix index 476f1970b559..21460734c004 100644 --- a/pkgs/development/python-modules/dbt-snowflake/default.nix +++ b/pkgs/development/python-modules/dbt-snowflake/default.nix @@ -36,9 +36,9 @@ buildPythonPackage rec { enabledTestPaths = [ "tests/unit" ]; - pytestFlagsArray = [ + pytestFlags = [ # pyproject.toml specifies -n auto which only pytest-xdist understands - "--override-ini addopts=''" + "--override-ini=addopts=" ]; pythonImportsCheck = [ "dbt.adapters.snowflake" ]; diff --git a/pkgs/development/python-modules/hydra-joblib-launcher/default.nix b/pkgs/development/python-modules/hydra-joblib-launcher/default.nix index 33ccb24a6cd2..83a6ac63a366 100644 --- a/pkgs/development/python-modules/hydra-joblib-launcher/default.nix +++ b/pkgs/development/python-modules/hydra-joblib-launcher/default.nix @@ -47,7 +47,7 @@ buildPythonPackage (finalAttrs: { ]; # tries to write to source directory otherwise: - pytestFlagsArray = [ "-p no:cacheprovider" ]; + pytestFlags = [ "-pno:cacheprovider" ]; meta = { inherit (hydra-core.meta) changelog license; diff --git a/pkgs/development/python-modules/langchain-experimental/default.nix b/pkgs/development/python-modules/langchain-experimental/default.nix index 84b8e7a40d92..da4d8d1a8729 100644 --- a/pkgs/development/python-modules/langchain-experimental/default.nix +++ b/pkgs/development/python-modules/langchain-experimental/default.nix @@ -59,7 +59,7 @@ buildPythonPackage rec { pytestCheckHook ]; - pytestFlagsArray = [ "tests/unit_tests" ]; + enabledTestPaths = [ "tests/unit_tests" ]; pythonImportsCheck = [ "langchain_experimental" ]; diff --git a/pkgs/development/python-modules/mpl-typst/default.nix b/pkgs/development/python-modules/mpl-typst/default.nix index 47f092e89fa0..c333bece263e 100644 --- a/pkgs/development/python-modules/mpl-typst/default.nix +++ b/pkgs/development/python-modules/mpl-typst/default.nix @@ -46,7 +46,7 @@ buildPythonPackage rec { numpy ]; - pytestFlagsArray = [ "-v" ]; + pytestFlags = [ "-v" ]; pythonImportsCheck = [ "mpl_typst" diff --git a/pkgs/development/python-modules/outlines/default.nix b/pkgs/development/python-modules/outlines/default.nix index 3b30f9a8e0ab..475913ba11da 100644 --- a/pkgs/development/python-modules/outlines/default.nix +++ b/pkgs/development/python-modules/outlines/default.nix @@ -120,7 +120,7 @@ buildPythonPackage (finalAttrs: { tensorflow ]; - pytestFlagsArray = [ + pytestFlags = [ # FutureWarning: functools.partial will be a method descriptor in future Python versions; wrap it in enum.member() if you want to preserve the old behavior "-Wignore::FutureWarning" ]; diff --git a/pkgs/development/python-modules/pgspecial/default.nix b/pkgs/development/python-modules/pgspecial/default.nix index b481f1e6b411..fa574d7148cd 100644 --- a/pkgs/development/python-modules/pgspecial/default.nix +++ b/pkgs/development/python-modules/pgspecial/default.nix @@ -45,7 +45,7 @@ buildPythonPackage rec { postgresql ]; - pytestFlagsArray = [ "-vvv" ]; + pytestFlags = [ "-vvv" ]; env = { PGDATABASE = "_test_db"; diff --git a/pkgs/development/python-modules/pomegranate/default.nix b/pkgs/development/python-modules/pomegranate/default.nix index c161e1553688..0c5ccd4eb5d5 100644 --- a/pkgs/development/python-modules/pomegranate/default.nix +++ b/pkgs/development/python-modules/pomegranate/default.nix @@ -52,11 +52,11 @@ buildPythonPackage rec { }) ]; - pytestFlagsArray = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ + disabledTestPaths = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [ # AssertionError: Arrays are not almost equal to 6 decimals - "--deselect=tests/distributions/test_normal_full.py::test_fit" - "--deselect=tests/distributions/test_normal_full.py::test_from_summaries" - "--deselect=tests/distributions/test_normal_full.py::test_serialization" + "tests/distributions/test_normal_full.py::test_fit" + "tests/distributions/test_normal_full.py::test_from_summaries" + "tests/distributions/test_normal_full.py::test_serialization" ]; disabledTests = [ diff --git a/pkgs/development/python-modules/pyoprf/default.nix b/pkgs/development/python-modules/pyoprf/default.nix index 0e2c9abd7a4b..a59757506559 100644 --- a/pkgs/development/python-modules/pyoprf/default.nix +++ b/pkgs/development/python-modules/pyoprf/default.nix @@ -51,7 +51,7 @@ buildPythonPackage (finalAttrs: { nativeCheckInputs = [ pytestCheckHook ]; - pytestFlagsArray = [ "tests/test.py" ]; + enabledTestPaths = [ "tests/test.py" ]; meta = { homepage = "https://github.com/stef/liboprf/tree/master/python"; diff --git a/pkgs/development/python-modules/scikit-image/default.nix b/pkgs/development/python-modules/scikit-image/default.nix index a75e0e565e6a..03cb2f7f66cd 100644 --- a/pkgs/development/python-modules/scikit-image/default.nix +++ b/pkgs/development/python-modules/scikit-image/default.nix @@ -105,12 +105,15 @@ let rm -r skimage ''; - pytestFlagsArray = [ - "${installedPackageRoot}" + pytestFlags = [ "--pyargs" "skimage" ]; + enabledTestPaths = [ + installedPackageRoot + ]; + disabledTestPaths = [ # Requires network access (actually some data is loaded via `skimage._shared.testing.fetch` in the global scope, which calls `pytest.skip` when a network is unaccessible, leading to a pytest collection error). "${installedPackageRoot}/skimage/filters/rank/tests/test_rank.py" diff --git a/pkgs/development/python-modules/txtai/default.nix b/pkgs/development/python-modules/txtai/default.nix index d9acc4e32202..e9c5b77a2bef 100644 --- a/pkgs/development/python-modules/txtai/default.nix +++ b/pkgs/development/python-modules/txtai/default.nix @@ -290,7 +290,7 @@ buildPythonPackage { ++ optional-dependencies.api ++ optional-dependencies.similarity; - pytestFlagsArray = [ + enabledTestPaths = [ "test/python/*" ];