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

RFE: migrate from flask-babelex to flask-babel #2405

Open
kloczek opened this issue Dec 17, 2023 · 0 comments
Open

RFE: migrate from flask-babelex to flask-babel #2405

kloczek opened this issue Dec 17, 2023 · 0 comments

Comments

@kloczek
Copy link

kloczek commented Dec 17, 2023

flask-babelex is no longer maintained and https://github.com/mrjoes/flask-babelex/ is note:

DEPRECATION WARNING
All Flask-BabelEx features were merged into Flask-Babel and Flask-BabelEx package should no longer be used in your projects. Please migrate.

Currently pytest is using flask-babelex:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-flask-admin-1.6.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-flask-admin-1.6.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1
collected 52 items / 9 errors

==================================== ERRORS ====================================
____________ ERROR collecting flask_admin/tests/geoa/test_basic.py _____________
flask_admin/contrib/geoa/__init__.py:3: in <module>
    import geoalchemy2
E   ModuleNotFoundError: No module named 'geoalchemy2'

During handling of the above exception, another exception occurred:
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:372: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/python.py:536: in collect
    self._inject_setup_module_fixture()
/usr/lib/python3.8/site-packages/_pytest/python.py:550: in _inject_setup_module_fixture
    self.obj, ("setUpModule", "setup_module")
/usr/lib/python3.8/site-packages/_pytest/python.py:315: in obj
    self._obj = obj = self._getobj()
/usr/lib/python3.8/site-packages/_pytest/python.py:533: in _getobj
    return self._importtestmodule()
/usr/lib/python3.8/site-packages/_pytest/python.py:622: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:567: in import_path
    importlib.import_module(module_name)
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
    ???
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:186: in exec_module
    exec(co, module.__dict__)
flask_admin/tests/geoa/test_basic.py:6: in <module>
    from flask_admin.contrib.geoa import ModelView
flask_admin/contrib/geoa/__init__.py:6: in <module>
    raise Exception('Please install geoalchemy2 and shapely in order to use geoalchemy integration')
E   Exception: Please install geoalchemy2 and shapely in order to use geoalchemy integration
_________ ERROR collecting flask_admin/tests/mongoengine/test_basic.py _________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/tests/mongoengine/test_basic.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
flask_admin/tests/mongoengine/__init__.py:3: in <module>
    from flask_mongoengine import MongoEngine
E   ModuleNotFoundError: No module named 'flask_mongoengine'
_________ ERROR collecting flask_admin/tests/peeweemodel/test_basic.py _________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/tests/peeweemodel/test_basic.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
flask_admin/tests/peeweemodel/__init__.py:3: in <module>
    import peewee
E   ModuleNotFoundError: No module named 'peewee'
___________ ERROR collecting flask_admin/tests/pymongo/test_basic.py ___________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/tests/pymongo/test_basic.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
flask_admin/tests/pymongo/__init__.py:1: in <module>
    from pymongo import MongoClient
E   ModuleNotFoundError: No module named 'pymongo'
____________ ERROR collecting flask_admin/tests/sqla/test_basic.py _____________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/tests/sqla/test_basic.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
flask_admin/tests/sqla/test_basic.py:10: in <module>
    from flask_babelex import Babel
E   ModuleNotFoundError: No module named 'flask_babelex'
__________ ERROR collecting flask_admin/tests/sqla/test_form_rules.py __________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/tests/sqla/test_form_rules.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
flask_admin/tests/sqla/test_form_rules.py:2: in <module>
    from .test_basic import CustomModelView, create_models
flask_admin/tests/sqla/test_basic.py:10: in <module>
    from flask_babelex import Babel
E   ModuleNotFoundError: No module named 'flask_babelex'
___________ ERROR collecting flask_admin/tests/sqla/test_multi_pk.py ___________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/tests/sqla/test_multi_pk.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
flask_admin/tests/sqla/test_multi_pk.py:2: in <module>
    from .test_basic import CustomModelView
flask_admin/tests/sqla/test_basic.py:10: in <module>
    from flask_babelex import Babel
E   ModuleNotFoundError: No module named 'flask_babelex'
___________ ERROR collecting flask_admin/tests/sqla/test_postgres.py ___________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/tests/sqla/test_postgres.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
flask_admin/tests/sqla/test_postgres.py:2: in <module>
    from .test_basic import CustomModelView
flask_admin/tests/sqla/test_basic.py:10: in <module>
    from flask_babelex import Babel
E   ModuleNotFoundError: No module named 'flask_babelex'
_________ ERROR collecting flask_admin/tests/sqla/test_translation.py __________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/tests/sqla/test_translation.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
flask_admin/tests/sqla/test_translation.py:2: in <module>
    from flask_babelex import Babel
E   ModuleNotFoundError: No module named 'flask_babelex'
=============================== warnings summary ===============================
flask_admin/contrib/__init__.py:2
  /home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/contrib/__init__.py:2: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    __import__('pkg_resources').declare_namespace(__name__)

../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2868
../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2868
  /usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2868: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

flask_admin/contrib/__init__.py:2
  /home/tkloczko/rpmbuild/BUILD/flask-admin-1.6.1/flask_admin/contrib/__init__.py:2: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('flask_admin.contrib')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    __import__('pkg_resources').declare_namespace(__name__)

../../../../../usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2348
  /usr/lib/python3.8/site-packages/pkg_resources/__init__.py:2348: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('flask_admin')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(parent)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR flask_admin/tests/geoa/test_basic.py - Exception: Please install geoalc...
ERROR flask_admin/tests/mongoengine/test_basic.py
ERROR flask_admin/tests/peeweemodel/test_basic.py
ERROR flask_admin/tests/pymongo/test_basic.py
ERROR flask_admin/tests/sqla/test_basic.py
ERROR flask_admin/tests/sqla/test_form_rules.py
ERROR flask_admin/tests/sqla/test_multi_pk.py
ERROR flask_admin/tests/sqla/test_postgres.py
ERROR flask_admin/tests/sqla/test_translation.py
!!!!!!!!!!!!!!!!!!! Interrupted: 9 errors during collection !!!!!!!!!!!!!!!!!!!!
======================== 5 warnings, 9 errors in 3.58s =========================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant