Merge pull request #286868 from dotlambda/youtubeaio-init

home-assistant: support youtube component
This commit is contained in:
Martin Weinelt 2024-02-08 19:27:09 +01:00 committed by GitHub
commit 961c422b48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 71 additions and 1 deletions

View file

@ -0,0 +1,59 @@
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, poetry-core
, aiohttp
, pydantic
, yarl
, aresponses
, pytest-asyncio
, pytestCheckHook
, syrupy
}:
buildPythonPackage rec {
pname = "youtubeaio";
version = "1.1.5";
pyproject = true;
disabled = pythonOlder "3.11";
src = fetchFromGitHub {
owner = "joostlek";
repo = "python-youtube";
rev = "refs/tags/v${version}";
hash = "sha256-utkf5t6yrf0f9QBIaDH6MxKduNZOsjfEWfQnuVyUoRM=";
};
postPatch = ''
sed -i "/^addopts/d" pyproject.toml
'';
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
aiohttp
pydantic
yarl
];
pythonImportsCheck = [ "youtubeaio" ];
nativeCheckInputs = [
aresponses
pytest-asyncio
pytestCheckHook
syrupy
];
meta = {
changelog = "https://github.com/joostlek/python-youtube/releases/tag/v${version}";
description = "Asynchronous Python client for the YouTube V3 API";
homepage = "https://github.com/joostlek/python-youtube";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ dotlambda ];
};
}

View file

@ -5633,7 +5633,8 @@
fnv-hash-fast
psutil-home-assistant
sqlalchemy
]; # missing inputs: youtubeaio
youtubeaio
];
"zabbix" = ps: with ps; [
py-zabbix
];
@ -6505,6 +6506,7 @@
"yeelight"
"yolink"
"youless"
"youtube"
"zamg"
"zeroconf"
"zerproc"

View file

@ -452,6 +452,13 @@ let
];
});
youtubeaio = super.youtubeaio.overridePythonAttrs (old: {
pytestFlagsArray = [
# fails with pydantic v1
"--deselect=tests/test_video.py::test_fetch_video"
];
});
# internal python packages only consumed by home-assistant itself
home-assistant-frontend = self.callPackage ./frontend.nix { };
home-assistant-intents = self.callPackage ./intents.nix { };

View file

@ -16519,6 +16519,8 @@ self: super: with self; {
ffmpegSupport = false;
};
youtubeaio = callPackage ../development/python-modules/youtubeaio { };
yoyo-migrations = callPackage ../development/python-modules/yoyo-migrations { };
yt-dlp = callPackage ../tools/misc/yt-dlp {