|
| 1 | +{ |
| 2 | + lib, |
| 3 | + buildPythonPackage, |
| 4 | + fetchFromGitHub, |
| 5 | + |
| 6 | + # build-system |
| 7 | + pdm-backend, |
| 8 | + |
| 9 | + # dependencies |
| 10 | + anyio, |
| 11 | + httpx, |
| 12 | + httpx-ws, |
| 13 | + msgspec, |
| 14 | + typing-extensions, |
| 15 | + |
| 16 | + # tests |
| 17 | + pytest-asyncio, |
| 18 | + pytestCheckHook, |
| 19 | +}: |
| 20 | + |
| 21 | +buildPythonPackage (finalAttrs: { |
| 22 | + pname = "lmstudio"; |
| 23 | + version = "1.5.0"; |
| 24 | + pyproject = true; |
| 25 | + |
| 26 | + src = fetchFromGitHub { |
| 27 | + owner = "lmstudio-ai"; |
| 28 | + repo = "lmstudio-python"; |
| 29 | + tag = finalAttrs.version; |
| 30 | + hash = "sha256-3LOoCWoQ7eXRPXHRio9Rtle07HcV3ZrWkrtVVY6mvfI="; |
| 31 | + }; |
| 32 | + |
| 33 | + build-system = [ |
| 34 | + pdm-backend |
| 35 | + ]; |
| 36 | + |
| 37 | + dependencies = [ |
| 38 | + anyio |
| 39 | + httpx |
| 40 | + httpx-ws |
| 41 | + msgspec |
| 42 | + typing-extensions |
| 43 | + ]; |
| 44 | + |
| 45 | + pythonImportsCheck = [ "lmstudio" ]; |
| 46 | + |
| 47 | + nativeCheckInputs = [ |
| 48 | + pytest-asyncio |
| 49 | + pytestCheckHook |
| 50 | + ]; |
| 51 | + |
| 52 | + disabledTests = [ |
| 53 | + # lmstudio.LMStudioRuntimeError: Local API host port is not yet resolved. |
| 54 | + "test_session_disconnected_async" |
| 55 | + ]; |
| 56 | + |
| 57 | + disabledTestPaths = [ |
| 58 | + # ModuleNotFoundError: No module named 'pytest_subtests' |
| 59 | + "tests/async/test_model_catalog_async.py" |
| 60 | + "tests/sync/test_model_catalog_sync.py" |
| 61 | + "tests/test_inference.py" |
| 62 | + |
| 63 | + # lmstudio.LMStudioRuntimeError: Local API host port is not yet resolved. |
| 64 | + "tests/async/test_embedding_async.py" |
| 65 | + "tests/async/test_images_async.py" |
| 66 | + "tests/async/test_inference_async.py" |
| 67 | + "tests/async/test_llm_async.py" |
| 68 | + "tests/async/test_model_handles_async.py" |
| 69 | + "tests/async/test_repository_async.py" |
| 70 | + "tests/async/test_sdk_bypass_async.py" |
| 71 | + "tests/sync/test_embedding_sync.py" |
| 72 | + "tests/sync/test_images_sync.py" |
| 73 | + "tests/sync/test_inference_sync.py" |
| 74 | + "tests/sync/test_llm_sync.py" |
| 75 | + "tests/sync/test_model_handles_sync.py" |
| 76 | + "tests/sync/test_repository_sync.py" |
| 77 | + "tests/sync/test_sdk_bypass_sync.py" |
| 78 | + "tests/test_convenience_api.py" |
| 79 | + "tests/test_logging.py" |
| 80 | + "tests/test_plugin_examples.py" |
| 81 | + "tests/test_sessions.py" |
| 82 | + "tests/test_timeouts.py" |
| 83 | + ]; |
| 84 | + |
| 85 | + __darwinAllowLocalNetworking = true; |
| 86 | + |
| 87 | + meta = { |
| 88 | + description = "LM Studio Python SDK"; |
| 89 | + homepage = "https://github.com/lmstudio-ai/lmstudio-python"; |
| 90 | + changelog = "https://github.com/lmstudio-ai/lmstudio-python/releases/tag/${finalAttrs.src.tag}"; |
| 91 | + license = lib.licenses.mit; |
| 92 | + maintainers = with lib.maintainers; [ GaetanLepage ]; |
| 93 | + }; |
| 94 | +}) |
0 commit comments