From 31a609db5cdfbf843f2e565b33ddc0fcd671fd19 Mon Sep 17 00:00:00 2001 From: James Lamb Date: Thu, 9 Jan 2025 08:25:25 -0600 Subject: [PATCH] consolidate pytest config in pyproject.toml (#6201) fixes #6194 Wheel tests in this project are emitting tons of warnings like this: > test_random_forest.py:1247 /__w/cuml/cuml/python/cuml/cuml/tests/test_random_forest.py:1247: PytestUnknownMarkWarning: Unknown pytest.mark.memleak - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html @pytest.mark.memleak I think that's because the introduction of a `pytest.ini` file in #6078 resulted in all of the `pytest` options from `pyproject.toml` being ignored. From https://docs.pytest.org/en/stable/reference/customize.html#pytest-ini > pytest.ini files take precedence over other files, even when empty. I think "take precedence" there means that if `pytest` finds a `pytest.ini`, it stops searching for other configuration files. Authors: - James Lamb (https://github.com/jameslamb) - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Tim Head (https://github.com/betatim) - Jake Awe (https://github.com/AyodeAwe) - Vyas Ramasubramani (https://github.com/vyasr) URL: https://github.com/rapidsai/cuml/pull/6201 --- .github/CODEOWNERS | 8 +++----- .gitignore | 5 +++++ python/cuml/cuml/tests/pytest.ini | 5 ----- python/cuml/pyproject.toml | 2 ++ 4 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 python/cuml/cuml/tests/pytest.ini diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f51c061074..23d782bb99 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,11 +5,9 @@ cpp/ @rapidsai/cuml-cpp-codeowners python/ @rapidsai/cuml-python-codeowners #cmake code owners -**/CMakeLists.txt @rapidsai/cuml-cmake-codeowners -**/cmake/ @rapidsai/cuml-cmake-codeowners -python/cuml/pyproject.toml @rapidsai/cuml-cmake-codeowners -build.sh @rapidsai/cuml-cmake-codeowners -**/build.sh @rapidsai/cuml-cmake-codeowners +CMakeLists.txt @rapidsai/cuml-cmake-codeowners +*.cmake @rapidsai/cuml-cmake-codeowners +**/cmake/ @rapidsai/cuml-cmake-codeowners #CI code owners /.github/ @rapidsai/ci-codeowners diff --git a/.gitignore b/.gitignore index dc0b98d735..e7f8328d0f 100644 --- a/.gitignore +++ b/.gitignore @@ -68,3 +68,8 @@ cpp/Doxyfile # clang tooling compile_commands.json .clangd/ + +# generally prefer 'pyproject.toml' to 'pytest.ini' for pytest options +# ref: https://github.com/rapidsai/cuml/pull/6201 +pytest.ini +!python/cuml/cuml/benchmark/automated/pytest.ini diff --git a/python/cuml/cuml/tests/pytest.ini b/python/cuml/cuml/tests/pytest.ini deleted file mode 100644 index bf70c06f84..0000000000 --- a/python/cuml/cuml/tests/pytest.ini +++ /dev/null @@ -1,5 +0,0 @@ -# Copyright (c) 2024, NVIDIA CORPORATION. - -[pytest] -addopts = --tb=native - diff --git a/python/cuml/pyproject.toml b/python/cuml/pyproject.toml index 2f0521fe6e..0bb733ef59 100644 --- a/python/cuml/pyproject.toml +++ b/python/cuml/pyproject.toml @@ -28,6 +28,8 @@ select = [ max_allowed_size_compressed = '1.5G' [tool.pytest.ini_options] +addopts = "--tb=native" + markers = [ "unit: Quickest tests focused on accuracy and correctness", "quality: More intense tests than unit with increased runtimes",