Merge pull request #253135 from figsoda/shaq

This commit is contained in:
figsoda 2023-09-05 14:30:00 -04:00 committed by GitHub
commit 558bcddd7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 191 additions and 0 deletions

View File

@ -0,0 +1,45 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, nose2
, typing-extensions
}:
buildPythonPackage rec {
pname = "dataclass-factory";
version = "2.13";
format = "setuptools";
src = fetchFromGitHub {
owner = "reagento";
repo = "dataclass-factory";
rev = version;
hash = "sha256-hNPuqs3TvDleIxflCW5rutbXjDotFRLCNJlcTBFxFAw=";
};
nativeCheckInputs = [
nose2
];
checkInputs = [
typing-extensions
];
pythonImportsCheck = [ "dataclass_factory" ];
checkPhase = ''
runHook preCheck
nose2 -v tests
runHook postCheck
'';
meta = with lib; {
description = "Modern way to convert python dataclasses or other objects to and from more common types like dicts or json-like structures";
homepage = "https://github.com/reagento/dataclass-factory";
changelog = "https://github.com/reagento/dataclass-factory/releases/tag/${src.rev}";
license = licenses.asl20;
maintainers = with maintainers; [ figsoda ];
};
}

View File

@ -0,0 +1,76 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch
, poetry-core
, wheel
, aiofiles
, aiohttp
, dataclass-factory
, numpy
, pydantic
, pydub
, ffmpeg
, pytest-asyncio
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "shazamio";
version = "0.4.0.1";
format = "pyproject";
src = fetchFromGitHub {
owner = "dotX12";
repo = "ShazamIO";
rev = version;
hash = "sha256-dfrdfbGkLYNjlS6Qv9Rnywv6nqiKrNXCICLSuAXpQBU=";
};
patches = [
# remove poetry and virtualenv from build dependencies as they are not used
# https://github.com/dotX12/ShazamIO/pull/71
(fetchpatch {
name = "remove-unused-build-dependencies.patch";
url = "https://github.com/dotX12/ShazamIO/commit/5c61e1efe51c2826852da5b6aa6ad8ce3d4012a9.patch";
hash = "sha256-KiU5RVBPnSs5qrReFeTe9ePg1fR7y0NchIIHcQwlPaI=";
})
];
nativeBuildInputs = [
poetry-core
wheel
];
propagatedBuildInputs = [
aiofiles
aiohttp
dataclass-factory
numpy
pydantic
pydub
];
nativeCheckInputs = [
ffmpeg
pytest-asyncio
pytestCheckHook
];
disabledTests = [
# requires internet access
"test_about_artist"
"test_recognize_song_file"
"test_recognize_song_bytes"
];
pythonImportsCheck = [ "shazamio" ];
meta = with lib; {
description = "A free asynchronous library from reverse engineered Shazam API";
homepage = "https://github.com/dotX12/ShazamIO";
changelog = "https://github.com/dotX12/ShazamIO/releases/tag/${src.rev}";
license = licenses.mit;
maintainers = with maintainers; [ figsoda ];
};
}

View File

@ -0,0 +1,64 @@
{ lib
, python3
, fetchFromGitHub
, ffmpeg
}:
python3.pkgs.buildPythonApplication rec {
pname = "shaq";
version = "0.0.1";
format = "pyproject";
src = fetchFromGitHub {
owner = "woodruffw";
repo = "shaq";
rev = "v${version}";
hash = "sha256-RF606Aeskqbx94H5ivd+RJ+Hk0iYsds/PUY8TZqirs4=";
};
nativeBuildInputs = [
python3.pkgs.flit-core
];
propagatedBuildInputs = with python3.pkgs; [
pyaudio
pydub
rich
shazamio
];
passthru.optional-dependencies = with python3.pkgs; {
dev = [
build
shaq
];
lint = [
black
mypy
ruff
];
test = [
pretend
pytest
pytest-cov
];
};
pythonImportsCheck = [ "shaq" ];
makeWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath [ ffmpeg ])
];
meta = with lib; {
description = "A CLI client for Shazam";
homepage = "https://github.com/woodruffw/shaq";
changelog = "https://github.com/woodruffw/shaq/releases/tag/${src.rev}";
license = licenses.mit;
maintainers = with maintainers; [ figsoda mig4ng ];
mainProgram = "shaq";
};
}

View File

@ -25140,6 +25140,8 @@ with pkgs;
inherit (skawarePackages) cleanPackaging;
};
shaq = callPackage ../tools/audio/shaq { };
slang = callPackage ../development/libraries/slang { };
slibGuile = callPackage ../development/libraries/slib {

View File

@ -2479,6 +2479,8 @@ self: super: with self; {
databricks-sql-connector = callPackage ../development/python-modules/databricks-sql-connector { };
dataclass-factory = callPackage ../development/python-modules/dataclass-factory { };
dataclass-wizard = callPackage ../development/python-modules/dataclass-wizard { };
dataclasses-json = callPackage ../development/python-modules/dataclasses-json { };
@ -11716,6 +11718,8 @@ self: super: with self; {
sharkiq = callPackage ../development/python-modules/sharkiq { };
shazamio = callPackage ../development/python-modules/shazamio { };
sh = callPackage ../development/python-modules/sh { };
shlib = callPackage ../development/python-modules/shlib { };