Merge pull request #138201 from DeeUnderscore/streamlink-patch-tests

streamlink: patch tests for compatibility with Requests 2.26
This commit is contained in:
Bobby Rong 2021-09-18 10:30:47 +08:00 committed by GitHub
commit 2c2a20a207
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@
, python3Packages
, rtmpdump
, ffmpeg
, fetchpatch
}:
python3Packages.buildPythonApplication rec {
@ -33,11 +34,14 @@ python3Packages.buildPythonApplication rec {
ffmpeg
];
# note that upstream currently uses requests 2.25.1 in Windows builds
postPatch = ''
substituteInPlace setup.py \
--replace 'requests>=2.26.0,<3.0' 'requests'
'';
patches = [
# Patch failing tests to expect correct Accept-Encoding as generated by Requests
(fetchpatch {
url = "https://github.com/streamlink/streamlink/commit/ae747a113199c119bced4613d33edcc67a222bb9.patch";
includes = [ "tests/test_stream_json.py" ];
sha256 = "sha256-KEgyWdh5DNgNktmLSvKQowUQO9p9Q7zP4NbCQJPNgKw=";
})
];
meta = with lib; {
homepage = "https://streamlink.github.io/";