inveniosoftware / flask-breadcrumbs

Flask-Breadcrumbs is a Flask extension that adds support for generating site breadcrumb navigation.
https://flask-breadcrumbs.readthedocs.io
Other
30 stars 23 forks source link

Deprecation warnings with Flask 2.2 #56

Open nblock opened 1 year ago

nblock commented 1 year ago

Runnning the tests on master (539c2ec6ade56c4e4341807cb0f6c26389ac7232) yields deprecation warnings due to Flask 2.2:

============================================================================================================= test session starts =============================================================================================================
platform linux -- Python 3.9.16, pytest-7.2.1, pluggy-1.0.0
cachedir: .tox/py39/.pytest_cache
rootdir: /home/flo/tmp/flask-breadcrumbs
plugins: pep8-1.0.6, cov-4.0.0
collected 9 items                                                                                                                                                                                                                             

tests/test_core.py .........                                                                                                                                                                                                            [100%]

============================================================================================================== warnings summary ===============================================================================================================
tests/test_core.py: 24 warnings
  tmp/flask-breadcrumbs/.tox/py39/lib/python3.9/site-packages/flask/scaffold.py:50: DeprecationWarning: 'before_first_request' is deprecated and will be removed in Flask 2.3. Run setup code while creating the application instead.
    return f(self, *args, **kwargs)

tests/test_core.py: 12 warnings
 tmp/flask-breadcrumbs/.tox/py39/lib/python3.9/site-packages/flask/scaffold.py:50: DeprecationWarning: 'before_app_first_request' is deprecated and will be removed in Flask 2.3. Use 'record_once' instead to run setup code when registering the blueprint.
    return f(self, *args, **kwargs)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================================================= 9 passed, 36 warnings in 0.19s ========================================================================================================
bezborodow commented 1 year ago

This is now broken as of Flask 2.3.0 (pallets/flask#4605):

The app.before_first_request and bp.before_app_first_request decorators are removed.

bezborodow commented 1 year ago

This is caused by inveniosoftware/flask-menu#84.