Skip to content

Commit 48b7e17

Browse files
committed
Add support back for Python3.8
1 parent 402dea5 commit 48b7e17

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ venv.bak/
9595
# Rope project settings
9696
.ropeproject
9797

98+
# VSCode project settings
99+
.vscode
100+
98101
# mkdocs documentation
99102
/site
100103

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ repos:
33
rev: v3.3.1
44
hooks:
55
- id: pyupgrade
6+
# I've kept it on py3.7 so that it doesn't replace `Dict` with `dict`
67
args: ["--py37-plus"]
78
- repo: https://github.com/python/black
89
rev: 23.1.0

marshmallow_dataclass/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class User:
4343
import warnings
4444
from enum import Enum
4545
from functools import lru_cache, partial
46-
from typing import Annotated, Any, Callable, Dict, FrozenSet, List, Mapping
46+
from typing import Any, Callable, Dict, FrozenSet, List, Mapping
4747
from typing import NewType as typing_NewType
4848
from typing import (
4949
Any,
@@ -72,6 +72,11 @@ class User:
7272

7373
from marshmallow_dataclass.lazy_class_attribute import lazy_class_attribute
7474

75+
if sys.version_info >= (3, 9):
76+
from typing import Annotated
77+
else:
78+
from typing_extensions import Annotated
79+
7580
if sys.version_info >= (3, 11):
7681
from typing import dataclass_transform
7782
else:

marshmallow_dataclass/typing.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1-
from typing import Annotated
1+
import sys
22

33
import marshmallow.fields
44

5+
if sys.version_info >= (3, 9):
6+
from typing import Annotated
7+
else:
8+
from typing_extensions import Annotated
9+
510
Url = Annotated[str, marshmallow.fields.Url]
611
Email = Annotated[str, marshmallow.fields.Email]
712

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from setuptools import setup, find_packages
1+
from setuptools import find_packages, setup
22

33
VERSION = "9.0.0"
44

0 commit comments

Comments
 (0)