AMReX-Codes / pyamrex

GPU-Enabled, Zero-Copy AMReX Python Bindings including AI/ML
http://pyamrex.readthedocs.io
Other
32 stars 15 forks source link

test runner fails when AMReX_SPACEDIM=2 #326

Open BenWibking opened 1 month ago

BenWibking commented 1 month ago

I built the latest development branch as follows, setting AMReX_SPACEDIM=2. The tests fail to run:


$ cmake -S . -B build -DAMReX_SPACEDIM=2
$ cmake --build build -j 4 --target pip_install
$ python3 -m pytest -s -vvvv tests/

ImportError while loading conftest '/Users/benwibking/pyamrex/tests/conftest.py'.
tests/conftest.py:9: in <module>
    import amrex.space3d as amr
../myenv/lib/python3.12/site-packages/amrex/space3d/__init__.py:25: in <module>
    __version__ = amrex_3d_pybind.__version__
E   AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
BenWibking commented 1 month ago

If I comment out this line: https://github.com/AMReX-Codes/pyamrex/blob/ae75b5a7f82ba5a91d5a22a13e3148ac96d8c249/tests/conftest.py#L9 all of the tests fail, since they import amrex.space3d:

======================================================= short test summary info =======================================================
ERROR tests/test_aos.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_array4.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_basefab.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_box.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_coordsys.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_dim3.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_farraybox.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_geometry.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_indextype.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_intvect.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_multifab.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_parmparse.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_particle.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_particleContainer.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_particleTile.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_periodicity.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_podvector.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_realbox.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_realvect.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_soa.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
ERROR tests/test_utility.py - AttributeError: module 'amrex.space3d.amrex_3d_pybind' has no attribute '__version__'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 21 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================= 21 errors in 0.28s ==========================================================
BenWibking commented 1 month ago

This is needed for this PR: https://github.com/AMReX-Codes/pyamrex/pull/320.