Files
nixpkgs/pkgs/development/python-modules/manifest-ml/default.nix
T
Peder Bergebakken Sundt 5aba99242e treewide: fix typos in comments
Made with

```shell
git restore .
fd '\.nix$' pkgs/ --type f -j1 -x bash -xc "$(cat <<"EOF"
    typos --no-check-filenames --write-changes "$1"
    git diff --exit-code "$1" && exit
    #( git diff "$1" | grep -qE "^\+ +[^# ]") && git restore "$1"
    count1="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> ' | wc -l )"
    count2="$( bat --language nix --diff --style changes "$1" --theme "Monokai Extended" --color always | aha --no-header | grep -E '^<span style="color:olive;">~</span> (<span style="color:#f8f8f2;"> *</span>)?<span style="color:#75715e;">.*</span>$' | wc -l )"
    [[ $count1 -ne $count2 ]] && git restore "$1"
EOF
)" -- {}
```

and filtered with `GIT_DIFF_OPTS='--unified=15' git -c interactive.singleKey=true add --patch`

I initially tried using the tree-sitter cli, python bindings and even ast-grep through various means, but this is what I ended up with.
2025-02-24 10:44:41 +01:00

124 lines
2.2 KiB
Nix

{
lib,
accelerate,
aiohttp,
buildPythonPackage,
fastapi,
fetchFromGitHub,
flask,
numpy,
pg8000,
pillow,
pydantic,
pytestCheckHook,
pythonOlder,
redis,
requests,
sentence-transformers,
setuptools,
sqlalchemy,
sqlitedict,
tenacity,
tiktoken,
torch,
transformers,
uvicorn,
xxhash,
}:
buildPythonPackage rec {
pname = "manifest-ml";
version = "0.1.9";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "HazyResearch";
repo = "manifest";
tag = "v${version}";
hash = "sha256-6m1XZOXzflBYyq9+PinbrW+zqvNGFN/aRDHH1b2Me5E=";
};
__darwinAllowLocalNetworking = true;
pythonRelaxDeps = [ "pydantic" ];
build-system = [
setuptools
];
dependencies = [
numpy
pydantic
redis
requests
aiohttp
sqlitedict
tenacity
tiktoken
xxhash
];
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
] ++ lib.flatten (lib.attrValues optional-dependencies);
preCheck = ''
export HOME=$TMPDIR
'';
pytestFlagsArray = [
# this file tries importing `deepspeed`, which is not yet packaged in nixpkgs
"--ignore=tests/test_huggingface_api.py"
];
disabledTests = [
# Tests require DB access
"test_init"
"test_key_get_and_set"
"test_get"
# Tests require network access
"test_abatch_run"
"test_batch_run"
"test_retry_handling"
"test_run_chat"
"test_run"
"test_score_run"
# Test is time-sensitive
"test_timing"
];
pythonImportsCheck = [ "manifest" ];
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 ];
};
}