1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 dataclasses-json,
7 isodate,
8 requests,
9 requests-oauthlib,
10 pytestCheckHook,
11 responses,
12}:
13buildPythonPackage rec {
14 pname = "python-youtube";
15 version = "0.9.4";
16 format = "pyproject";
17
18 src = fetchFromGitHub {
19 owner = "sns-sdks";
20 repo = "python-youtube";
21 rev = "refs/tags/v${version}";
22 hash = "sha256-OesJfnXI1w2d5moJyqvrWU3sCxDaqnk1bAhtK6SPjFw=";
23 };
24
25 postPatch = ''
26 substituteInPlace pytest.ini \
27 --replace "--cov=pyyoutube" "" \
28 --replace "--cov-report xml" ""
29 '';
30
31 nativeBuildInputs = [ poetry-core ];
32
33 propagatedBuildInputs = [
34 dataclasses-json
35 isodate
36 requests
37 requests-oauthlib
38 ];
39
40 pythonImportsCheck = [ "pyyoutube" ];
41
42 nativeCheckInputs = [
43 pytestCheckHook
44 responses
45 ];
46
47 meta = with lib; {
48 description = "A simple Python wrapper around for YouTube Data API";
49 homepage = "https://github.com/sns-sdks/python-youtube";
50 changelog = "https://github.com/sns-sdks/python-youtube/blob/${src.rev}/CHANGELOG.md";
51 license = licenses.mit;
52 maintainers = with maintainers; [ blaggacao ];
53 };
54}