Merge pull request #248329 from fabaff/scrapy-fake-useragent-fix
python311Packages.scrapy-fake-useragent: disable failing test
This commit is contained in:
commit
2dbe9e5fea
1 changed files with 39 additions and 4 deletions
|
@ -1,24 +1,59 @@
|
||||||
{ lib, fetchFromGitHub, buildPythonPackage, pytestCheckHook, pytest-cov, pytest-mock, fake-useragent, faker, scrapy }:
|
{ lib
|
||||||
|
, buildPythonPackage
|
||||||
|
, fake-useragent
|
||||||
|
, faker
|
||||||
|
, fetchFromGitHub
|
||||||
|
, pytest-mock
|
||||||
|
, pytestCheckHook
|
||||||
|
, pythonOlder
|
||||||
|
, scrapy
|
||||||
|
}:
|
||||||
|
|
||||||
buildPythonPackage rec {
|
buildPythonPackage rec {
|
||||||
pname = "scrapy-fake-useragent";
|
pname = "scrapy-fake-useragent";
|
||||||
version = "1.4.4";
|
version = "1.4.4";
|
||||||
|
format = "setuptools";
|
||||||
|
|
||||||
|
disabled = pythonOlder "3.7";
|
||||||
|
|
||||||
# PyPi tarball is corrupted
|
# PyPi tarball is corrupted
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "alecxe";
|
owner = "alecxe";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "59c20d38c58c76618164760d546aa5b989a79b8b"; # no tags
|
rev = "59c20d38c58c76618164760d546aa5b989a79b8b"; # no tags
|
||||||
sha256 = "0yb7d51jws665rdfqkmi077w0pjxmb2ni7ysphj7lx7b18whq54j";
|
hash = "sha256-khQMOQrrdHokvNqfaMWqXV7AzwGxTuxaLsZoLkNpZ3k=";
|
||||||
};
|
};
|
||||||
|
|
||||||
propagatedBuildInputs = [ fake-useragent faker ];
|
postPatch = ''
|
||||||
|
substituteInPlace pytest.ini \
|
||||||
|
--replace " --cov=scrapy_fake_useragent --cov-report=term --cov-report=html --fulltrace" ""
|
||||||
|
'';
|
||||||
|
|
||||||
nativeCheckInputs = [ pytestCheckHook scrapy pytest-cov pytest-mock ];
|
propagatedBuildInputs = [
|
||||||
|
fake-useragent
|
||||||
|
faker
|
||||||
|
];
|
||||||
|
|
||||||
|
nativeCheckInputs = [
|
||||||
|
pytest-mock
|
||||||
|
pytestCheckHook
|
||||||
|
scrapy
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [
|
||||||
|
"scrapy_fake_useragent"
|
||||||
|
];
|
||||||
|
|
||||||
|
disabledTests = [
|
||||||
|
# AttributeError: 'RetryUserAgentMiddleware' object has no attribute 'EXCEPTIONS_TO_RETRY'
|
||||||
|
"test_random_ua_set_on_exception"
|
||||||
|
];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "Random User-Agent middleware based on fake-useragent";
|
description = "Random User-Agent middleware based on fake-useragent";
|
||||||
homepage = "https://github.com/alecxe/scrapy-fake-useragent";
|
homepage = "https://github.com/alecxe/scrapy-fake-useragent";
|
||||||
|
changelog = "https://github.com/alecxe/scrapy-fake-useragent/blob/master/CHANGELOG.rst";
|
||||||
license = licenses.mit;
|
license = licenses.mit;
|
||||||
|
maintainers = with maintainers; [ ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue