flask_accepts icon indicating copy to clipboard operation
flask_accepts copied to clipboard

Resolve marshmallow deprecation warning and support marshmallow 4.0

Open kreathon opened this issue 3 years ago • 7 comments

Proposal for https://github.com/apryor6/flask_accepts/issues/116.

kreathon avatar Jan 14 '22 18:01 kreathon

Codecov Report

Merging #117 (0e4606c) into master (0556746) will decrease coverage by 0.14%. The diff coverage is 84.61%.

:exclamation: Current head 0e4606c differs from pull request most recent head 1790d39. Consider uploading reports for the commit 1790d39 to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##           master     #117      +/-   ##
==========================================
- Coverage   98.44%   98.29%   -0.15%     
==========================================
  Files           7        7              
  Lines        1285     1291       +6     
==========================================
+ Hits         1265     1269       +4     
- Misses         20       22       +2     
Impacted Files Coverage Δ
flask_accepts/utils.py 97.87% <80.00%> (-2.13%) :arrow_down:
flask_accepts/utils_test.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0556746...1790d39. Read the comment docs.

codecov-commenter avatar Jan 14 '22 18:01 codecov-commenter

I am not sure how to handle the test coverage decrease.

Proper testing could involve running multiple tox environments and merging the coverage reports.

kreathon avatar Jan 14 '22 18:01 kreathon

Alternatively, marshmallow could be pinned to <4.0 for now.

kreathon avatar Jan 14 '22 19:01 kreathon

@kreathon did you get this resolved? I would like to use flask_accepts with marshmallow 4 in my project

The issue looks to be here:

if marshmallow_version >= (3, 13, 0):
    _ma_key_for_fr_example_key = "dump_default"
    _ma_key_for_fr_default_key = "load_default"
else:
    _ma_key_for_fr_example_key = "default"
    _ma_key_for_fr_default_key = "missing"

where the lines after the else look to be ignored? maybe something like this would work for the code coverage instead?


_ma_key_for_fr_example_key = "dump_default"
_ma_key_for_fr_default_key = "load_default"
if marshmallow_version < (3, 13, 0):
    _ma_key_for_fr_example_key = "default"
    _ma_key_for_fr_default_key = "missing"

I would be interested to know if this works?

@apryor6 can you provide any additional feedback? Additionally how do we run the code coverage tests locally please?

circulon avatar Jul 26 '22 00:07 circulon

@circulon, you can check the .circleci/config.yml to see how to run the code coverage tests locally.

But my fear is that this project is dead (and it is not about coverage)

kreathon avatar Jul 26 '22 16:07 kreathon

But my fear is that this project is dead (and it is not about coverage)

Bugger ;(

@kreathon are you working with or know of any other projects that are active and provide similar functionality?

Cheers

circulon avatar Jul 27 '22 03:07 circulon

@circulon I don't know. Personally, I am now sticking to plain Marshmallow.

kreathon avatar Jul 27 '22 04:07 kreathon