mint-sdk 1.0.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mint_sdk-1.0.0a1/.gitignore +102 -0
- mint_sdk-1.0.0a1/PKG-INFO +155 -0
- mint_sdk-1.0.0a1/README.md +124 -0
- mint_sdk-1.0.0a1/pyproject.toml +50 -0
- mint_sdk-1.0.0a1/src/mint_sdk/__init__.py +131 -0
- mint_sdk-1.0.0a1/src/mint_sdk/_discover.py +159 -0
- mint_sdk-1.0.0a1/src/mint_sdk/_prompt.py +228 -0
- mint_sdk-1.0.0a1/src/mint_sdk/_version.py +24 -0
- mint_sdk-1.0.0a1/src/mint_sdk/ai_instructions.md.template +169 -0
- mint_sdk-1.0.0a1/src/mint_sdk/app.py +264 -0
- mint_sdk-1.0.0a1/src/mint_sdk/cli.py +596 -0
- mint_sdk-1.0.0a1/src/mint_sdk/cli_commands/__init__.py +0 -0
- mint_sdk-1.0.0a1/src/mint_sdk/cli_commands/_utils.py +22 -0
- mint_sdk-1.0.0a1/src/mint_sdk/cli_commands/auth_cmd.py +112 -0
- mint_sdk-1.0.0a1/src/mint_sdk/cli_commands/experiment_cmd.py +198 -0
- mint_sdk-1.0.0a1/src/mint_sdk/cli_commands/project_cmd.py +95 -0
- mint_sdk-1.0.0a1/src/mint_sdk/cli_commands/status_cmd.py +68 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/__init__.py +35 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/_config.py +118 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/_exceptions.py +130 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/_http.py +119 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/_types.py +90 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/client.py +125 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/resources/__init__.py +0 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/resources/auth.py +75 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/resources/experiments.py +277 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/resources/plugins.py +18 -0
- mint_sdk-1.0.0a1/src/mint_sdk/client/resources/projects.py +82 -0
- mint_sdk-1.0.0a1/src/mint_sdk/context.py +103 -0
- mint_sdk-1.0.0a1/src/mint_sdk/deps_command.py +271 -0
- mint_sdk-1.0.0a1/src/mint_sdk/dev_command.py +461 -0
- mint_sdk-1.0.0a1/src/mint_sdk/docs/__init__.py +1 -0
- mint_sdk-1.0.0a1/src/mint_sdk/docs/bundled/frontend.json +6845 -0
- mint_sdk-1.0.0a1/src/mint_sdk/docs/cache.py +126 -0
- mint_sdk-1.0.0a1/src/mint_sdk/docs/formatter.py +709 -0
- mint_sdk-1.0.0a1/src/mint_sdk/docs/frontend_extractor.py +79 -0
- mint_sdk-1.0.0a1/src/mint_sdk/docs/python_extractor.py +442 -0
- mint_sdk-1.0.0a1/src/mint_sdk/docs/search.py +137 -0
- mint_sdk-1.0.0a1/src/mint_sdk/docs_command.py +293 -0
- mint_sdk-1.0.0a1/src/mint_sdk/doctor_command.py +276 -0
- mint_sdk-1.0.0a1/src/mint_sdk/exceptions.py +311 -0
- mint_sdk-1.0.0a1/src/mint_sdk/export.py +348 -0
- mint_sdk-1.0.0a1/src/mint_sdk/info_command.py +74 -0
- mint_sdk-1.0.0a1/src/mint_sdk/init_command.py +601 -0
- mint_sdk-1.0.0a1/src/mint_sdk/init_templates.py +968 -0
- mint_sdk-1.0.0a1/src/mint_sdk/link_command.py +218 -0
- mint_sdk-1.0.0a1/src/mint_sdk/local_database.py +163 -0
- mint_sdk-1.0.0a1/src/mint_sdk/logging.py +49 -0
- mint_sdk-1.0.0a1/src/mint_sdk/logs_command.py +137 -0
- mint_sdk-1.0.0a1/src/mint_sdk/migrations/__init__.py +22 -0
- mint_sdk-1.0.0a1/src/mint_sdk/migrations/base.py +54 -0
- mint_sdk-1.0.0a1/src/mint_sdk/migrations/errors.py +54 -0
- mint_sdk-1.0.0a1/src/mint_sdk/migrations/locking.py +64 -0
- mint_sdk-1.0.0a1/src/mint_sdk/migrations/ops.py +302 -0
- mint_sdk-1.0.0a1/src/mint_sdk/migrations/runner.py +313 -0
- mint_sdk-1.0.0a1/src/mint_sdk/models.py +51 -0
- mint_sdk-1.0.0a1/src/mint_sdk/plugin.py +610 -0
- mint_sdk-1.0.0a1/src/mint_sdk/py.typed +0 -0
- mint_sdk-1.0.0a1/src/mint_sdk/remote_context.py +323 -0
- mint_sdk-1.0.0a1/src/mint_sdk/repositories.py +277 -0
- mint_sdk-1.0.0a1/src/mint_sdk/testing/__init__.py +36 -0
- mint_sdk-1.0.0a1/src/mint_sdk/testing/plugins.py +135 -0
- mint_sdk-1.0.0a1/src/mint_sdk/testing/recording_context.py +185 -0
- mint_sdk-1.0.0a1/src/mint_sdk/testing/subprocess.py +88 -0
- mint_sdk-1.0.0a1/src/mint_sdk/update_command.py +260 -0
- mint_sdk-1.0.0a1/tests/__init__.py +0 -0
- mint_sdk-1.0.0a1/tests/conftest.py +22 -0
- mint_sdk-1.0.0a1/tests/test_app.py +159 -0
- mint_sdk-1.0.0a1/tests/test_cli.py +422 -0
- mint_sdk-1.0.0a1/tests/test_cli_typer.py +75 -0
- mint_sdk-1.0.0a1/tests/test_client/__init__.py +0 -0
- mint_sdk-1.0.0a1/tests/test_client/test_auth_api.py +151 -0
- mint_sdk-1.0.0a1/tests/test_client/test_client.py +169 -0
- mint_sdk-1.0.0a1/tests/test_client/test_config.py +112 -0
- mint_sdk-1.0.0a1/tests/test_client/test_exceptions.py +96 -0
- mint_sdk-1.0.0a1/tests/test_client/test_experiments_api.py +308 -0
- mint_sdk-1.0.0a1/tests/test_client/test_http.py +251 -0
- mint_sdk-1.0.0a1/tests/test_dev_command.py +577 -0
- mint_sdk-1.0.0a1/tests/test_discover.py +234 -0
- mint_sdk-1.0.0a1/tests/test_doctor_command.py +173 -0
- mint_sdk-1.0.0a1/tests/test_exceptions.py +169 -0
- mint_sdk-1.0.0a1/tests/test_export.py +301 -0
- mint_sdk-1.0.0a1/tests/test_info_command.py +168 -0
- mint_sdk-1.0.0a1/tests/test_init_command.py +458 -0
- mint_sdk-1.0.0a1/tests/test_link_command.py +311 -0
- mint_sdk-1.0.0a1/tests/test_local_database.py +329 -0
- mint_sdk-1.0.0a1/tests/test_logs_command.py +128 -0
- mint_sdk-1.0.0a1/tests/test_migration_base.py +81 -0
- mint_sdk-1.0.0a1/tests/test_migration_errors.py +40 -0
- mint_sdk-1.0.0a1/tests/test_migration_locking.py +30 -0
- mint_sdk-1.0.0a1/tests/test_migration_ops.py +240 -0
- mint_sdk-1.0.0a1/tests/test_migration_runner.py +196 -0
- mint_sdk-1.0.0a1/tests/test_models.py +58 -0
- mint_sdk-1.0.0a1/tests/test_plugin.py +255 -0
- mint_sdk-1.0.0a1/tests/test_plugin_save_load.py +412 -0
- mint_sdk-1.0.0a1/tests/test_plugin_settings_model.py +304 -0
- mint_sdk-1.0.0a1/tests/test_prompt.py +206 -0
- mint_sdk-1.0.0a1/tests/test_testing.py +285 -0
- mint_sdk-1.0.0a1/uv.lock +514 -0
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
*.so
|
|
6
|
+
.Python
|
|
7
|
+
.venv/
|
|
8
|
+
env/
|
|
9
|
+
venv/
|
|
10
|
+
build/
|
|
11
|
+
dist/
|
|
12
|
+
*.egg-info/
|
|
13
|
+
*.egg
|
|
14
|
+
|
|
15
|
+
# Code Quality Tools
|
|
16
|
+
.ruff_cache/
|
|
17
|
+
.mypy_cache/
|
|
18
|
+
.pytest_cache/
|
|
19
|
+
.coverage
|
|
20
|
+
htmlcov/
|
|
21
|
+
|
|
22
|
+
# Node/Frontend
|
|
23
|
+
node_modules/
|
|
24
|
+
/frontend/dist/
|
|
25
|
+
packages/sdk-frontend/dist/
|
|
26
|
+
npm-debug.log*
|
|
27
|
+
bun-debug.log*
|
|
28
|
+
yarn-debug.log*
|
|
29
|
+
|
|
30
|
+
# TypeScript
|
|
31
|
+
*.tsbuildinfo
|
|
32
|
+
frontend/vite.config.d.ts
|
|
33
|
+
frontend/vite.config.js
|
|
34
|
+
|
|
35
|
+
# IDE/Editor
|
|
36
|
+
.vscode/
|
|
37
|
+
.idea/
|
|
38
|
+
*.swp
|
|
39
|
+
*.swo
|
|
40
|
+
*~
|
|
41
|
+
|
|
42
|
+
# OS
|
|
43
|
+
.DS_Store
|
|
44
|
+
.AppleDouble
|
|
45
|
+
Thumbs.db
|
|
46
|
+
|
|
47
|
+
# Environment
|
|
48
|
+
.env
|
|
49
|
+
.env.local
|
|
50
|
+
.env.*.local
|
|
51
|
+
config.json
|
|
52
|
+
config.dev.toml
|
|
53
|
+
|
|
54
|
+
# SDK Python build
|
|
55
|
+
packages/sdk-python/dist/
|
|
56
|
+
|
|
57
|
+
# hatch-vcs generated version files
|
|
58
|
+
api/_version.py
|
|
59
|
+
packages/sdk-python/src/mld_sdk/_version.py
|
|
60
|
+
|
|
61
|
+
# Histoire
|
|
62
|
+
.histoire/
|
|
63
|
+
|
|
64
|
+
# VitePress cache + synced content
|
|
65
|
+
site/.vitepress/cache/
|
|
66
|
+
site/changelog.md
|
|
67
|
+
|
|
68
|
+
# Database
|
|
69
|
+
data/*.db
|
|
70
|
+
|
|
71
|
+
# MLD CLI runtime data
|
|
72
|
+
.mld/
|
|
73
|
+
|
|
74
|
+
# Claude Code
|
|
75
|
+
.claude/
|
|
76
|
+
|
|
77
|
+
# Playwright E2E
|
|
78
|
+
e2e/playwright-report/
|
|
79
|
+
e2e/test-results/
|
|
80
|
+
e2e/blob-report/
|
|
81
|
+
|
|
82
|
+
# Git Worktrees
|
|
83
|
+
.worktrees/
|
|
84
|
+
|
|
85
|
+
# SDK test/eval artifacts
|
|
86
|
+
packages/sdk-python/mld-init-test/
|
|
87
|
+
skills/mint-sdk-plugin/evals/
|
|
88
|
+
skills/mint-sdk-plugin/mint-sdk-plugin-workspace/
|
|
89
|
+
|
|
90
|
+
# Local plugin development
|
|
91
|
+
mld-ms-planner/
|
|
92
|
+
|
|
93
|
+
# Local data
|
|
94
|
+
data/
|
|
95
|
+
frontend/data/
|
|
96
|
+
.superpowers/
|
|
97
|
+
.omx/
|
|
98
|
+
|
|
99
|
+
# Skill eval/workspace artifacts (post-R-3 paths; old sdk/skill/* patterns
|
|
100
|
+
# above remain until R-3 merges and the rename consolidates)
|
|
101
|
+
skills/mint-sdk-plugin/evals/
|
|
102
|
+
skills/mint-sdk-plugin/mint-sdk-plugin-workspace/
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mint-sdk
|
|
3
|
+
Version: 1.0.0a1
|
|
4
|
+
Summary: MINT Plugin SDK - Build analysis plugins for the MINT (Mass-spec INtegrated Toolkit) platform
|
|
5
|
+
Project-URL: Homepage, https://github.com/MorscherLab/mld
|
|
6
|
+
Project-URL: Documentation, https://github.com/MorscherLab/mld/tree/main/packages/sdk-python#readme
|
|
7
|
+
Project-URL: Repository, https://github.com/MorscherLab/mld
|
|
8
|
+
Author-email: MorscherLab <morscher@chem.ethz.ch>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
|
11
|
+
Classifier: Framework :: FastAPI
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Requires-Python: >=3.12
|
|
17
|
+
Requires-Dist: fastapi>=0.109.0
|
|
18
|
+
Requires-Dist: httpx>=0.28.0
|
|
19
|
+
Requires-Dist: pydantic>=2.0.0
|
|
20
|
+
Requires-Dist: typer>=0.15.0
|
|
21
|
+
Provides-Extra: dev
|
|
22
|
+
Requires-Dist: aiosqlite>=0.19.0; extra == 'dev'
|
|
23
|
+
Requires-Dist: greenlet>=3.0.0; extra == 'dev'
|
|
24
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
|
|
25
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
26
|
+
Requires-Dist: sqlmodel>=0.0.16; extra == 'dev'
|
|
27
|
+
Provides-Extra: local-db
|
|
28
|
+
Requires-Dist: aiosqlite>=0.19.0; extra == 'local-db'
|
|
29
|
+
Requires-Dist: sqlmodel>=0.0.16; extra == 'local-db'
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# MLD SDK (Python)
|
|
33
|
+
|
|
34
|
+
SDK for building analysis plugins that integrate with the MLD platform.
|
|
35
|
+
|
|
36
|
+
> **Full Documentation:** See the [comprehensive docs](../../docs/index.md) for detailed API reference and guides.
|
|
37
|
+
> - [API Reference](../../docs/python/api-reference.md)
|
|
38
|
+
> - [Plugin Development Guide](../../docs/python/plugin-guide.md)
|
|
39
|
+
> - [Exception Handling](../../docs/python/exceptions.md)
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# From PyPI (when published)
|
|
45
|
+
uv add mld-sdk
|
|
46
|
+
|
|
47
|
+
# From git
|
|
48
|
+
uv add git+https://github.com/EstrellaXD/mld#subdirectory=sdk
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Quick Start
|
|
52
|
+
|
|
53
|
+
Create a plugin by implementing the `AnalysisPlugin` interface:
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from mld_sdk import AnalysisPlugin, PluginMetadata, PluginCapabilities
|
|
57
|
+
from fastapi import APIRouter
|
|
58
|
+
|
|
59
|
+
router = APIRouter()
|
|
60
|
+
|
|
61
|
+
@router.get("/hello")
|
|
62
|
+
async def hello():
|
|
63
|
+
return {"message": "Hello from my plugin!"}
|
|
64
|
+
|
|
65
|
+
class MyPlugin(AnalysisPlugin):
|
|
66
|
+
@property
|
|
67
|
+
def metadata(self) -> PluginMetadata:
|
|
68
|
+
return PluginMetadata(
|
|
69
|
+
name="My Plugin",
|
|
70
|
+
version="1.0.0",
|
|
71
|
+
description="My analysis plugin",
|
|
72
|
+
analysis_type="metabolomics",
|
|
73
|
+
routes_prefix="/my-plugin",
|
|
74
|
+
capabilities=PluginCapabilities(
|
|
75
|
+
requires_auth=True,
|
|
76
|
+
requires_experiments=True,
|
|
77
|
+
),
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def get_routers(self):
|
|
81
|
+
return [(router, "")]
|
|
82
|
+
|
|
83
|
+
async def initialize(self, context=None):
|
|
84
|
+
self._context = context
|
|
85
|
+
|
|
86
|
+
async def shutdown(self):
|
|
87
|
+
pass
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Plugin Package Structure
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
mld-plugin-example/
|
|
94
|
+
├── pyproject.toml
|
|
95
|
+
├── README.md
|
|
96
|
+
└── src/mld_plugin_example/
|
|
97
|
+
├── __init__.py
|
|
98
|
+
└── plugin.py
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### pyproject.toml
|
|
102
|
+
|
|
103
|
+
```toml
|
|
104
|
+
[project]
|
|
105
|
+
name = "mld-plugin-example"
|
|
106
|
+
version = "1.0.0"
|
|
107
|
+
dependencies = ["mld-sdk>=1.0.0"]
|
|
108
|
+
|
|
109
|
+
[project.entry-points."mld.plugins"]
|
|
110
|
+
example = "mld_plugin_example.plugin:MyPlugin"
|
|
111
|
+
|
|
112
|
+
[build-system]
|
|
113
|
+
requires = ["hatchling"]
|
|
114
|
+
build-backend = "hatchling.build"
|
|
115
|
+
|
|
116
|
+
[tool.hatch.build.targets.wheel]
|
|
117
|
+
packages = ["src/mld_plugin_example"]
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
The entry point `mld.plugins` is how the platform discovers your plugin.
|
|
121
|
+
|
|
122
|
+
## Platform Context
|
|
123
|
+
|
|
124
|
+
When running integrated with the platform, your plugin receives a `PlatformContext` that provides access to:
|
|
125
|
+
|
|
126
|
+
- Authentication dependencies (`get_current_user_dependency()`)
|
|
127
|
+
- Repositories for experiments, samples, users, etc.
|
|
128
|
+
- Platform configuration
|
|
129
|
+
|
|
130
|
+
```python
|
|
131
|
+
async def initialize(self, context=None):
|
|
132
|
+
self._context = context
|
|
133
|
+
if context:
|
|
134
|
+
# Running integrated - use platform services
|
|
135
|
+
self.experiment_repo = context.get_experiment_repository()
|
|
136
|
+
else:
|
|
137
|
+
# Running standalone
|
|
138
|
+
pass
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Installation Commands
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Install from GitHub
|
|
145
|
+
uv add git+https://github.com/org/mld-plugin-example
|
|
146
|
+
|
|
147
|
+
# Install specific version
|
|
148
|
+
uv add git+https://github.com/org/mld-plugin-example@v1.0.0
|
|
149
|
+
|
|
150
|
+
# Install from PyPI
|
|
151
|
+
uv add mld-plugin-example
|
|
152
|
+
|
|
153
|
+
# Install local plugin for development
|
|
154
|
+
uv add --editable ./my-plugin
|
|
155
|
+
```
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# MLD SDK (Python)
|
|
2
|
+
|
|
3
|
+
SDK for building analysis plugins that integrate with the MLD platform.
|
|
4
|
+
|
|
5
|
+
> **Full Documentation:** See the [comprehensive docs](../../docs/index.md) for detailed API reference and guides.
|
|
6
|
+
> - [API Reference](../../docs/python/api-reference.md)
|
|
7
|
+
> - [Plugin Development Guide](../../docs/python/plugin-guide.md)
|
|
8
|
+
> - [Exception Handling](../../docs/python/exceptions.md)
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# From PyPI (when published)
|
|
14
|
+
uv add mld-sdk
|
|
15
|
+
|
|
16
|
+
# From git
|
|
17
|
+
uv add git+https://github.com/EstrellaXD/mld#subdirectory=sdk
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
Create a plugin by implementing the `AnalysisPlugin` interface:
|
|
23
|
+
|
|
24
|
+
```python
|
|
25
|
+
from mld_sdk import AnalysisPlugin, PluginMetadata, PluginCapabilities
|
|
26
|
+
from fastapi import APIRouter
|
|
27
|
+
|
|
28
|
+
router = APIRouter()
|
|
29
|
+
|
|
30
|
+
@router.get("/hello")
|
|
31
|
+
async def hello():
|
|
32
|
+
return {"message": "Hello from my plugin!"}
|
|
33
|
+
|
|
34
|
+
class MyPlugin(AnalysisPlugin):
|
|
35
|
+
@property
|
|
36
|
+
def metadata(self) -> PluginMetadata:
|
|
37
|
+
return PluginMetadata(
|
|
38
|
+
name="My Plugin",
|
|
39
|
+
version="1.0.0",
|
|
40
|
+
description="My analysis plugin",
|
|
41
|
+
analysis_type="metabolomics",
|
|
42
|
+
routes_prefix="/my-plugin",
|
|
43
|
+
capabilities=PluginCapabilities(
|
|
44
|
+
requires_auth=True,
|
|
45
|
+
requires_experiments=True,
|
|
46
|
+
),
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
def get_routers(self):
|
|
50
|
+
return [(router, "")]
|
|
51
|
+
|
|
52
|
+
async def initialize(self, context=None):
|
|
53
|
+
self._context = context
|
|
54
|
+
|
|
55
|
+
async def shutdown(self):
|
|
56
|
+
pass
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Plugin Package Structure
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
mld-plugin-example/
|
|
63
|
+
├── pyproject.toml
|
|
64
|
+
├── README.md
|
|
65
|
+
└── src/mld_plugin_example/
|
|
66
|
+
├── __init__.py
|
|
67
|
+
└── plugin.py
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### pyproject.toml
|
|
71
|
+
|
|
72
|
+
```toml
|
|
73
|
+
[project]
|
|
74
|
+
name = "mld-plugin-example"
|
|
75
|
+
version = "1.0.0"
|
|
76
|
+
dependencies = ["mld-sdk>=1.0.0"]
|
|
77
|
+
|
|
78
|
+
[project.entry-points."mld.plugins"]
|
|
79
|
+
example = "mld_plugin_example.plugin:MyPlugin"
|
|
80
|
+
|
|
81
|
+
[build-system]
|
|
82
|
+
requires = ["hatchling"]
|
|
83
|
+
build-backend = "hatchling.build"
|
|
84
|
+
|
|
85
|
+
[tool.hatch.build.targets.wheel]
|
|
86
|
+
packages = ["src/mld_plugin_example"]
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The entry point `mld.plugins` is how the platform discovers your plugin.
|
|
90
|
+
|
|
91
|
+
## Platform Context
|
|
92
|
+
|
|
93
|
+
When running integrated with the platform, your plugin receives a `PlatformContext` that provides access to:
|
|
94
|
+
|
|
95
|
+
- Authentication dependencies (`get_current_user_dependency()`)
|
|
96
|
+
- Repositories for experiments, samples, users, etc.
|
|
97
|
+
- Platform configuration
|
|
98
|
+
|
|
99
|
+
```python
|
|
100
|
+
async def initialize(self, context=None):
|
|
101
|
+
self._context = context
|
|
102
|
+
if context:
|
|
103
|
+
# Running integrated - use platform services
|
|
104
|
+
self.experiment_repo = context.get_experiment_repository()
|
|
105
|
+
else:
|
|
106
|
+
# Running standalone
|
|
107
|
+
pass
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Installation Commands
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Install from GitHub
|
|
114
|
+
uv add git+https://github.com/org/mld-plugin-example
|
|
115
|
+
|
|
116
|
+
# Install specific version
|
|
117
|
+
uv add git+https://github.com/org/mld-plugin-example@v1.0.0
|
|
118
|
+
|
|
119
|
+
# Install from PyPI
|
|
120
|
+
uv add mld-plugin-example
|
|
121
|
+
|
|
122
|
+
# Install local plugin for development
|
|
123
|
+
uv add --editable ./my-plugin
|
|
124
|
+
```
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "mint-sdk"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
description = "MINT Plugin SDK - Build analysis plugins for the MINT (Mass-spec INtegrated Toolkit) platform"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
license = "MIT"
|
|
8
|
+
authors = [{ name = "MorscherLab", email = "morscher@chem.ethz.ch" }]
|
|
9
|
+
classifiers = [
|
|
10
|
+
"Development Status :: 4 - Beta",
|
|
11
|
+
"Intended Audience :: Developers",
|
|
12
|
+
"License :: OSI Approved :: MIT License",
|
|
13
|
+
"Programming Language :: Python :: 3",
|
|
14
|
+
"Programming Language :: Python :: 3.12",
|
|
15
|
+
"Framework :: FastAPI",
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
dependencies = ["fastapi>=0.109.0", "pydantic>=2.0.0", "typer>=0.15.0", "httpx>=0.28.0"]
|
|
19
|
+
|
|
20
|
+
[project.optional-dependencies]
|
|
21
|
+
dev = ["pytest>=7.0.0", "pytest-asyncio>=0.21.0", "sqlmodel>=0.0.16", "aiosqlite>=0.19.0", "greenlet>=3.0.0"]
|
|
22
|
+
local-db = ["sqlmodel>=0.0.16", "aiosqlite>=0.19.0"]
|
|
23
|
+
|
|
24
|
+
[project.urls]
|
|
25
|
+
Homepage = "https://github.com/MorscherLab/mld"
|
|
26
|
+
Documentation = "https://github.com/MorscherLab/mld/tree/main/packages/sdk-python#readme"
|
|
27
|
+
Repository = "https://github.com/MorscherLab/mld"
|
|
28
|
+
|
|
29
|
+
[project.scripts]
|
|
30
|
+
mint = "mint_sdk.cli:main"
|
|
31
|
+
|
|
32
|
+
[build-system]
|
|
33
|
+
requires = ["hatchling", "hatch-vcs"]
|
|
34
|
+
build-backend = "hatchling.build"
|
|
35
|
+
|
|
36
|
+
[tool.hatch.version]
|
|
37
|
+
source = "vcs"
|
|
38
|
+
tag-pattern = "^v(?P<version>\\d+\\.\\d+\\.\\d+.*)$"
|
|
39
|
+
raw-options.root = "../.."
|
|
40
|
+
raw-options.git_describe_command = "git describe --dirty --tags --long --abbrev=40 --match v[0-9]*"
|
|
41
|
+
|
|
42
|
+
[tool.hatch.build.hooks.vcs]
|
|
43
|
+
version-file = "src/mint_sdk/_version.py"
|
|
44
|
+
|
|
45
|
+
[tool.pytest.ini_options]
|
|
46
|
+
testpaths = ["tests"]
|
|
47
|
+
asyncio_mode = "auto"
|
|
48
|
+
|
|
49
|
+
[tool.hatch.build.targets.wheel]
|
|
50
|
+
packages = ["src/mint_sdk"]
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"""
|
|
2
|
+
MINT Plugin SDK
|
|
3
|
+
|
|
4
|
+
SDK for building analysis plugins that integrate with the MINT platform.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from mint_sdk.context import PlatformContext
|
|
8
|
+
|
|
9
|
+
# Exceptions
|
|
10
|
+
from mint_sdk.exceptions import (
|
|
11
|
+
ConfigurationException,
|
|
12
|
+
ConflictException,
|
|
13
|
+
NotFoundException,
|
|
14
|
+
PermissionException,
|
|
15
|
+
PluginException,
|
|
16
|
+
PluginLifecycleException,
|
|
17
|
+
RepositoryException,
|
|
18
|
+
ValidationException,
|
|
19
|
+
)
|
|
20
|
+
from mint_sdk.export import auto_json_to_csv, auto_json_to_summary, auto_json_to_tree
|
|
21
|
+
|
|
22
|
+
# Local database (optional dependency)
|
|
23
|
+
from mint_sdk.local_database import LocalDatabase, LocalDatabaseConfig
|
|
24
|
+
from mint_sdk.logging import get_plugin_logger
|
|
25
|
+
|
|
26
|
+
# Migration framework (requires sqlalchemy — optional dependency)
|
|
27
|
+
try:
|
|
28
|
+
from mint_sdk.migrations import (
|
|
29
|
+
MigrationOps,
|
|
30
|
+
MigrationResult,
|
|
31
|
+
MigrationRunner,
|
|
32
|
+
PluginMigration,
|
|
33
|
+
)
|
|
34
|
+
except ImportError:
|
|
35
|
+
pass
|
|
36
|
+
from mint_sdk.models import PluginCapabilities, PluginMetadata, PluginType
|
|
37
|
+
from mint_sdk.plugin import (
|
|
38
|
+
AnalysisPlugin,
|
|
39
|
+
HealthStatus,
|
|
40
|
+
LifecycleHookResult,
|
|
41
|
+
PluginHealth,
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
# Repository protocols and data models
|
|
45
|
+
from mint_sdk.repositories import (
|
|
46
|
+
DesignData,
|
|
47
|
+
# Data models
|
|
48
|
+
Experiment,
|
|
49
|
+
# Repository protocols
|
|
50
|
+
ExperimentRepository,
|
|
51
|
+
PlatformConfig,
|
|
52
|
+
PluginAnalysisResult,
|
|
53
|
+
PluginDataRepository,
|
|
54
|
+
PluginExperimentData, # backward compatibility alias for DesignData
|
|
55
|
+
PluginRoleRepository,
|
|
56
|
+
User,
|
|
57
|
+
UserPluginRole,
|
|
58
|
+
UserRepository,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
# App factory and helpers
|
|
62
|
+
from mint_sdk.app import (
|
|
63
|
+
PluginDependency,
|
|
64
|
+
SPAStaticFiles,
|
|
65
|
+
create_standalone_app,
|
|
66
|
+
require_context,
|
|
67
|
+
)
|
|
68
|
+
|
|
69
|
+
# API Client
|
|
70
|
+
from mint_sdk.client import MINTClient
|
|
71
|
+
|
|
72
|
+
try:
|
|
73
|
+
from mint_sdk._version import __version__
|
|
74
|
+
except ImportError:
|
|
75
|
+
__version__ = "0.0.0"
|
|
76
|
+
|
|
77
|
+
__all__ = [
|
|
78
|
+
# API Client
|
|
79
|
+
"MINTClient",
|
|
80
|
+
# Core plugin classes
|
|
81
|
+
"AnalysisPlugin",
|
|
82
|
+
"PluginMetadata",
|
|
83
|
+
"PluginCapabilities",
|
|
84
|
+
"PluginType",
|
|
85
|
+
"PlatformContext",
|
|
86
|
+
# Lifecycle types
|
|
87
|
+
"HealthStatus",
|
|
88
|
+
"PluginHealth",
|
|
89
|
+
"LifecycleHookResult",
|
|
90
|
+
# Exceptions
|
|
91
|
+
"PluginException",
|
|
92
|
+
"ValidationException",
|
|
93
|
+
"PermissionException",
|
|
94
|
+
"ConfigurationException",
|
|
95
|
+
"RepositoryException",
|
|
96
|
+
"NotFoundException",
|
|
97
|
+
"ConflictException",
|
|
98
|
+
"PluginLifecycleException",
|
|
99
|
+
# Local database
|
|
100
|
+
"LocalDatabase",
|
|
101
|
+
"LocalDatabaseConfig",
|
|
102
|
+
# Data models
|
|
103
|
+
"Experiment",
|
|
104
|
+
"DesignData",
|
|
105
|
+
"PluginExperimentData", # backward compatibility alias
|
|
106
|
+
"PluginAnalysisResult",
|
|
107
|
+
"User",
|
|
108
|
+
"UserPluginRole",
|
|
109
|
+
# Repository protocols
|
|
110
|
+
"ExperimentRepository",
|
|
111
|
+
"PluginDataRepository",
|
|
112
|
+
"PluginRoleRepository",
|
|
113
|
+
"UserRepository",
|
|
114
|
+
"PlatformConfig",
|
|
115
|
+
# Export utilities
|
|
116
|
+
"auto_json_to_tree",
|
|
117
|
+
"auto_json_to_csv",
|
|
118
|
+
"auto_json_to_summary",
|
|
119
|
+
# Logging
|
|
120
|
+
"get_plugin_logger",
|
|
121
|
+
# Migration framework
|
|
122
|
+
"MigrationOps",
|
|
123
|
+
"MigrationResult",
|
|
124
|
+
"MigrationRunner",
|
|
125
|
+
"PluginMigration",
|
|
126
|
+
# App factory and helpers
|
|
127
|
+
"create_standalone_app",
|
|
128
|
+
"SPAStaticFiles",
|
|
129
|
+
"PluginDependency",
|
|
130
|
+
"require_context",
|
|
131
|
+
]
|