Commit 5df7c522 authored by natsukium's avatar natsukium Committed by Yt
Browse files

python3Packages.manifest-ml: init at 0.1.5

parent 4dec52e0
Loading
Loading
Loading
Loading
+107 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, fetchFromGitHub
, pythonOlder
, numpy
, pydantic
, redis
, requests
, aiohttp
, sqlitedict
, tenacity
, tiktoken
, xxhash
, # optional dependencies
  accelerate
, flask
, sentence-transformers
, torch
, transformers
, fastapi
, uvicorn
, pillow
, pg8000
, sqlalchemy
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "manifest-ml";
  version = "0.1.5";
  format = "setuptools";

  disalbed = pythonOlder "3.8";

  src = fetchFromGitHub {
    owner = "HazyResearch";
    repo = "manifest";
    rev = "refs/tags/v${version}";
    hash = "sha256-WKibIJv4eJ0IOCRgTl02Zusf0XNTPLBIyme6HMANr8I=";
  };

  propagatedBuildInputs = [
    numpy
    pydantic
    redis
    requests
    aiohttp
    sqlitedict
    tenacity
    tiktoken
    xxhash
  ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);

  passthru.optional-dependencies = {
    api = [
      accelerate
      # deepspeed
      # diffusers
      flask
      sentence-transformers
      torch
      transformers
    ];
    app = [
      fastapi
      uvicorn
    ];
    diffusers = [
      pillow
    ];
    gcp = [
      pg8000
      # cloud-sql-python-connector
      sqlalchemy
    ];
  };

  nativeCheckInputs = [
    pytestCheckHook
  ];

  preCheck = ''
    export HOME=$TMPDIR
  '';

  pytestFlagsArray = [
    # this file tries importing `deepspeed`, which is not yet packaged in nixpkgs
    "--ignore=tests/test_huggingface_api.py"
  ];

  disabledTests = [
    # these tests have db access
    "test_init"
    "test_key_get_and_set"
    "test_get"
    # this test has network access
    "test_retry_handling"
  ];

  meta = with lib; {
    description = "Manifest for Prompting Foundation Models";
    homepage = "https://github.com/HazyResearch/manifest";
    changelog = "https://github.com/HazyResearch/manifest/releases/tag/v${version}";
    license = licenses.asl20;
    maintainers = with maintainers; [ natsukium ];
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -5913,6 +5913,8 @@ self: super: with self; {
    inherit (pkgs.darwin.apple_sdk.frameworks) AppKit;
  };

  manifest-ml = callPackage ../development/python-modules/manifest-ml { };

  manifestparser = callPackage ../development/python-modules/marionette-harness/manifestparser.nix { };

  manuel = callPackage ../development/python-modules/manuel { };