Skip to content

Commit c54dff5

Browse files
committed
Add support back for Python3.8
1 parent bbd4ea8 commit c54dff5

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

.github/workflows/python-package.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
fail-fast: false
1313
matrix:
1414
os: ["ubuntu-latest"]
15-
python_version: ["3.9", "3.10", "3.11", "3.12", "pypy3.10"]
15+
python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.10"]
1616
include:
1717
- os: "ubuntu-20.04"
18-
python_version: "3.9"
18+
python_version: "3.8"
1919

2020
runs-on: ${{ matrix.os }}
2121
steps:

.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: 3 additions & 2 deletions
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 = "8.6.1"
44

@@ -8,6 +8,7 @@
88
"Operating System :: OS Independent",
99
"License :: OSI Approved :: MIT License",
1010
"Programming Language :: Python",
11+
"Programming Language :: Python :: 3.8",
1112
"Programming Language :: Python :: 3.9",
1213
"Programming Language :: Python :: 3.10",
1314
"Programming Language :: Python :: 3.11",
@@ -47,7 +48,7 @@
4748
keywords=["marshmallow", "dataclass", "serialization"],
4849
classifiers=CLASSIFIERS,
4950
license="MIT",
50-
python_requires=">=3.9",
51+
python_requires=">=3.8",
5152
install_requires=[
5253
"marshmallow>=3.18.0,<4.0",
5354
"typing-inspect>=0.8.0,<1.0",

0 commit comments

Comments
 (0)