Closed dairiki closed 2 years ago
Wow, great ! But it looks like the tests still fail in the ci
Wow, great ! But it looks like the tests still fail in the ci
Of course they do! LOL
I've fixed things again so that they now pass. I had to include the changes from #207 to get that to happen. I've updated my original description of this PR to match what's currently in it.
@lovasoa: Do you want to continue support for python 3.6 (EOL 2021-12), or can that be cleaned out?
Thank you very much @dairiki and @vit-zikmund :)
For python 3.6, it looks like there still are hundreds of daily downloads of marshmallow-dataclass with this python version: https://pypistats.org/packages/marshmallow-dataclass
But eventually, when python 3.6 becomes too much of a burden to support, and there are fewer daily downloads, we'll drop support, yes :)
(This PR in an alternative to #209 and also includes #207.)
Main Changes
Explicitly add pytest’s rootdir to
MYPYPYTHONPATH in our mypy tests.This helps mypy find marshmallow_dataclass when it is installed in editable mode. (Ref #209, #207.)
Do not fail tests upon warnings from external dependencies
We were configuring pytest with
-W error
. This means tests failed if any warning was emitted by any dependency. (E.g.marshmallow<3.15
elicits a warning from its use ofdistutils
.)Here we update the warning filter so that we only fail on warnings from
marshmallow_dataclass
or our tests.Other warnings will still be reported by
pytest
but will not cause our tests to fail.Other Changes
In order to get the CI tests to pass, we also cherry-pick PR #207 from @vit-zikmund
To get pre-commit checks to pass, we update the type of the second parameter to
Union._serialize
to match changes made toField._serialize
typing in marshmallow 3.18.0. (This keeps the pre-commit mypy check from failing due to "Liskov substitution principle" violation.)Finally, we update the --target-version config for black (though I'm not sure that this makes any practical difference.)