From f23faf05018370d08ae790e982e1e3c86260d4a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sandro=20J=C3=A4ckel?= Date: Fri, 22 May 2026 04:09:16 +0200 Subject: [PATCH] python314Packages.beat-this: init at 1.1.0 --- .../python-modules/beat-this/default.nix | 73 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 75 insertions(+) create mode 100644 pkgs/development/python-modules/beat-this/default.nix diff --git a/pkgs/development/python-modules/beat-this/default.nix b/pkgs/development/python-modules/beat-this/default.nix new file mode 100644 index 000000000000..09211960cf3a --- /dev/null +++ b/pkgs/development/python-modules/beat-this/default.nix @@ -0,0 +1,73 @@ +{ + lib, + buildPythonPackage, + einops, + fetchFromGitHub, + fetchurl, + numpy, + pytestCheckHook, + rotary-embedding-torch, + setuptools, + soundfile, + soxr, + torch, + torchaudio, + writableTmpDirAsHomeHook, +}: + +buildPythonPackage (finalAttrs: { + pname = "beat-this"; + version = "1.1.0"; + pyproject = true; + + src = fetchFromGitHub { + owner = "CPJKU"; + repo = "beat_this"; + tag = "v${finalAttrs.version}"; + hash = "sha256-AEcDptPn5FUBb8+FuYSKjd00sFY5z6bS2iEOU64jido="; + }; + + build-system = [ setuptools ]; + + dependencies = [ + einops + numpy + rotary-embedding-torch + soxr + torch + torchaudio + ]; + + nativeCheckInputs = [ + pytestCheckHook + soundfile + writableTmpDirAsHomeHook + ]; + + preCheck = '' + mkdir -p $HOME/.cache/torch/hub/checkpoints/ + cp ${finalAttrs.passthru.final0Ckpt} $HOME/.cache/torch/hub/checkpoints/beat_this-final0.ckpt + ''; + + pythonImportsCheck = [ "beat_this" ]; + + passthru = { + # The program prints the download URLs in the error message when it cannot download things in the nix sandbox + final0Ckpt = fetchurl { + url = "https://cloud.cp.jku.at/public.php/dav/files/7ik4RrBKTS273gp/final0.ckpt"; + hash = "sha256-jDKLRfWdjdPf8hklP/ao1kgr5X0BM6KRQOL+u/jrgzE="; + }; + small0Ckpt = fetchurl { + url = "https://cloud.cp.jku.at/public.php/dav/files/7ik4RrBKTS273gp/small0.ckpt"; + hash = "sha256-YHS+LE1JDF9hAfzDdKHscq6TRW4ju2AZeDuEn13H1Hs="; + }; + }; + + meta = { + description = "Accurate and general beat tracker"; + homepage = "https://github.com/CPJKU/beat_this"; + changelog = "https://github.com/CPJKU/beat_this/blob/main/CHANGELOG.md"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ SuperSandro2000 ]; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index d03e71bd3826..1eb593023500 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2032,6 +2032,8 @@ self: super: with self; { beartype = callPackage ../development/python-modules/beartype { }; + beat-this = callPackage ../development/python-modules/beat-this { }; + beaupy = callPackage ../development/python-modules/beaupy { }; beautiful-date = callPackage ../development/python-modules/beautiful-date { };