From 77bb52ed7daf7100208e5b9f9b4e32ee366849cf Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Sat, 4 Jul 2026 19:18:41 +0000 Subject: [PATCH] python3Packages.open-clip-torch: cleanup, add missing dependency --- .../open-clip-torch/default.nix | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/pkgs/development/python-modules/open-clip-torch/default.nix b/pkgs/development/python-modules/open-clip-torch/default.nix index 4ebf3f3cba20..77f2d296bb4c 100644 --- a/pkgs/development/python-modules/open-clip-torch/default.nix +++ b/pkgs/development/python-modules/open-clip-torch/default.nix @@ -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..' - # -> 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..' + # -> 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"; }; -} +})