-
-
Notifications
You must be signed in to change notification settings - Fork 129
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
Update dependencies and add tests for empty file field #552
Conversation
flask-marshmallow==1.2.1
and add tests
requirements/min-versions.in
Outdated
@@ -1,10 +1,10 @@ | |||
# minimum install requirements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need to update this file. This file kept the minimal version supported by APIFlask and will only be used in testing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I don't update this file, the new test will fail.
rv = client.post(
'/',
data={
'image': '',
},
content_type='multipart/form-data'
)
> assert rv.status_code == 200
E assert 422 == 200
E +422
E -200
tests/test_fields.py:54: AssertionError
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can skip this test based on the version of flask-marshmallow. Example:
apiflask/examples/test_examples.py
Line 118 in 4992f8e
@pytest.mark.skipif(flask_sqlalchemy.__version__ < '3', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
flask_marshmallow
has no attribute __version__
. I'll make a pr for it.
AttributeError: module 'flask_marshmallow' has no attribute '__version__'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use importlib.metadata
:
>>> from importlib.metadata import version
>>> version('flask')
'2.3.3'
>>> version('flask-marshmallow')
'0.15.0'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, could you help update the reference of flask_sqlalchemy.__version__
and change to use importlib.metadata.version
?
flask-marshmallow==1.2.1
and add testsf9b3a5a
to
75424ff
Compare
Why did you revert the changes to the requirement files? It's fine to update them (except the |
Because in the end no dependencies are updated. |
Pin flask-marshmallow==1.2.1 for two important bug fixes below:Pin flask==2.2.0 and werkzeug==2.2.0 because flask-marshmallow updated min version of flask.Pin Flask-HTTPAuth==4.4.0 becausesafe_str_cmp
is deprecated and has been removed inWerkzeug 2.1
.Update flake8 hook to 7.0.0 to be compatible with
python3.12
.Add a test for empty file field.