python3Packages.open-clip-torch: cleanup, add missing dependency

This commit is contained in:
Gaetan Lepage 2026-07-04 19:18:41 +00:00
commit 77bb52ed7d

View file

@ -18,14 +18,15 @@
torchvision,
tqdm,
# checks
pytestCheckHook,
# tests
braceexpand,
pandas,
pytestCheckHook,
requests,
transformers,
webdataset,
}:
buildPythonPackage rec {
buildPythonPackage (finalAttrs: {
pname = "open-clip-torch";
version = "3.3.0";
pyproject = true;
@ -33,7 +34,7 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "mlfoundations";
repo = "open_clip";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-rJT0LCIS0uChBUdZ6WTQv0npZ0Ae8veIXMgr6JTgUj4=";
};
@ -53,20 +54,23 @@ buildPythonPackage rec {
];
nativeCheckInputs = [
pytestCheckHook
braceexpand
pandas
pytestCheckHook
requests
transformers
webdataset
];
pythonImportsCheck = [ "open_clip" ];
# -> On Darwin:
# AttributeError: Can't pickle local object 'build_params.<locals>.<lambda>'
# -> On Linux:
# KeyError: Caught KeyError in DataLoader worker process 0
disabledTestPaths = [ "tests/test_wds.py" ];
disabledTestPaths = [
# -> On Darwin:
# AttributeError: Can't pickle local object 'build_params.<locals>.<lambda>'
# -> On Linux:
# KeyError: Caught KeyError in DataLoader worker process 0
"tests/test_wds.py"
];
disabledTests = [
# requires network
@ -86,9 +90,9 @@ buildPythonPackage rec {
meta = {
description = "Open source implementation of CLIP";
homepage = "https://github.com/mlfoundations/open_clip";
changelog = "https://github.com/mlfoundations/open_clip/releases/tag/${src.tag}";
changelog = "https://github.com/mlfoundations/open_clip/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ iynaix ];
mainProgram = "open-clip";
};
}
})