From 0c717d3a18a1e55d09491a8e6332be343701631d Mon Sep 17 00:00:00 2001 From: Pete Dietl Date: Fri, 16 Sep 2022 21:30:05 +0200 Subject: [PATCH] Upgrade Marshmallow version to remove pytest warnings --- poetry.lock | 23 +++++++++++++---------- pyproject.toml | 2 +- transient/configuration.py | 4 ++-- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/poetry.lock b/poetry.lock index acf46ed..147c207 100644 --- a/poetry.lock +++ b/poetry.lock @@ -388,16 +388,19 @@ python-versions = ">=3.7" [[package]] name = "marshmallow" -version = "3.6.1" +version = "3.18.0" description = "A lightweight library for converting complex datatypes to and from native Python datatypes." category = "main" optional = false -python-versions = ">=3.5" +python-versions = ">=3.7" + +[package.dependencies] +packaging = ">=17.0" [package.extras] -dev = ["flake8 (==3.8.2)", "flake8-bugbear (==20.1.4)", "mypy (==0.770)", "pre-commit (>=2.4,<3.0)", "pytest", "pytz", "simplejson", "tox"] -docs = ["alabaster (==0.7.12)", "autodocsumm (==0.1.13)", "sphinx (==3.0.4)", "sphinx-issues (==1.2.0)", "sphinx-version-warning (==1.1.2)"] -lint = ["flake8 (==3.8.2)", "flake8-bugbear (==20.1.4)", "mypy (==0.770)", "pre-commit (>=2.4,<3.0)"] +dev = ["flake8 (==5.0.4)", "flake8-bugbear (==22.9.11)", "mypy (==0.971)", "pre-commit (>=2.4,<3.0)", "pytest", "pytz", "simplejson", "tox"] +docs = ["alabaster (==0.7.12)", "autodocsumm (==0.2.9)", "sphinx (==5.1.1)", "sphinx-issues (==3.0.1)", "sphinx-version-warning (==1.1.2)"] +lint = ["flake8 (==5.0.4)", "flake8-bugbear (==22.9.11)", "mypy (==0.971)", "pre-commit (>=2.4,<3.0)"] tests = ["pytest", "pytz", "simplejson"] [[package]] @@ -475,7 +478,7 @@ twitter = ["twython"] name = "packaging" version = "21.3" description = "Core utilities for Python packages" -category = "dev" +category = "main" optional = false python-versions = ">=3.6" @@ -613,7 +616,7 @@ tests-numpy = ["numpy", "pyhamcrest[tests]"] name = "pyparsing" version = "3.0.9" description = "pyparsing module - Classes and methods to define and execute parsing grammars" -category = "dev" +category = "main" optional = false python-versions = ">=3.6.8" @@ -938,7 +941,7 @@ testing = ["func-timeout", "jaraco.itertools", "pytest (>=6)", "pytest-black (>= [metadata] lock-version = "1.1" python-versions = "^3.7" -content-hash = "358c7083f3ccf0046cce0b4a1674d318a173a33277f21cec55322ae82570aef9" +content-hash = "6665835dac2b0bd84ce6bbc9c37358a6a1b6ef458e4f3910da9f67c0b5c1c9dd" [metadata.files] atomicwrites = [ @@ -1259,8 +1262,8 @@ MarkupSafe = [ {file = "MarkupSafe-2.1.1.tar.gz", hash = "sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"}, ] marshmallow = [ - {file = "marshmallow-3.6.1-py2.py3-none-any.whl", hash = "sha256:9aa20f9b71c992b4782dad07c51d92884fd0f7c5cb9d3c737bea17ec1bad765f"}, - {file = "marshmallow-3.6.1.tar.gz", hash = "sha256:35ee2fb188f0bd9fc1cf9ac35e45fd394bd1c153cee430745a465ea435514bd5"}, + {file = "marshmallow-3.18.0-py3-none-any.whl", hash = "sha256:35e02a3a06899c9119b785c12a22f4cda361745d66a71ab691fd7610202ae104"}, + {file = "marshmallow-3.18.0.tar.gz", hash = "sha256:6804c16114f7fce1f5b4dadc31f4674af23317fcc7f075da21e35c1a35d781f7"}, ] mkdocs = [ {file = "mkdocs-1.1.2-py3-none-any.whl", hash = "sha256:096f52ff52c02c7e90332d2e53da862fde5c062086e1b5356a6e392d5d60f5e9"}, diff --git a/pyproject.toml b/pyproject.toml index 747da12..5ec70bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ python = "^3.7" beautifultable = ">=1.0.0,<1.1.0" click = "^8.0.0" importlib-resources = ">=1.5.0,<1.6.0" -marshmallow = ">=3.6.1,<3.7.0" +marshmallow = ">=3.0.0" lark-parser = "0.8.5" progressbar2 = ">=3.51.3,<3.52.0" requests = ">=2.23.0,<2.24.0" diff --git a/transient/configuration.py b/transient/configuration.py index caaca5a..8be5b52 100644 --- a/transient/configuration.py +++ b/transient/configuration.py @@ -106,9 +106,9 @@ def arg_to_field(arg: argparse.Action) -> fields.Field: # If this is an append action, we really want a list of these fields if isinstance(arg, argparse._AppendAction) or arg.nargs in ("*", "+"): - return fields.List(field, missing=arg.default, allow_none=True) + return fields.List(field, load_default=arg.default, allow_none=True) - return cast(fields.Field, field(missing=arg.default, allow_none=True)) + return cast(fields.Field, field(load_default=arg.default, allow_none=True)) class_name = "".join([word.capitalize() for word in parser.prog.split()]) + "Schema" return cast(