diff options
Diffstat (limited to 'pkgs/development/python-modules/scrapy/default.nix')
-rw-r--r-- | pkgs/development/python-modules/scrapy/default.nix | 148 |
1 files changed, 71 insertions, 77 deletions
diff --git a/pkgs/development/python-modules/scrapy/default.nix b/pkgs/development/python-modules/scrapy/default.nix index 68bb9460c14fd..c97b5fc5598a4 100644 --- a/pkgs/development/python-modules/scrapy/default.nix +++ b/pkgs/development/python-modules/scrapy/default.nix @@ -1,48 +1,53 @@ -{ lib -, stdenv -, botocore -, buildPythonPackage -, cryptography -, cssselect -, fetchPypi -, glibcLocales -, installShellFiles -, itemadapter -, itemloaders -, jmespath -, lxml -, packaging -, parsel -, pexpect -, protego -, pydispatcher -, pyopenssl -, pytestCheckHook -, pythonOlder -, queuelib -, service-identity -, setuptools -, sybil -, testfixtures -, tldextract -, twisted -, w3lib -, zope-interface +{ + lib, + stdenv, + botocore, + buildPythonPackage, + cryptography, + cssselect, + defusedxml, + fetchFromGitHub, + glibcLocales, + installShellFiles, + itemadapter, + itemloaders, + jmespath, + lxml, + packaging, + parsel, + pexpect, + protego, + pydispatcher, + pyopenssl, + pytestCheckHook, + pythonOlder, + queuelib, + service-identity, + setuptools, + sybil, + testfixtures, + tldextract, + twisted, + uvloop, + w3lib, + zope-interface, }: buildPythonPackage rec { pname = "scrapy"; - version = "2.11.1"; + version = "2.11.2"; pyproject = true; disabled = pythonOlder "3.8"; - src = fetchPypi { - inherit version; - pname = "Scrapy"; - hash = "sha256-czoDnHQj5StpvygQtTMgk9TkKoSEYDWcB7Auz/j3Pr4="; + src = fetchFromGitHub { + owner = "scrapy"; + repo = "scrapy"; + rev = "refs/tags/${version}"; + hash = "sha256-EaO1kQ3VSTwEW+r0kSKycOxHNTPwwCVjch1ZBrTU0qQ="; }; + nativeBuildInputs = [ installShellFiles setuptools @@ -51,6 +56,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ cryptography cssselect + defusedxml itemadapter itemloaders lxml @@ -75,6 +81,7 @@ buildPythonPackage rec { pytestCheckHook sybil testfixtures + uvloop ]; LC_ALL = "en_US.UTF-8"; @@ -87,45 +94,34 @@ buildPythonPackage rec { "docs" ]; - disabledTests = [ - # It's unclear if the failures are related to libxml2, https://github.com/NixOS/nixpkgs/pull/123890 - "test_nested_css" - "test_nested_xpath" - "test_flavor_detection" - "test_follow_whitespace" - # Requires network access - "AnonymousFTPTestCase" - "FTPFeedStorageTest" - "FeedExportTest" - "test_custom_asyncio_loop_enabled_true" - "test_custom_loop_asyncio" - "test_custom_loop_asyncio_deferred_signal" - "FileFeedStoragePreFeedOptionsTest" # https://github.com/scrapy/scrapy/issues/5157 - "test_persist" - "test_timeout_download_from_spider_nodata_rcvd" - "test_timeout_download_from_spider_server_hangs" - "test_unbounded_response" - "CookiesMiddlewareTest" - # Depends on uvloop - "test_asyncio_enabled_reactor_different_loop" - "test_asyncio_enabled_reactor_same_loop" - # Fails with AssertionError - "test_peek_fifo" - "test_peek_one_element" - "test_peek_lifo" - "test_callback_kwargs" - # Test fails on Hydra - "test_start_requests_laziness" - ] ++ lib.optionals stdenv.isDarwin [ - "test_xmliter_encoding" - "test_download" - "test_reactor_default_twisted_reactor_select" - "URIParamsSettingTest" - "URIParamsFeedOptionTest" - # flaky on darwin-aarch64 - "test_fixed_delay" - "test_start_requests_laziness" - ]; + disabledTests = + [ + # Requires network access + "AnonymousFTPTestCase" + "FTPFeedStorageTest" + "FeedExportTest" + "test_custom_asyncio_loop_enabled_true" + "test_custom_loop_asyncio" + "test_custom_loop_asyncio_deferred_signal" + "FileFeedStoragePreFeedOptionsTest" # https://github.com/scrapy/scrapy/issues/5157 + "test_persist" + "test_timeout_download_from_spider_nodata_rcvd" + "test_timeout_download_from_spider_server_hangs" + "test_unbounded_response" + "CookiesMiddlewareTest" + # Test fails on Hydra + "test_start_requests_laziness" + ] + ++ lib.optionals stdenv.isDarwin [ + "test_xmliter_encoding" + "test_download" + "test_reactor_default_twisted_reactor_select" + "URIParamsSettingTest" + "URIParamsFeedOptionTest" + # flaky on darwin-aarch64 + "test_fixed_delay" + "test_start_requests_laziness" + ]; postInstall = '' installManPage extras/scrapy.1 @@ -134,9 +130,7 @@ buildPythonPackage rec { --bash extras/scrapy_bash_completion ''; - pythonImportsCheck = [ - "scrapy" - ]; + pythonImportsCheck = [ "scrapy" ]; __darwinAllowLocalNetworking = true; |