From 7ceb2fb023f510d2e33a0c41728b83ccd25cb1fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Sun, 7 Mar 2021 08:03:16 +0100 Subject: [PATCH 1/2] python3Packages.huggingface_hub: init at 0.0.6 This is a package to download and publish data on the huggingface.co hub. --- .../huggingface-hub/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/huggingface-hub/default.nix 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 f9de5c7a815..58b5f85d33f 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3072,6 +3072,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 { }; From 7692044abdecbe65cfe2555dd47665f26a5801e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20de=20Kok?= Date: Sun, 7 Mar 2021 08:03:43 +0100 Subject: [PATCH 2/2] python3Packages.datasets: 1.1.2 -> 1.4.1 Changelogs: https://github.com/huggingface/datasets/releases/tag/1.3.0 https://github.com/huggingface/datasets/releases/tag/1.4.0 https://github.com/huggingface/datasets/releases/tag/1.4.1 --- pkgs/development/python-modules/datasets/default.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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.