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

Tests fail: cannot import name 'model' from partially initialized module 'kimpy' #16

Open
yurivict opened this issue Oct 7, 2022 · 1 comment

Comments

@yurivict
Copy link

yurivict commented Oct 7, 2022

===>  Testing for py39-kimpy-2.0.1
===>   py39-kimpy-2.0.1 depends on package: py39-pytest>=7,1 - found
===>   py39-kimpy-2.0.1 depends on file: /usr/local/bin/python3.9 - found
cd /disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1 && /usr/bin/env XDG_DATA_HOME=/disk-samsung/freebsd-ports/science/py-kimpy/work-py39  XDG_CONFIG_HOME=/disk-samsung/freebsd-ports/science/py-kimpy/work-py39  XDG_CACHE_HOME=/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/.cache  HOME=/disk-samsung/freebsd-ports/science/py-kimpy/work-py39 PATH=/usr/local/libexec/ccache:/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin PKG_CONFIG_LIBDIR=/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/.pkgconfig:/usr/local/libdata/pkgconfig:/usr/local/share/pkgconfig:/usr/libdata/pkgconfig NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES LDSHARED="cc -shared" PYTHONDONTWRITEBYTECODE= PYTHONOPTIMIZE= PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-fno-omit-frame-pointer"  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  MANPREFIX="/usr/local" CCACHE_DIR="/tmp/.ccache" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" PYTHONPATH=/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/stage/usr/local/lib/python3.9/site-packages /usr/local/bin/python3.9 -m pytest -k '' -rs -v -o addopts= 
==================================================================================== test session starts =====================================================================================
platform freebsd13 -- Python 3.9.13, pytest-7.1.3, pluggy-1.0.0 -- /usr/local/bin/python3.9
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/.hypothesis/examples')
rootdir: /disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1
plugins: forked-1.4.0, hypothesis-6.55.0, cov-2.9.0, rerunfailures-10.1, xdist-2.5.0, typeguard-2.13.3
collected 0 items / 21 errors                                                                                                                                                                

=========================================================================================== ERRORS ===========================================================================================
__________________________________________________________________________ ERROR collecting tests/test_callbacks.py __________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_callbacks.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_callbacks.py:18: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
_________________________________________________________________________ ERROR collecting tests/test_charge_unit.py _________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_charge_unit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_charge_unit.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
_________________________________________________________________________ ERROR collecting tests/test_collection.py __________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_collection.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_collection.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
____________________________________________________________________ ERROR collecting tests/test_collection_item_type.py _____________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_collection_item_type.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_collection_item_type.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
____________________________________________________________________ ERROR collecting tests/test_compute_argument_name.py ____________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_compute_argument_name.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compute_argument_name.py:1: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
____________________________________________________________________ ERROR collecting tests/test_compute_callback_name.py ____________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_compute_callback_name.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_compute_callback_name.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
__________________________________________________________________________ ERROR collecting tests/test_data_type.py __________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_data_type.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_data_type.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
_________________________________________________________________________ ERROR collecting tests/test_energy_unit.py _________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_energy_unit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_energy_unit.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
________________________________________________________________________ ERROR collecting tests/test_language_name.py ________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_language_name.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_language_name.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
_________________________________________________________________________ ERROR collecting tests/test_length_unit.py _________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_length_unit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_length_unit.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
________________________________________________________________________ ERROR collecting tests/test_log_verbosity.py ________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_log_verbosity.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_log_verbosity.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
____________________________________________________________________________ ERROR collecting tests/test_model.py ____________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_model.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_model.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
_____________________________________________________________________ ERROR collecting tests/test_model_neigh_library.py _____________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_model_neigh_library.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_model_neigh_library.py:2: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
_____________________________________________________________________ ERROR collecting tests/test_model_routine_name.py ______________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_model_routine_name.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_model_routine_name.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
__________________________________________________________________________ ERROR collecting tests/test_numbering.py __________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_numbering.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_numbering.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
___________________________________________________________________________ ERROR collecting tests/test_sem_ver.py ___________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_sem_ver.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_sem_ver.py:1: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
________________________________________________________________________ ERROR collecting tests/test_species_name.py _________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_species_name.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_species_name.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
_______________________________________________________________________ ERROR collecting tests/test_support_status.py ________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_support_status.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_support_status.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
______________________________________________________________________ ERROR collecting tests/test_temperature_unit.py _______________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_temperature_unit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_temperature_unit.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
__________________________________________________________________________ ERROR collecting tests/test_time_unit.py __________________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/test_time_unit.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/test_time_unit.py:3: in <module>
    import kimpy
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
_____________________________________________________________________ ERROR collecting tests/neighlist/test_graphite.py ______________________________________________________________________
ImportError while importing test module '/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/tests/neighlist/test_graphite.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
tests/neighlist/test_graphite.py:4: in <module>
    from kimpy import neighlist as nl
kimpy/__init__.py:4: in <module>
    from . import model
E   ImportError: cannot import name 'model' from partially initialized module 'kimpy' (most likely due to a circular import) (/disk-samsung/freebsd-ports/science/py-kimpy/work-py39/kimpy-2.0.1/kimpy/__init__.py)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 21 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 21 errors in 0.97s =====================================================================================
*** Error code 2

Version: 2.0.1
Python 3.9
FreeBSD 13.1 STABLE

@mjwen
Copy link
Collaborator

mjwen commented Nov 6, 2022

I tried python -m pytest -k '' -rs -v -o addopts= (this is basically the command in line 4 of the stack trace) on my Mac and openSUSE systems, and both worked. So, it's not clear to me why the partial initialization error happens.

Anyway, as mentioned in #17, now test dependencies like pytest and ase can be installed via pip install .[test]. @yurivict can you try the latest devel branch to see whether the errors are still there?

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