diff --git a/pkgs/development/python-modules/datasets/default.nix b/pkgs/development/python-modules/datasets/default.nix index fc349cdc277..cc06297c4ea 100644 --- a/pkgs/development/python-modules/datasets/default.nix +++ b/pkgs/development/python-modules/datasets/default.nix @@ -3,6 +3,8 @@ , fetchFromGitHub , dill , filelock +, fsspec +, huggingface-hub , multiprocess , numpy , pandas @@ -14,18 +16,20 @@ buildPythonPackage rec { pname = "datasets"; - version = "1.1.2"; + version = "1.4.1"; src = fetchFromGitHub { owner = "huggingface"; repo = pname; rev = version; - hash = "sha256-upXZ2rOfmjnJbDo6RMGeHv/fe10RQAf/zwDWWKdt6SA="; + hash = "sha256-is8TS84varARWyfeDTbQH0pcYFTk0PcEyK183emB4GE="; }; propagatedBuildInputs = [ dill filelock + fsspec + huggingface-hub multiprocess numpy pandas @@ -36,7 +40,9 @@ buildPythonPackage rec { ]; postPatch = '' - substituteInPlace setup.py --replace '"tqdm>=4.27,<4.50.0"' '"tqdm>=4.27"' + substituteInPlace setup.py \ + --replace '"tqdm>=4.27,<4.50.0"' '"tqdm>=4.27"' \ + --replace "huggingface_hub==0.0.2" "huggingface_hub>=0.0.2" ''; # Tests require pervasive internet access. diff --git a/pkgs/development/python-modules/huggingface-hub/default.nix b/pkgs/development/python-modules/huggingface-hub/default.nix new file mode 100644 index 00000000000..0fce65f2b8b --- /dev/null +++ b/pkgs/development/python-modules/huggingface-hub/default.nix @@ -0,0 +1,39 @@ +{ lib +, fetchFromGitHub +, buildPythonPackage +, pythonOlder +, filelock +, importlib-metadata +, requests +, tqdm +}: + +buildPythonPackage rec { + pname = "huggingface-hub"; + version = "0.0.6"; + + src = fetchFromGitHub { + owner = "huggingface"; + repo = "huggingface_hub"; + rev = "v${version}"; + hash = "sha256-0DSgWmodeRmvGq2v3n86BzRx5Xdb8fIQh+G/2O2d+yo="; + }; + + propagatedBuildInputs = [ + filelock + requests + tqdm + ] ++ 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; + maintainers = with maintainers; [ danieldk ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1a6de7c974c..2c65295c097 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3134,6 +3134,8 @@ in { hug = callPackage ../development/python-modules/hug { }; + huggingface-hub = callPackage ../development/python-modules/huggingface-hub { }; + humanfriendly = callPackage ../development/python-modules/humanfriendly { }; humanize = callPackage ../development/python-modules/humanize { };