2021-03-19 17:17:44 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, filelock
|
|
|
|
, importlib-metadata
|
2021-12-06 16:07:01 +00:00
|
|
|
, packaging
|
2021-12-26 17:43:05 +00:00
|
|
|
, pyyaml
|
2021-03-19 17:17:44 +00:00
|
|
|
, requests
|
2021-12-06 16:07:01 +00:00
|
|
|
, ruamel-yaml
|
2021-03-19 17:17:44 +00:00
|
|
|
, tqdm
|
2021-12-06 16:07:01 +00:00
|
|
|
, typing-extensions
|
2021-03-19 17:17:44 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "huggingface-hub";
|
2022-04-15 01:41:22 +00:00
|
|
|
version = "0.4.0";
|
2021-03-19 17:17:44 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "huggingface";
|
|
|
|
repo = "huggingface_hub";
|
|
|
|
rev = "v${version}";
|
2022-04-15 01:41:22 +00:00
|
|
|
sha256 = "sha256-rrkubNy60e/1VcGacYQang4yWxUzIBGySxZyq6G1arw=";
|
2021-03-19 17:17:44 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
nativeBuildInputs = [ packaging ];
|
|
|
|
|
2021-03-19 17:17:44 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
filelock
|
2021-12-26 17:43:05 +00:00
|
|
|
pyyaml
|
2021-03-19 17:17:44 +00:00
|
|
|
requests
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2021-03-19 17:17:44 +00:00
|
|
|
tqdm
|
2021-12-06 16:07:01 +00:00
|
|
|
typing-extensions
|
2021-03-19 17:17:44 +00:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
|
|
|
|
|
|
|
|
# Tests require network access.
|
|
|
|
doCheck = false;
|
|
|
|
pythonImportsCheck = [ "huggingface_hub" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/huggingface/huggingface_hub";
|
|
|
|
description = "Download and publish models and other files on the huggingface.co hub";
|
|
|
|
changelog = "https://github.com/huggingface/huggingface_hub/releases/tag/${version}";
|
|
|
|
license = licenses.asl20;
|
2021-09-18 10:52:07 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-03-19 17:17:44 +00:00
|
|
|
};
|
|
|
|
}
|