From 655216b09240e1a3bd88a91c44150604bd63b06a Mon Sep 17 00:00:00 2001 From: Alexander Goscinski Date: Fri, 29 Nov 2024 14:38:34 +0100 Subject: [PATCH] Support imports of submodules from top level One can now import from top level ``` from scwidget import CodeExercise from scwidget.exercise import CodeExercise ``` --- src/scwidgets/__init__.py | 43 ++++++++++++++++++++++++++++++++++++++- tests/__init__.py | 22 ++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/src/scwidgets/__init__.py b/src/scwidgets/__init__.py index 28866e3..f9a235a 100644 --- a/src/scwidgets/__init__.py +++ b/src/scwidgets/__init__.py @@ -2,5 +2,46 @@ __authors__ = "the scicode-widgets developer team" from ._css_style import CssStyle, get_css_style +from .check import * # noqa: F403 +from .code import * # noqa: F403 +from .cue import * # noqa: F403 +from .exercise import * # noqa: F403 -__all__ = ["CssStyle", "get_css_style"] +__all__ = [ # noqa: F405 + # css_style + "CssStyle", + "get_css_style", + # cue + "CueWidget", + "CheckCueBox", + "CueBox", + "SaveCueBox", + "UpdateCueBox", + "ResetCueButton", + "SaveResetCueButton", + "CheckResetCueButton", + "UpdateResetCueButton", + "CueOutput", + "CueObject", + "CueFigure", + # code + "CodeInput", + "ParameterPanel", + # check + "Check", + "CheckResult", + "AssertResult", + "CheckRegistry", + "CheckableWidget", + "assert_equal", + "assert_shape", + "assert_numpy_allclose", + "assert_type", + "assert_numpy_floating_sub_dtype", + "assert_numpy_sub_dtype", + # exercise + "CodeExercise", + "TextExercise", + "ExerciseWidget", + "ExerciseRegistry", +] diff --git a/tests/__init__.py b/tests/__init__.py index e69de29..102add0 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,22 @@ +from scwidgets import ( # noqa: F401 + AssertResult, + Check, + CheckableWidget, + CheckRegistry, + CheckResult, + CodeExercise, + CodeInput, + CueFigure, + CueObject, + CueOutput, + ExerciseRegistry, + ExerciseWidget, + ParameterPanel, + TextExercise, + assert_equal, + assert_numpy_allclose, + assert_numpy_floating_sub_dtype, + assert_numpy_sub_dtype, + assert_shape, + assert_type, +)