Skip to content

Commit

Permalink
Merge pull request #586 from wtforms/ext-deprecation
Browse files Browse the repository at this point in the history
consistent deprecation warnings for ext modules
  • Loading branch information
davidism committed Apr 22, 2020
2 parents 4f4f079 + d903cc2 commit 20af48f
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 14 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Version 2.3.1

Unreleased

- All modules in ``wtforms.ext`` show a deprecation warning on import.
They will be removed in version 3.0.
- Fixed a bug when :class:`~wtforms.fields.core.SelectField` choices
is ``None``. :issue:`572, 585`
- Restored :class:`~widgets.core.HTMLString` and
Expand Down
8 changes: 4 additions & 4 deletions wtforms/ext/appengine/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import warnings

warnings.warn(
'wtforms.ext.appengine is deprecated, and will be removed in WTForms 3.0. '
'The package has been split out into its own package, wtforms-appengine: '
'https://github.com/wtforms/wtforms-appengine ',
DeprecationWarning
"'wtforms.ext.appengine' will be removed in WTForms 3.0. Use"
" wtforms-appengine instead."
" https://github.com/wtforms/wtforms-appengine",
DeprecationWarning,
)
8 changes: 8 additions & 0 deletions wtforms/ext/csrf/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
import warnings

from wtforms.ext.csrf.form import SecureForm

warnings.warn(
"'wtforms.ext.csrf' will be removed in WTForms 3.0. It is built-in"
" to WTForms core now.",
DeprecationWarning,
)
6 changes: 6 additions & 0 deletions wtforms/ext/dateutil/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import warnings

warnings.warn(
"'wtforms.ext.dateutil' will be removed in WTForms 3.0.",
DeprecationWarning,
)
8 changes: 4 additions & 4 deletions wtforms/ext/django/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import warnings

warnings.warn(
'wtforms.ext.django is deprecated, and will be removed in WTForms 3.0. '
'The package has been split out into its own package, wtforms-django: '
'https://github.com/wtforms/wtforms-django',
DeprecationWarning
"'wtforms.ext.django' will be removed in WTForms 3.0. Use"
" wtforms-django instead."
" https://github.com/wtforms/wtforms-django",
DeprecationWarning,
)
7 changes: 7 additions & 0 deletions wtforms/ext/i18n/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import warnings

warnings.warn(
"'wtforms.ext.i18n' will be removed in WTForms 3.0. It is built-in"
" to WTForms core now.",
DeprecationWarning,
)
11 changes: 5 additions & 6 deletions wtforms/ext/sqlalchemy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import warnings

warnings.warn(
'wtforms.ext.sqlalchemy is deprecated, and will be removed in WTForms 3.0. '
'The package has been extracted to a separate package wtforms_sqlalchemy: '
'https://github.com/wtforms/wtforms-sqlalchemy .\n'
'Or alternately, check out the WTForms-Alchemy package which provides declarative mapping and more: '
'https://github.com/kvesteri/wtforms-alchemy',
DeprecationWarning
"'wtforms.ext.sqlalchemy' will be removed in WTForms 3.0. Use"
" WTForms-SQLAlchemy https://github.com/wtforms/wtforms-sqlalchemy"
" or WTForms-Alchemy https://github.com/kvesteri/wtforms-alchemy"
" instead.",
DeprecationWarning,
)

0 comments on commit 20af48f

Please sign in to comment.