diff --git a/pkgs/development/python-modules/hf-transfer/default.nix b/pkgs/development/python-modules/hf-transfer/default.nix new file mode 100644 index 000000000000..6a526c59be7d --- /dev/null +++ b/pkgs/development/python-modules/hf-transfer/default.nix @@ -0,0 +1,68 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + cargo, + pkg-config, + rustPlatform, + rustc, + + # buildInputs + openssl, + stdenv, + darwin, + libiconv, +}: + +buildPythonPackage rec { + pname = "hf-transfer"; + version = "0.1.8"; + pyproject = true; + + src = fetchFromGitHub { + owner = "huggingface"; + repo = "hf_transfer"; + rev = "refs/tags/v${version}"; + hash = "sha256-Uh8q14OeN0fYsywYyNrH8C3wq/qRjQKEAIufi/a5RXA="; + }; + + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src; + name = "${pname}-${version}"; + hash = "sha256-I4APdz1r2KJ8pTfKAg8g240wYy8gtMlHwmBye4796Tk="; + }; + + build-system = [ + cargo + pkg-config + rustPlatform.cargoSetupHook + rustPlatform.maturinBuildHook + rustc + ]; + + buildInputs = + [ + openssl + ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.Security + darwin.apple_sdk.frameworks.SystemConfiguration + libiconv + ]; + + pythonImportsCheck = [ "hf_transfer" ]; + + env = { + OPENSSL_NO_VENDOR = true; + }; + + meta = { + description = "High speed download python library"; + homepage = "https://github.com/huggingface/hf_transfer"; + changelog = "https://github.com/huggingface/hf_transfer/releases/tag/v${version}"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ GaetanLepage ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 0f1890430809..32b58b06c195 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5648,6 +5648,8 @@ self: super: with self; { hfst = callPackage ../development/python-modules/hfst { }; + hf-transfer = callPackage ../development/python-modules/hf-transfer { }; + hg-commitsigs = callPackage ../development/python-modules/hg-commitsigs { }; hg-evolve = callPackage ../development/python-modules/hg-evolve { };