Skip to content

Commit

Permalink
bump monty to use deprecated on class; fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rkingsbury committed May 24, 2024
1 parent 92790ac commit 5151881
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ dependencies = [
"pydantic>=2.0",
"pydantic-settings>=2.0.3",
"pymongo>=4.2.0",
"monty>=2023.9.25",
"monty>=2024.5.24",
"mongomock>=3.10.0",
"pydash>=4.1.0",
"jsonschema>=3.1.1",
Expand Down
14 changes: 6 additions & 8 deletions src/maggma/stores/advanced_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
import os
from typing import Dict, Iterator, List, Optional, Tuple, Union

from mongogrant import Client
from mongogrant.client import check
from mongogrant.config import Config
from monty.dev import deprecated, requires

from maggma.core import Sort, Store, StoreError
Expand All @@ -19,11 +16,13 @@
except ImportError:
hvac = None
try:
import mongogrant
from mongogrant import Client
from mongogrant.client import check
from mongogrant.config import Config
except ImportError:
mongogrant = None

Client = None

@deprecated(MongoStore)
class MongograntStore(MongoStore):
"""Initialize a Store with a mongogrant "`<role>`:`<host>`/`<db>`." spec.
Expand All @@ -34,10 +33,9 @@ class MongograntStore(MongoStore):
"""

@requires(
mongogrant is not None,
Client is not None,
"mongogrant is required to use MongoGrantStore. Please run `pip install maggma[mongogrant]",
)
@deprecated(MongoStore, "MongograntStore is deprecated! Use MongoStore instead.")
def __init__(
self,
mongogrant_spec: str,
Expand Down

0 comments on commit 5151881

Please sign in to comment.