Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Stop supporting Flask-Babelex #540

Merged
merged 1 commit into from
Dec 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Unreleased
Unreleased

- ``validate_on_submit`` takes a ``extra_validators`` parameters :pr:`479`
- Stop supporting Flask-Babelex :pr:`540`


Version 1.1.0
Expand Down
6 changes: 1 addition & 5 deletions src/flask_wtf/i18n.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
from babel import support
from flask import current_app
from flask import request
from flask_babel import get_locale
from wtforms.i18n import messages_path

try:
from flask_babel import get_locale
except ImportError:
from flask_babelex import get_locale

__all__ = ("Translations", "translations")


Expand Down
9 changes: 2 additions & 7 deletions tests/test_i18n.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

from flask_wtf import FlaskForm

pytest.importorskip(
"flask_wtf.i18n", reason="Neither Flask-Babel nor Flask-BabelEx is installed."
)
pytest.importorskip("flask_wtf.i18n", reason="Flask-Babel is not installed.")


class NameForm(FlaskForm):
Expand All @@ -32,10 +30,7 @@ def test_i18n(app, client):
try:
from flask_babel import Babel
except ImportError:
try:
from flask_babelex import Babel
except ImportError:
pytest.skip("Flask-Babel or Flask-BabelEx must be installed.")
pytest.skip("Flask-Babel must be installed.")

babel = Babel(app)

Expand Down
8 changes: 1 addition & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py3{11,10,9,8,7},pypy3{8,7}
py-{babelex,no-babel}
py-{no-babel}
style
docs

Expand All @@ -12,12 +12,6 @@ deps =
Flask-Uploads
commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}

[testenv:py-babelex]
deps =
-r requirements/tests.txt
Flask-BabelEx
commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}

[testenv:py-no-babel]
deps = -r requirements/tests.txt
commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}
Expand Down