Skip to content
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

Deprecation warnings #16

Open
ewerx opened this issue Feb 6, 2017 · 2 comments
Open

Deprecation warnings #16

ewerx opened this issue Feb 6, 2017 · 2 comments

Comments

@ewerx
Copy link

ewerx commented Feb 6, 2017

After scaffolding a new app with latest Flask-Diamond (0.5.1), I get these deprecation warnings when running any of the make commands:

SETTINGS=$PWD/etc/conf/testing.conf $(which nosetests) soundtracks -c etc/nose/test.cfg
/Users/ehsan/.virtualenvs/soundtracks/lib/python3.6/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.sqlalchemy is deprecated, use flask_sqlalchemy instead.
  .format(x=modname), ExtDeprecationWarning
/Users/ehsan/.virtualenvs/soundtracks/lib/python3.6/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.script is deprecated, use flask_script instead.
  .format(x=modname), ExtDeprecationWarning
/Users/ehsan/.virtualenvs/soundtracks/lib/python3.6/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.admin is deprecated, use flask_admin instead.
  .format(x=modname), ExtDeprecationWarning
/Users/ehsan/.virtualenvs/soundtracks/lib/python3.6/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.babelex is deprecated, use flask_babelex instead.
  .format(x=modname), ExtDeprecationWarning
/Users/ehsan/.virtualenvs/soundtracks/lib/python3.6/site-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.restful is deprecated, use flask_restful instead.
  .format(x=modname), ExtDeprecationWarning

Is it because the latest Flask is not being used?

@iandennismiller
Copy link
Member

iandennismiller commented Feb 10, 2017

Those deprecation warnings are new with the 0.11.x flask updates. They indicate that some extension is still using the old style of importing, which was import flask.ext.whatever but is now flask_whatever.

I've fixed this almost everywhere, but as your comment demonstrates, there are still remaining old-style imports. I'm honestly not certain where those deprecation warnings originate from, and I'd like some help getting to the bottom of it.

@itamaro
Copy link

itamaro commented Mar 6, 2017

I'm honestly not certain where those deprecation warnings originate from, and I'd like some help getting to the bottom of it.

It's a bit difficult to trace these, with flask.exthook hiding the offending importing module when printing the deprecation warning...

I modified my local flask.exthook to add raise RuntimeError(modname) immediately after it prints the deprecation warning, so I get a full stack trace for every offending import, which makes it feasible to trace these.

My partial results are:

  • Zero issues with Flask-Diamond itself.
  • ~Gazillion issues with flask_admin, importing flask.ext.admin instead of flask_admin
  • A bunch of issues with a few other packages - flask_sqlalchemy, flask_assets, flask_restful

I guess the proper strategy would be to submit issues (and pull requests) to each individual package...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants