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

CI tests error with astropy 6.0 #273

Open
olebole opened this issue Nov 28, 2023 · 1 comment
Open

CI tests error with astropy 6.0 #273

olebole opened this issue Nov 28, 2023 · 1 comment

Comments

@olebole
Copy link
Contributor

olebole commented Nov 28, 2023

With Astropy 6.0, two CI tests produce an error:

______ ERROR collecting density_estimation/tests/test_bayesian_blocks.py _______
ImportError while importing test module '/usr/lib/python3/dist-packages/astroML/density_estimation/tests/test_bayesian_blocks.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
/usr/lib/python3/dist-packages/astroML/density_estimation/tests/test_bayesian_blocks.py:4: in <module>
    from astropy.tests.helper import catch_warnings
E   ImportError: cannot import name 'catch_warnings' from 'astropy.tests.helper' (/usr/lib/python3/dist-packages/astropy/tests/helper.py)
_______ ERROR collecting density_estimation/tests/test_hist_binwidth.py ________
ImportError while importing test module '/usr/lib/python3/dist-packages/astroML/density_estimation/tests/test_hist_binwidth.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.11/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
/usr/lib/python3/dist-packages/astroML/density_estimation/tests/test_hist_binwidth.py:4: in <module>
    from astropy.tests.helper import catch_warnings
E   ImportError: cannot import name 'catch_warnings' from 'astropy.tests.helper' (/usr/lib/python3/dist-packages/astropy/tests/helper.py)

Full test log

Reason is that astropy.tests.helper.catch_warnings was deprecated in Astropy 5.1 and removed in Astropy 6.0:

  • Removed deprecated deprecation, warning, and exception handling functionality provided by astropy.tests.helper. [#14670]
@Hellseher
Copy link

Hi,

Same issue after updating dependencies chain in Guix for astropy to 6.0.0.

==================================== ERRORS ====================================
__ ERROR collecting astroML/density_estimation/tests/test_bayesian_blocks.py ___
astroML/density_estimation/tests/test_bayesian_blocks.py:4: in <module>
    from astropy.tests.helper import catch_warnings
E   ImportError: cannot import name 'catch_warnings' from 'astropy.tests.helper' (/gnu/store/2liyf9z60gdpzl4kf0sqz06yn070vhjx-python-astropy-6.0.0/lib/python3.10/site-packages/astropy/tests/helper.py)
__ ERROR collecting astroML/density_estimation/tests/test_bayesian_blocks.py ___
ImportError while importing test module '/tmp/guix-build-python-astroml-1.0.2.post1.drv-0/astroML-1.0.2.post1/astroML/density_estimation/tests/test_bayesian_blocks.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/gnu/store/qzx9n7452cw0w11c96gvijdnmk6v82m2-python-pytest-7.1.3/lib/python3.10/site-packages/_pytest/python.py:608: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/gnu/store/qzx9n7452cw0w11c96gvijdnmk6v82m2-python-pytest-7.1.3/lib/python3.10/site-packages/_pytest/pathlib.py:533: in import_path
    importlib.import_module(module_name)
/gnu/store/4r7k7ipiaqkdf4lmnxwmbz0wx2yzygzc-python-3.10.7/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/gnu/store/qzx9n7452cw0w11c96gvijdnmk6v82m2-python-pytest-7.1.3/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
    exec(co, module.__dict__)
astroML/density_estimation/tests/test_bayesian_blocks.py:4: in <module>
    from astropy.tests.helper import catch_warnings
E   ImportError: cannot import name 'catch_warnings' from 'astropy.tests.helper' (/gnu/store/2liyf9z60gdpzl4kf0sqz06yn070vhjx-python-astropy-6.0.0/lib/python3.10/site-packages/astropy/tests/helper.py)
___ ERROR collecting astroML/density_estimation/tests/test_hist_binwidth.py ____
astroML/density_estimation/tests/test_hist_binwidth.py:4: in <module>
    from astropy.tests.helper import catch_warnings
E   ImportError: cannot import name 'catch_warnings' from 'astropy.tests.helper' (/gnu/store/2liyf9z60gdpzl4kf0sqz06yn070vhjx-python-astropy-6.0.0/lib/python3.10/site-packages/astropy/tests/helper.py)
___ ERROR collecting astroML/density_estimation/tests/test_hist_binwidth.py ____
ImportError while importing test module '/tmp/guix-build-python-astroml-1.0.2.post1.drv-0/astroML-1.0.2.post1/astroML/density_estimation/tests/test_hist_binwidth.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/gnu/store/qzx9n7452cw0w11c96gvijdnmk6v82m2-python-pytest-7.1.3/lib/python3.10/site-packages/_pytest/python.py:608: in _importtestmodule
    mod = import_path(self.path, mode=importmode, root=self.config.rootpath)
/gnu/store/qzx9n7452cw0w11c96gvijdnmk6v82m2-python-pytest-7.1.3/lib/python3.10/site-packages/_pytest/pathlib.py:533: in import_path
    importlib.import_module(module_name)
/gnu/store/4r7k7ipiaqkdf4lmnxwmbz0wx2yzygzc-python-3.10.7/lib/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
    ???
<frozen importlib._bootstrap>:1027: in _find_and_load
    ???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:688: in _load_unlocked
    ???
/gnu/store/qzx9n7452cw0w11c96gvijdnmk6v82m2-python-pytest-7.1.3/lib/python3.10/site-packages/_pytest/assertion/rewrite.py:168: in exec_module
    exec(co, module.__dict__)
astroML/density_estimation/tests/test_hist_binwidth.py:4: in <module>
    from astropy.tests.helper import catch_warnings
E   ImportError: cannot import name 'catch_warnings' from 'astropy.tests.helper' (/gnu/store/2liyf9z60gdpzl4kf0sqz06yn070vhjx-python-astropy-6.0.0/lib/python3.10/site-packages/astropy/tests/helper.py)

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

2 participants