Skip to content

Commit b206553

Browse files
committed
Import all funcs in init.
1 parent 793d88b commit b206553

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

.github/workflows/pipeline.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ jobs:
1818
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
1919
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
2020
DOCKER_REPOSITORY: ${{ secrets.DOCKER_REPOSITORY }}
21-

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ repos:
2727
hooks:
2828
- id: black
2929
- repo: https://github.com/astral-sh/ruff-pre-commit
30-
rev: v0.13.2
30+
rev: v0.13.3
3131
hooks:
3232
- id: ruff
3333
types_or: [ python, pyi, jupyter ]

vector_mcp/__init__.py

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,30 @@
11
#!/usr/bin/env python
22
# coding: utf-8
3-
from vector_mcp.vector_mcp import vector_mcp
3+
4+
import importlib
5+
import inspect
6+
7+
# List of modules to import from
8+
MODULES = [
9+
"vector_mcp.vector_mcp",
10+
]
11+
12+
# Initialize __all__ to expose all public classes and functions
13+
__all__ = []
14+
15+
# Dynamically import all classes and functions from the specified modules
16+
for module_name in MODULES:
17+
module = importlib.import_module(module_name)
18+
for name, obj in inspect.getmembers(module):
19+
# Include only classes and functions, excluding private (starting with '_')
20+
if (inspect.isclass(obj) or inspect.isfunction(obj)) and not name.startswith(
21+
"_"
22+
):
23+
globals()[name] = obj
24+
__all__.append(name)
425

526
"""
627
vector-mcp
728
829
Interchangeably use several vector databases as an MCP Server.
930
"""
10-
11-
12-
__all__ = ["vector_mcp"]

0 commit comments

Comments
 (0)