Skip to content

Commit 6690fe4

Browse files
authored
Merge pull request #3 from UMass-Rescue/rescubox-flaskml-conformant
Rescuebox flaskml conformant
2 parents 824b37c + 3c81cae commit 6690fe4

File tree

20 files changed

+2926
-475
lines changed

20 files changed

+2926
-475
lines changed

.gitignore

+8-1
Original file line numberDiff line numberDiff line change
@@ -160,4 +160,11 @@ cython_debug/
160160
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
161161
#.idea/
162162

163-
.ruff_cache/
163+
.ruff_cache/
164+
165+
# project specific file ignores
166+
rescuebox/bin/
167+
rescuebox/lib/
168+
rescuebox/pyvenv.cfg
169+
src/rb-api/rb/api/static/index/main.js
170+
**/*/.DS_Store

poetry.lock

+1,070-320
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

+6
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,18 @@ requests = "^2.32.3"
1313
python = ">=3.11,<3.13"
1414
pyyaml = "^6.0.2"
1515
typer = "^0.12.5"
16+
llvmlite = "^0.44.0"
17+
numba = "^0.61.0"
1618

1719
rb-lib = { path = "src/rb-lib", develop = true }
1820

1921
rb-file-utils = { path = "src/rb-file-utils", develop = true }
2022
rb-doc-parser = { path = "src/rb-doc-parser", develop = true }
23+
rb-audio-transcription = { path = "src/rb-audio-transcription", develop = true }
2124

2225
# Don't add new packages here, add them appropriately in the list above
26+
torch = "2.2.2"
27+
numpy = "1.26.4"
2328

2429

2530
[tool.poetry.group.dev.dependencies]
@@ -36,6 +41,7 @@ rb-api = { path = "src/rb-api", develop = true }
3641
pyinstaller = "^5.13.2"
3742

3843

44+
3945
[build-system]
4046
requires = ["poetry-core"]
4147
build-backend = "poetry.core.masonry.api"

rescuebox/main.py

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
from importlib.metadata import version
2-
32
import typer
43
from rich import print
54

6-
from rescuebox.plugins import plugins
7-
85
app = typer.Typer()
9-
106
management_app = typer.Typer()
11-
127
__version__ = version("rescuebox")
138

149

@@ -27,6 +22,7 @@ def list_plugins() -> list[str]:
2722
"""
2823
List all plugins
2924
"""
25+
from rescuebox.plugins import plugins # Lazy Import
3026
print("Plugins:")
3127
plugin_list = []
3228
for plugin in plugins:
@@ -37,5 +33,14 @@ def list_plugins() -> list[str]:
3733

3834
app.add_typer(management_app, name="manage")
3935

36+
37+
# Delay plugin loading to avoid circular import
38+
def load_plugins():
39+
from rescuebox.plugins import plugins # Import from __init__.py now
40+
return plugins
41+
42+
43+
plugins = load_plugins()
44+
4045
for plugin in plugins:
4146
app.add_typer(plugin.app, name=plugin.cli_name)
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
from dataclasses import dataclass
2-
32
import typer
3+
4+
# Import plugin modules
45
from rb_doc_parser.main import app as rb_doc_parser_app # type: ignore
56
from rb_file_utils.main import app as rb_file_utils_app # type: ignore
7+
from rb_audio_transcription.main import app as rb_audio_transcription_app # type: ignore
68

79

810
@dataclass(frozen=True)
@@ -12,8 +14,12 @@ class RescueBoxPlugin:
1214
full_name: str | None
1315

1416

15-
# Add plugins here
17+
# Define plugins here (NOT dynamically in main.py)
1618
plugins: list[RescueBoxPlugin] = [
1719
RescueBoxPlugin(rb_file_utils_app, "fs", "File Utils"),
1820
RescueBoxPlugin(rb_doc_parser_app, "docs", "Docs Utils"),
21+
RescueBoxPlugin(rb_audio_transcription_app, "audio", "Audio transcription library"),
1922
]
23+
24+
# Ensure this module is importable
25+
__all__ = ["plugins"]

0 commit comments

Comments
 (0)