-
Notifications
You must be signed in to change notification settings - Fork 151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bump to webargs 6.0+; drop python 2 and marshmallow 2 compatibility #195
Conversation
Breaking change: in use_kwargs replaced locations:tuple with location:str
Codecov Report
@@ Coverage Diff @@
## master #195 +/- ##
==========================================
- Coverage 97.58% 97.26% -0.32%
==========================================
Files 8 8
Lines 372 366 -6
==========================================
- Hits 363 356 -7
- Misses 9 10 +1
Continue to review full report at Codecov.
|
Thanks! Looks like a great start. I probably won't be able to take a deep look at this until the weekend, but others using this project should feel welcome to review this |
Hello @sloria had you the opportunity to review the PR?
I was thinking again about the 4 tests that I'm unable to make work... Since they are all multiple use_kwargs che motivation is here: marshmallow-code/webargs#267 Now unknown fields are raised by default and so all multiple schemas on the same location will start to fail. To make a quick test I changed this:
into this:
Is there a way to directly define the unknown as decorator parameter? i.e. something like:
I may change the tests by setting all multiple schemas with unknown=EXCLUDE to make all tests to work but maybe you want to add more tests to cover all possible combinations of multiple schemas. Two schemas should success if both set with unknown=EXCLUDE (or INCLUDE) or if set on different locations. All other cases should fail |
Sorry I haven't had a chance to look at this more closely yet. Thank you for continuing to work on it.
No, it needs to be set on the schema. I think your plan to set |
Inputs converted from dict to schemas with Meta.unknown=EXCLUDE
Ok, it is done. Re-included the 4 tests on multiple schemas Now all tests are running. Let me know if I can contribute with something more |
Ops, tests fail on Marshmallow 2.13.0, due to this import:
We have to bump the minimum marshmallow version from 2.0.0 to something more... May you suggest me the correct version? Maybe 3.0.0? |
Tried with several 2.x versions (up to 2.21.0) and none of them work marshmallow 3.0.0 works fine -> changed in both setup.py (from >=2.0.0 to >=3.0.0) and travis (from 2.13.0 to 3.0.0) |
Yeah, I think bumping marshmallow to |
…XCLUDE used during tests
…mcarp#195) * Compatibility fix to bump webargs requirement to 6.0+ Breaking change: in use_kwargs replaced locations:tuple with location:str * Dropped compatibility with python 2 * Bug fix * Restored tests on multiple schemas Inputs converted from dict to schemas with Meta.unknown=EXCLUDE * Bump marshmallow minimum version from 2.0.0 to 3.0.0 * Added a comment to explain the introduction of schemas in unknown = EXCLUDE used during tests * Run pyupgrade Co-authored-by: Steven Loria <sloria1@gmail.com>
Details for this PR are reported in #178
Basically:
changed the
locations
parameter inuse_kwargs
to reflect changes in webargs 6.0.0+ =>locations:tuple -> location:str
Fixed tests to add a
location
when missing (due to default location changed in webargs, now an explicit location is required more than before)Dropped compatibility with python2 (removed six, conditional requirements in setup, replaced Classifiers with python_requires, removed # -- coding: utf-8 --, and other small changes).
Open issue: I'm unable to make 4 tests to work, all have multiple use_kwargs. At the moment these tests are commented in test_views.py (Added a "# I'M UNABLE TO MAKE THIS WORK" comment to mark them) to let other tests on complete.