Commit aed1aaa0 authored by Gaetan Lepage's avatar Gaetan Lepage
Browse files

python3Packages.lmstudio: init at 1.5.0

parent 43c2ae01
Loading
Loading
Loading
Loading
+94 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  pdm-backend,

  # dependencies
  anyio,
  httpx,
  httpx-ws,
  msgspec,
  typing-extensions,

  # tests
  pytest-asyncio,
  pytestCheckHook,
}:

buildPythonPackage (finalAttrs: {
  pname = "lmstudio";
  version = "1.5.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "lmstudio-ai";
    repo = "lmstudio-python";
    tag = finalAttrs.version;
    hash = "sha256-3LOoCWoQ7eXRPXHRio9Rtle07HcV3ZrWkrtVVY6mvfI=";
  };

  build-system = [
    pdm-backend
  ];

  dependencies = [
    anyio
    httpx
    httpx-ws
    msgspec
    typing-extensions
  ];

  pythonImportsCheck = [ "lmstudio" ];

  nativeCheckInputs = [
    pytest-asyncio
    pytestCheckHook
  ];

  disabledTests = [
    # lmstudio.LMStudioRuntimeError: Local API host port is not yet resolved.
    "test_session_disconnected_async"
  ];

  disabledTestPaths = [
    # ModuleNotFoundError: No module named 'pytest_subtests'
    "tests/async/test_model_catalog_async.py"
    "tests/sync/test_model_catalog_sync.py"
    "tests/test_inference.py"

    # lmstudio.LMStudioRuntimeError: Local API host port is not yet resolved.
    "tests/async/test_embedding_async.py"
    "tests/async/test_images_async.py"
    "tests/async/test_inference_async.py"
    "tests/async/test_llm_async.py"
    "tests/async/test_model_handles_async.py"
    "tests/async/test_repository_async.py"
    "tests/async/test_sdk_bypass_async.py"
    "tests/sync/test_embedding_sync.py"
    "tests/sync/test_images_sync.py"
    "tests/sync/test_inference_sync.py"
    "tests/sync/test_llm_sync.py"
    "tests/sync/test_model_handles_sync.py"
    "tests/sync/test_repository_sync.py"
    "tests/sync/test_sdk_bypass_sync.py"
    "tests/test_convenience_api.py"
    "tests/test_logging.py"
    "tests/test_plugin_examples.py"
    "tests/test_sessions.py"
    "tests/test_timeouts.py"
  ];

  __darwinAllowLocalNetworking = true;

  meta = {
    description = "LM Studio Python SDK";
    homepage = "https://github.com/lmstudio-ai/lmstudio-python";
    changelog = "https://github.com/lmstudio-ai/lmstudio-python/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ GaetanLepage ];
  };
})
+2 −0
Original line number Diff line number Diff line
@@ -9209,6 +9209,8 @@ self: super: with self; {
  lmnotify = callPackage ../development/python-modules/lmnotify { };
  lmstudio = callPackage ../development/python-modules/lmstudio { };
  lmtpd = callPackage ../development/python-modules/lmtpd { };
  lnkparse3 = callPackage ../development/python-modules/lnkparse3 { };