Closed klauer closed 1 year ago
I think this was user error (PATH
was finding the wrong Python)
That said, it still should be in our dev-requirements in my opinion
I think this is actually a dependency / component of pymongo
, in which case pymongo instructs us to explicitly not install bson from pypi or otherwise https://github.com/mongodb/mongo-python-driver/blob/master/pyproject.toml#installation (pymongo packages/vendors a version of bson)
Oh, huh... Good catch! I think it might be wise to have a commented-out version of "bson" in our requirements making note of that. It'd be rather easy to forget the reason
100% agreed, this is quite the strange edge case
On that note it'd probably be good to raise something different if bson isn't found "ImportError: bson" is weird when you import the mongo backend. Something like: raise ImportError("Optional dependency mongodb not found; the mongodb backend is unavailable")
Given that bson
is supposed to come with pymongo I'm a little confused about why it didn't make it into your environment though...
Given that
bson
is supposed to come with pymongo I'm a little confused about why it didn't make it into your environment though...
User error 😁 Sometimes my fancy development environment is too magical even for me...
Expected Behavior
Any import which is directly imported should be represented in our
requirements.txt
for package-wide requirements ordev-requirements.txt
for "full functionality" with optional dependencies (such as here in the mongo backend)bson
is used in the (optional) mongo backend ~so it should be adev-requirement
~ (see below)Current Behavior
bson
is used in the mongo backend but is not listed as a requirement anywhere. ~It's likely assumed to come from a dependency-of-a-dependency.~ (It's a vendored dep from mongo per Robert below)Possible Solution
Steps to Reproduce (for bugs)
Without mongo installed, the backend fails with this first:
Context
Testing Python 3.11-related issues
Your Environment
OSX + conda