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

DOC: explain bson dependency to avoid confusion #333

Merged
merged 2 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conda-recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ requirements:
run-constrained:
- psdm_qs_cli >=0.3.1
- pymongo >=4.0.2
# - bson # bson is vendored by pymongo, and should not be installed separately

test:
commands:
Expand Down
2 changes: 2 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ipython
matplotlib >=3.2.0
ophyd >=1.5.0
pymongo
# bson is vendored by pymongo, and should not be installed separately
# bson
pcdsutils
pcdsdevices
mongomock >=3.22.0
Expand Down
23 changes: 23 additions & 0 deletions docs/source/upcoming_release_notes/333-doc_bson_not_req.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
333 doc_bson_not_req
####################

API Changes
-----------
- N/A

Features
--------
- N/A

Bugfixes
--------
- N/A

Maintenance
-----------
- Documents bson dependency. Bson is vendored by pymongo, which instructs
users to not install bson from pypi (`pymongo readme <https://github.com/mongodb/mongo-python-driver/tree/master#installation>`)

Contributors
------------
- tangkong
7 changes: 6 additions & 1 deletion happi/backends/mongo_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@
import re
from typing import Any, Optional, Union

import bson.regex
from pymongo import MongoClient
from pymongo.errors import OperationFailure, ServerSelectionTimeoutError

from ..errors import DatabaseError, DuplicateError, SearchError
from .core import ItemMeta, ItemMetaGen, _Backend

try:
import bson.regex
except ImportError:
raise ImportError('Optional dependency mongodb not found; mongodb backend'
'is not available. (bson not found)')

logger = logging.getLogger(__name__)


Expand Down