Merge pull request #242567 from blaggacao/init-python-youtube

This commit is contained in:
Sandro 2023-07-19 14:11:45 +02:00 committed by GitHub
commit 23e1d51500
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,76 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, poetry-core
, dataclasses-json
, isodate
, requests
, requests-oauthlib
, pytestCheckHook
, responses
}:
buildPythonPackage rec {
pname = "python-youtube";
version = "0.9.0";
format = "pyproject";
src = fetchFromGitHub {
owner = "sns-sdks";
repo = "python-youtube";
rev = "v${version}";
hash = "sha256-uimipYgf8nfYd1J/K6CStbzIkQiRSosu7/yOfgXYCks=";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "poetry.masonry.api" "poetry.core.masonry.api"
substituteInPlace pytest.ini \
--replace "--cov=pyyoutube" "" \
--replace "--cov-report xml" ""
'';
nativeBuildInputs = [
poetry-core
];
propagatedBuildInputs = [
dataclasses-json
isodate
requests
requests-oauthlib
];
pythonImportsCheck = [ "pyyoutube" ];
nativeCheckInputs = [
pytestCheckHook
responses
];
disabledTests = [
# On both tests, upstream compares a string to an integer
/*
python3.10-python-youtube> > self.assertEqual(m.viewCount, "160361638")
python3.10-python-youtube> E AssertionError: 160361638 != '160361638'
python3.10-python-youtube> tests/models/test_channel.py:62: AssertionError
*/
"testChannelStatistics"
/*
python3.10-python-youtube> > self.assertEqual(m.viewCount, "8087")
python3.10-python-youtube> E AssertionError: 8087 != '8087'
python3.10-python-youtube> tests/models/test_videos.py:76: AssertionError
*/
"testVideoStatistics"
];
meta = with lib; {
description = "A simple Python wrapper around for YouTube Data API";
homepage = "https://github.com/sns-sdks/python-youtube";
changelog = "https://github.com/sns-sdks/python-youtube/blob/${src.rev}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ blaggacao ];
};
}

View file

@ -7138,6 +7138,8 @@ self: super: with self; {
python-nvd3 = callPackage ../development/python-modules/python-nvd3 { };
python-youtube = callPackage ../development/python-modules/python-youtube { };
py-deprecate = callPackage ../development/python-modules/py-deprecate { };
py-ecc = callPackage ../development/python-modules/py-ecc { };