Skip to content

Commit 0464892

Browse files
authored
Merge pull request #161 from Flared/fix-deprecation-warnings
2 parents 6c5c54e + 96915dc commit 0464892

File tree

11 files changed

+754
-719
lines changed

11 files changed

+754
-719
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ jobs:
1818
os:
1919
- ubuntu-latest
2020
toxenv:
21-
- py36,report,codecov
2221
- py37,report,codecov
2322
- py38,report,codecov
2423
- py39,report,codecov

changelog.d/161.breaking.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update all project dependencies and fix all deprecated warnings. Python 3.6
2+
support was dropped to allow updating deprecated dependencies.

dev-requirements.txt

Lines changed: 553 additions & 504 deletions
Large diffs are not rendered by default.

requirements.txt

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,34 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.6
2+
# This file is autogenerated by pip-compile with python 3.8
33
# To update, run:
44
#
55
# python pycli lock
66
#
7-
attrs==21.2.0 \
8-
--hash=sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1 \
9-
--hash=sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb
7+
attrs==22.1.0 \
8+
--hash=sha256:29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6 \
9+
--hash=sha256:86efa402f67bf2df34f51a335487cf46b1ec130d02b8d39fd248abfd30da551c
1010
# via -r requirements.in
11-
dataclasses==0.8 ; python_version < "3.7" \
12-
--hash=sha256:0201d89fa866f68c8ebd9d08ee6ff50c0b255f8ec63a71c16fda7af82bb887bf \
13-
--hash=sha256:8479067f342acf957dc82ec415d355ab5edb7e7646b90dc6e2fd1d96ad084c97
14-
# via -r requirements.in
15-
marshmallow==3.13.0 \
16-
--hash=sha256:c67929438fd73a2be92128caa0325b1b5ed8b626d91a094d2f7f2771bf1f1c0e \
17-
--hash=sha256:dd4724335d3c2b870b641ffe4a2f8728a1380cd2e7e2312756715ffeaa82b842
11+
marshmallow==3.18.0 \
12+
--hash=sha256:35e02a3a06899c9119b785c12a22f4cda361745d66a71ab691fd7610202ae104 \
13+
--hash=sha256:6804c16114f7fce1f5b4dadc31f4674af23317fcc7f075da21e35c1a35d781f7
1814
# via -r requirements.in
1915
mypy-extensions==0.4.3 \
2016
--hash=sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d \
2117
--hash=sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8
2218
# via typing-inspect
23-
typing-extensions==3.10.0.0 \
24-
--hash=sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497 \
25-
--hash=sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342 \
26-
--hash=sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84
19+
packaging==21.3 \
20+
--hash=sha256:dd47c42927d89ab911e606518907cc2d3a1f38bbd026385970643f9c5b8ecfeb \
21+
--hash=sha256:ef103e05f519cdc783ae24ea4e2e0f508a9c99b2d4969652eed6a2e1ea5bd522
22+
# via marshmallow
23+
pyparsing==3.0.9 \
24+
--hash=sha256:2b020ecf7d21b687f219b71ecad3631f644a47f01403fa1d1036b0c6416d70fb \
25+
--hash=sha256:5026bae9a10eeaefb61dab2f09052b9f4307d44aee4eda64b309723d8d206bbc
26+
# via packaging
27+
typing-extensions==4.3.0 \
28+
--hash=sha256:25642c956049920a5aa49edcdd6ab1e06d7e5d467fc00e0506c44ac86fbfca02 \
29+
--hash=sha256:e6d2677a32f47fc7eb2795db1dd15c1f34eff616bcaf2cfb5e997f854fa1c4a6
2730
# via typing-inspect
28-
typing-inspect==0.7.1 \
29-
--hash=sha256:047d4097d9b17f46531bf6f014356111a1b6fb821a24fe7ac909853ca2a782aa \
30-
--hash=sha256:3cd7d4563e997719a710a3bfe7ffb544c6b72069b6812a02e9b414a8fa3aaa6b \
31-
--hash=sha256:b1f56c0783ef0f25fb064a01be6e5407e54cf4a4bf4f3ba3fe51e0bd6dcea9e5
31+
typing-inspect==0.8.0 \
32+
--hash=sha256:5fbf9c1e65d4fa01e701fe12a5bca6c6e08a4ffd5bc60bfac028253a447c5188 \
33+
--hash=sha256:8b1ff0c400943b6145df8119c41c244ca8207f1f10c9c057aeed1560e4806e3d
3234
# via -r requirements.in

