Skip to content

Commit

Permalink
chore!: remove older deprecations (#607)
Browse files Browse the repository at this point in the history
* chore: remove deprecations

* style(pre-commit.ci): auto fixes [...]

* try removing test ignores

* fix warnings

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
tlambert03 and pre-commit-ci[bot] committed Oct 23, 2023
1 parent 16b3658 commit 9a58c9c
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 123 deletions.
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.

0 comments on commit 9a58c9c

Please sign in to comment.