Unverified Commit 32cfac97 authored by Gaétan Lepage's avatar Gaétan Lepage Committed by GitHub
Browse files

python3Packages.pydantic-monty: init at 0.0.13 (#510927)

parents 258e3684 bba180b8
Loading
Loading
Loading
Loading
+77 −0
Original line number Diff line number Diff line
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  pytestCheckHook,
  rustPlatform,

  anyio,
  dirty-equals,
  inline-snapshot,
  pytest-examples,
  pytest-pretty,
  typing-extensions,
}:

buildPythonPackage (finalAttrs: {
  pname = "pydantic-monty";
  version = "0.0.13";
  pyproject = true;

  __structuredAttrs = true;

  src = fetchFromGitHub {
    owner = "pydantic";
    repo = "monty";
    tag = "v${finalAttrs.version}";
    hash = "sha256-0g0/NuwTuUfHVHE8YcVjUeZpSa+ANPWIXllu+qRXjZE=";
  };

  cargoDeps = rustPlatform.fetchCargoVendor {
    inherit (finalAttrs) pname src version;
    hash = "sha256-LkTEMhz0MG6RfqejOQMdB2BZU6oxT3ZAo/N0oVlswsQ=";
  };

  dependencies = [ typing-extensions ];

  nativeBuildInputs = [
    rustPlatform.cargoSetupHook
    rustPlatform.maturinBuildHook
  ];

  maturinBuildFlags = [
    "-m"
    "crates/monty-python/Cargo.toml"
  ];

  pytestFlags = [
    "--config-file"
    "crates/monty-python/pyproject.toml"
  ];

  disabledTests = [
    # These tests fails because they expect to have multiple cores
    # to produce a predicted speedup measurement, which we cannot
    # achieve in the sandbox.
    "test_parallel_exec"
  ];

  nativeCheckInputs = [
    anyio
    dirty-equals
    inline-snapshot
    pytest-examples
    pytest-pretty
    pytestCheckHook
  ];

  pythonImportsCheck = [ "pydantic_monty" ];

  meta = {
    description = "Minimal, secure Python interpreter written in Rust for use by AI";
    homepage = "https://github.com/pydantic/monty";
    changelog = "https://github.com/pydantic/monty/releases/tag/${finalAttrs.src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ squat ];
  };
})
+2 −0
Original line number Diff line number Diff line
@@ -13598,6 +13598,8 @@ self: super: with self; {
  pydantic-graph = callPackage ../development/python-modules/pydantic-graph { };
  pydantic-monty = callPackage ../development/python-modules/pydantic-monty { };
  pydantic-scim = callPackage ../development/python-modules/pydantic-scim { };
  pydantic-settings = callPackage ../development/python-modules/pydantic-settings { };