py-bson / bson

Independent BSON codec for Python that doesn't depend on MongoDB.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

0.5.10: use of `bson` module fails with `cannot import name 'CodecOptions' from 'bson' `

kloczek opened this issue · comments

After package bson I've started using it on building and testing cattrs.

cattrs test suite fails with:

r/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/cattrs-22.2.0
configfile: pyproject.toml
plugins: hypothesis-6.72.4
collected 264 items / 1 error

========================================================================================== ERRORS ===========================================================================================
__________________________________________________________________________ ERROR collecting tests/test_preconf.py ___________________________________________________________________________
ImportError while importing test module '/home/tkloczko/rpmbuild/BUILD/cattrs-22.2.0/tests/test_preconf.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)
tests/test_preconf.py:10: in <module>
    from bson import CodecOptions, ObjectId
E   ImportError: cannot import name 'CodecOptions' from 'bson' (/usr/lib/python3.8/site-packages/bson/__init__.py)
================================================================================== short test summary info ==================================================================================
ERROR tests/test_preconf.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================================================================== 1 error in 0.69s ======================================================================================