From 654d09ca4c22f4888d8e511789e57a7627043492 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Wed, 6 Oct 2021 22:31:57 -0700 Subject: [PATCH] sage.features.sagemath: Change sage_optional_tags to sage_features --- src/sage/doctest/control.py | 4 ++-- src/sage/features/sagemath.py | 19 ++++++++----------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py index 05767a50876..3f11a5bf982 100644 --- a/src/sage/doctest/control.py +++ b/src/sage/doctest/control.py @@ -371,8 +371,8 @@ def __init__(self, options, args): from sage.features import package_systems options.optional.update(system.name for system in package_systems()) - from sage.features.sagemath import sage_optional_tags - options.optional.update(sage_optional_tags()) + from sage.features.sagemath import sage_features + options.optional.update(feature.name for feature in sage_features()) # Check that all tags are valid for o in options.optional: diff --git a/src/sage/features/sagemath.py b/src/sage/features/sagemath.py index f0ecfdddca7..91fec0ac498 100644 --- a/src/sage/features/sagemath.py +++ b/src/sage/features/sagemath.py @@ -82,7 +82,7 @@ def __init__(self): spkg="sagemath_symbolics") -def sage_optional_tags(): +def sage_features(): """ Return tags for conditionalizing doctests. @@ -99,15 +99,12 @@ def sage_optional_tags(): EXAMPLES:: - sage: from sage.features.sagemath import sage_optional_tags - sage: list(sage_optional_tags()) # random - ['sage.graphs', - 'sage.graphs.bliss', - 'sage.matrix.matrix_gfpn_dense', - 'sage.plot', - 'sage.rings.number_field', - 'sage.rings.real_double', - 'sage.symbolic'] + sage: from sage.features.sagemath import sage_features + sage: list(sage_features()) # random + [Feature('sage.graphs'), + Feature('sage.graphs.bliss'), + Feature('sage.plot'), + Feature('sage.rings.real_double')] """ for feature in [sage__combinat(), sage__graphs(), @@ -120,4 +117,4 @@ def sage_optional_tags(): sage__rings__real_double(), sage__symbolic()]: if feature.is_present(): - yield feature.name + yield feature