Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: remove older deprecations #607

Merged
merged 6 commits into from
Oct 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -211,14 +211,8 @@ minversion = "6.0"
testpaths = ["tests"]
filterwarnings = [
"error",
"ignore::DeprecationWarning:qtpy",
"ignore:distutils Version classes are deprecated",
"ignore:path is deprecated:DeprecationWarning",
"ignore:Jupyter is migrating its paths to use standard platformdirs:DeprecationWarning",
"ignore:Enum value:DeprecationWarning:matplotlib",
"ignore:Widget([^\\s]+) is deprecated:DeprecationWarning", # ipywidgets
"ignore::DeprecationWarning:docstring_parser",
"ignore::DeprecationWarning:tqdm",
"ignore::DeprecationWarning:docstring_parser",
]

# https://mypy.readthedocs.io/en/stable/config_file.html
Expand Down
18 changes: 0 additions & 18 deletions src/magicgui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""magicgui is a utility for generating a GUI from a python function."""
from importlib.metadata import PackageNotFoundError, version
from typing import Any

try:
__version__ = version("magicgui")
Expand All @@ -23,20 +22,3 @@
"type_registered",
"use_app",
]


def __getattr__(name: str) -> Any:
if name == "FunctionGui":
from warnings import warn

from .widgets import FunctionGui

warn(
"magicgui.FunctionGui is deprecated. "
"Please import at magicgui.widgets.FunctionGui",
DeprecationWarning,
stacklevel=2,
)

return FunctionGui
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
28 changes: 0 additions & 28 deletions src/magicgui/type_map/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
"""Functions that map python types to widgets."""

from typing import Any

from ._type_map import get_widget_class, register_type, type2callback, type_registered

__all__ = [
Expand All @@ -10,28 +7,3 @@
"type_registered",
"type2callback",
]


def __getattr__(name: str) -> Any:
"""Import from magicgui.types if not found in magicgui.schema."""
import warnings

if name == "_type2callback":
warnings.warn(
"magicgui.type_map._type2callback is now public, "
"use magicgui.type_map.type2callback",
DeprecationWarning,
stacklevel=2,
)
return type2callback
if name == "pick_widget_type":
from ._type_map import _pick_widget_type

warnings.warn(
"magicgui.type_map.pick_widget_type is deprecated, "
"please use magicgui.type_map.get_widget_class instead",
DeprecationWarning,
stacklevel=2,
)
return _pick_widget_type
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
14 changes: 0 additions & 14 deletions src/magicgui/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,3 @@ def __bool__(self) -> bool:
# regular expressions
"regex", # draft 7
]


def __getattr__(name: str) -> Any:
if name == "WidgetOptions":
import warnings

warnings.warn(
"magicgui.types.WidgetOptions is being removed. Use `dict` instead, "
"and restrict import to a TYPE_CHECKING clause.",
DeprecationWarning,
stacklevel=2,
)
return dict
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
10 changes: 0 additions & 10 deletions src/magicgui/widgets/_bases/__init__.py

This file was deleted.

36 changes: 0 additions & 36 deletions src/magicgui/widgets/_bases/value_widget.py

This file was deleted.

10 changes: 0 additions & 10 deletions src/magicgui/widgets/_bases/widget.py

This file was deleted.