2021-03-07 08:03:16 +01:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, buildPythonPackage
|
|
|
|
, pythonOlder
|
|
|
|
, filelock
|
|
|
|
, importlib-metadata
|
2021-11-02 19:07:27 +01:00
|
|
|
, packaging
|
2021-11-30 09:23:14 -08:00
|
|
|
, pyyaml
|
2021-03-07 08:03:16 +01:00
|
|
|
, requests
|
2021-11-02 19:07:27 +01:00
|
|
|
, ruamel-yaml
|
2021-03-07 08:03:16 +01:00
|
|
|
, tqdm
|
2021-11-02 19:07:27 +01:00
|
|
|
, typing-extensions
|
2021-03-07 08:03:16 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "huggingface-hub";
|
2022-11-18 01:46:04 +00:00
|
|
|
version = "0.11.0";
|
2022-05-31 00:11:20 +02:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-03-07 08:03:16 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "huggingface";
|
|
|
|
repo = "huggingface_hub";
|
2022-05-12 14:11:12 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-11-18 01:46:04 +00:00
|
|
|
hash = "sha256-d+X4hGt4K6xmRFw8mevKpZ6RDv+U1PJ8WbmdKGDbVNs=";
|
2021-03-07 08:03:16 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
filelock
|
2022-05-31 00:11:20 +02:00
|
|
|
packaging
|
2021-11-30 09:23:14 -08:00
|
|
|
pyyaml
|
2021-03-07 08:03:16 +01:00
|
|
|
requests
|
2021-11-02 19:07:27 +01:00
|
|
|
ruamel-yaml
|
2021-03-07 08:03:16 +01:00
|
|
|
tqdm
|
2021-11-02 19:07:27 +01:00
|
|
|
typing-extensions
|
2022-05-31 00:11:20 +02:00
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
importlib-metadata
|
|
|
|
];
|
2021-03-07 08:03:16 +01:00
|
|
|
|
|
|
|
# Tests require network access.
|
|
|
|
doCheck = false;
|
2022-05-31 00:11:20 +02:00
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"huggingface_hub"
|
|
|
|
];
|
2021-03-07 08:03:16 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Download and publish models and other files on the huggingface.co hub";
|
2022-05-31 00:11:20 +02:00
|
|
|
homepage = "https://github.com/huggingface/huggingface_hub";
|
2022-05-13 04:20:00 +00:00
|
|
|
changelog = "https://github.com/huggingface/huggingface_hub/releases/tag/v${version}";
|
2021-03-07 08:03:16 +01:00
|
|
|
license = licenses.asl20;
|
2021-09-12 14:42:12 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2021-03-07 08:03:16 +01:00
|
|
|
};
|
|
|
|
}
|