setup.cfg

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ python_files =
1414
tests.py
1515
addopts =
1616
-ra
17-
--strict
17+
--strict-markers
1818
--doctest-modules
1919
--doctest-glob=\*.rst
2020
--tb=short
21+
filterwarnings =
22+
error
2123

2224
[isort]
2325
force_single_line = True

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ def read_extras(*prefixes):
7676
"Operating System :: Microsoft :: Windows",
7777
"Programming Language :: Python",
7878
"Programming Language :: Python :: 3",
79-
"Programming Language :: Python :: 3.6",
8079
"Programming Language :: Python :: 3.7",
8180
"Programming Language :: Python :: 3.8",
81+
"Programming Language :: Python :: 3.9",
8282
"Programming Language :: Python :: Implementation :: CPython",
8383
"Programming Language :: Python :: Implementation :: PyPy",
8484
# uncomment if you test on these interpreters:

src/desert/_make.py

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def field_for_schema(
186186
>>> int_field.__class__
187187
<class 'marshmallow.fields.Integer'>
188188
189-
>>> int_field.default
189+
>>> int_field.dump_default
190190
9
191191
>>> field_for_schema(t.Dict[str,str]).__class__
192192
<class 'marshmallow.fields.Dict'>
@@ -200,7 +200,7 @@ def field_for_schema(
200200
<class 'marshmallow_union.Union'>
201201
>>> field_for_schema(t.NewType('UserId', int)).__class__
202202
<class 'marshmallow.fields.Integer'>
203-
>>> field_for_schema(t.NewType('UserId', int), default=0).default
203+
>>> field_for_schema(t.NewType('UserId', int), default=0).dump_default
204204
0
205205
>>> class Color(enum.Enum):
206206
... red = 1
@@ -219,9 +219,9 @@ def field_for_schema(
219219
metadata[_DESERT_SENTINEL] = desert_metadata
220220

221221
if default is not marshmallow.missing:
222-
desert_metadata.setdefault("default", default)
222+
desert_metadata.setdefault("dump_default", default)
223223
desert_metadata.setdefault("allow_none", True)
224-
desert_metadata.setdefault("missing", default)
224+
desert_metadata.setdefault("load_default", default)
225225

226226
field = None
227227

@@ -237,7 +237,7 @@ def field_for_schema(
237237

238238
# Base types
239239
if not field and typ in _native_to_marshmallow:
240-
field = _native_to_marshmallow[typ](default=default)
240+
field = _native_to_marshmallow[typ](dump_default=default)
241241

242242
# Generic types
243243
origin = typing_inspect.get_origin(typ)
@@ -279,13 +279,17 @@ def field_for_schema(
279279
elif typing_inspect.is_optional_type(typ):
280280
[subtyp] = (t for t in arguments if t is not NoneType)
281281
# Treat optional types as types with a None default
282-
metadata[_DESERT_SENTINEL]["default"] = metadata.get("default", None)
283-
metadata[_DESERT_SENTINEL]["missing"] = metadata.get("missing", None)
282+
metadata[_DESERT_SENTINEL]["dump_default"] = metadata.get(
283+
"dump_default", None
284+
)
285+
metadata[_DESERT_SENTINEL]["load_default"] = metadata.get(
286+
"load_default", None
287+
)
284288
metadata[_DESERT_SENTINEL]["required"] = False
285289

286290
field = field_for_schema(subtyp, metadata=metadata, default=None)
287-
field.default = None
288-
field.missing = None
291+
field.dump_default = None
292+
field.load_default = None
289293
field.allow_none = True
290294

291295
elif typing_inspect.is_union_type(typ):
@@ -315,11 +319,11 @@ def field_for_schema(
315319

316320
field.metadata.update(metadata)
317321

318-
for key in ["default", "missing", "required", "marshmallow_field"]:
322+
for key in ["dump_default", "load_default", "required", "marshmallow_field"]:
319323
if key in metadata.keys():
320324
metadata[_DESERT_SENTINEL][key] = metadata.pop(key)
321325

322-
if field.default == field.missing == default == marshmallow.missing:
326+
if field.dump_default == field.load_default == default == marshmallow.missing:
323327
field.required = True
324328

325329
return field
@@ -346,7 +350,7 @@ def _get_field_default(
346350
if isinstance(field, dataclasses.Field):
347351
# misc: https://github.com/python/mypy/issues/10750
348352
# comparison-overlap: https://github.com/python/typeshed/pull/5900
349-
if field.default_factory != dataclasses.MISSING: # type: ignore[misc,comparison-overlap]
353+
if field.default_factory != dataclasses.MISSING:
350354
return dataclasses.MISSING
351355
if field.default is dataclasses.MISSING:
352356
return marshmallow.missing

0 commit comments

Comments
 (0)