From fe689974f042923beedd73e11f1d4eb10ecad055 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sat, 28 Feb 2026 00:40:24 +0100 Subject: [PATCH] python3Packages.huggingface: reintroduce at 0.36.2 --- .../python-modules/huggingface-hub/0.nix | 124 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 126 insertions(+) create mode 100644 pkgs/development/python-modules/huggingface-hub/0.nix diff --git a/pkgs/development/python-modules/huggingface-hub/0.nix b/pkgs/development/python-modules/huggingface-hub/0.nix new file mode 100644 index 000000000000..1ca7b24da37f --- /dev/null +++ b/pkgs/development/python-modules/huggingface-hub/0.nix @@ -0,0 +1,124 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + filelock, + fsspec, + hf-xet, + packaging, + pyyaml, + requests, + tqdm, + typing-extensions, + + # optional-dependencies + # cli + inquirerpy, + # inference + aiohttp, + # torch + torch, + safetensors, + # hf_transfer + hf-transfer, + # fastai + toml, + fastai, + fastcore, + # tensorflow + tensorflow, + pydot, + graphviz, + # tensorflow-testing + keras, + + # tests + versionCheckHook, +}: + +buildPythonPackage rec { + pname = "huggingface-hub"; + version = "0.36.2"; + pyproject = true; + + src = fetchFromGitHub { + owner = "huggingface"; + repo = "huggingface_hub"; + tag = "v${version}"; + hash = "sha256-cUp5Mm8vgJI/0N/9inQVedGWRde8lioduFoccq6b7UE="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + filelock + fsspec + hf-xet + packaging + pyyaml + requests + tqdm + typing-extensions + ]; + + optional-dependencies = { + all = [ + + ]; + cli = [ + inquirerpy + ]; + inference = [ + aiohttp + ]; + torch = [ + torch + safetensors + ] + ++ safetensors.optional-dependencies.torch; + hf_transfer = [ + hf-transfer + ]; + fastai = [ + toml + fastai + fastcore + ]; + tensorflow = [ + tensorflow + pydot + graphviz + ]; + tensorflow-testing = [ + tensorflow + keras + ]; + hf_xet = [ + hf-xet + ]; + }; + + nativeCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = "version"; + + pythonImportsCheck = [ "huggingface_hub" ]; + + meta = { + description = "Download and publish models and other files on the huggingface.co hub"; + mainProgram = "hf"; + homepage = "https://github.com/huggingface/huggingface_hub"; + changelog = "https://github.com/huggingface/huggingface_hub/releases/tag/v${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ + GaetanLepage + osbm + ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index e707fbef7e0e..72a6c4eb265d 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -7184,6 +7184,8 @@ self: super: with self; { huggingface-hub = callPackage ../development/python-modules/huggingface-hub { }; + huggingface-hub_0 = callPackage ../development/python-modules/huggingface-hub/0.nix { }; + human-readable = callPackage ../development/python-modules/human-readable { }; humanfriendly = callPackage ../development/python-modules/humanfriendly { };