Skip to content

Commit

Permalink
fix: optional dependency imports
Browse files Browse the repository at this point in the history
Signed-off-by: Avik Basu <[email protected]>
  • Loading branch information
ab93 committed May 9, 2023
1 parent 8086db1 commit 54cffe3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
25 changes: 14 additions & 11 deletions numalogic/registry/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,20 @@
from numalogic.registry.artifact import ArtifactManager, ArtifactData, ArtifactCache
from numalogic.registry.localcache import LocalLRUCache


__all__ = ["ArtifactManager", "ArtifactData", "ArtifactCache", "LocalLRUCache"]


try:
from numalogic.registry.mlflow_registry import MLflowRegistry # noqa: F401
except ImportError:
pass
else:
__all__.append("MLflowRegistry")

try:
from numalogic.registry.mlflow_registry import MLflowRegistry
from numalogic.registry.redis_registry import RedisRegistry
from numalogic.registry.redis_registry import RedisRegistry # noqa: F401
except ImportError:
__all__ = ["ArtifactManager", "ArtifactData", "ArtifactCache", "LocalLRUCache"]
pass
else:
__all__ = [
"ArtifactManager",
"ArtifactData",
"MLflowRegistry",
"ArtifactCache",
"LocalLRUCache",
"RedisRegistry",
]
__all__.append("RedisRegistry")
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "numalogic"
version = "0.4.dev4"
version = "0.4.dev5"
description = "Collection of operational Machine Learning models and tools."
authors = ["Numalogic Developers"]
packages = [{ include = "numalogic" }]
Expand Down Expand Up @@ -92,7 +92,7 @@ exclude = '''
line-length = 100
src = ["numalogic", "tests"]
select = ["E", "F", "W", "C901", "NPY", "RUF", "TRY", "G", "PLE", "PLW", "UP", "ICN", "RET", "Q"]
ignore = ["TRY003", "TRY301"]
ignore = ["TRY003", "TRY301", "RUF100"]
target-version = "py39"
show-fixes = true
show-source = true
Expand Down

0 comments on commit 54cffe3

Please sign in to comment.