Skip to content

Commit

Permalink
Drop marshmallow-enum dependency (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-was authored Jul 1, 2023
1 parent 80cacce commit bc83017
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ mypy = "*"
pytest = "6.2.3"

[packages]
marshmallow = "*"
marshmallow-enum = "*"
marshmallow = ">=3.18.0"
stringcase = "*"
typing-inspect = "*"

Expand Down
3 changes: 1 addition & 2 deletions dataclasses_json/mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from typing_inspect import is_union_type # type: ignore

from marshmallow import fields, Schema, post_load # type: ignore
from marshmallow_enum import EnumField # type: ignore
from marshmallow.exceptions import ValidationError # type: ignore

from dataclasses_json.core import (_is_supported_generic, _decode_dataclass,
Expand Down Expand Up @@ -253,7 +252,7 @@ def inner(type_, options):
return TYPES[origin](*args, **options)

if _issubclass_safe(origin, Enum):
return EnumField(enum=origin, by_value=True, *args, **options)
return fields.Enum(enum=origin, by_value=True, *args, **options)

if is_union_type(type_):
union_types = [a for a in getattr(type_, '__args__', []) if
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
keywords='dataclasses json',
install_requires=[
'dataclasses;python_version=="3.6"',
'marshmallow>=3.3.0,<4.0.0',
'marshmallow-enum>=1.5.1,<2.0.0',
'marshmallow>=3.18.0,<4.0.0',
'typing-inspect>=0.4.0'
],
python_requires='>=3.6',
Expand Down

0 comments on commit bc83017

Please sign in to comment.