From a3d04db02ba0ee0ea2989d4d4fde3e41f8985dce Mon Sep 17 00:00:00 2001 From: Vinny Meller Date: Fri, 24 May 2024 00:23:38 -0400 Subject: [PATCH] python312Packages.scrapy: 2.11.1 -> 2.11.2 - Update version from 2.11.1 to 2.11.2 - Adds `defusedxml` as a dependency - Remove unnecessary patch; commit is included in new release - Change fetchPypi to fetchFromGitHub - On PyPI they messed up the tarball name, tag names on GitHub should be more reliable - Re-enable tests that were disabled in the past but have since been fixed --- .../python-modules/scrapy/default.nix | 40 +++++-------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/pkgs/development/python-modules/scrapy/default.nix b/pkgs/development/python-modules/scrapy/default.nix index 9c688c7445d3..c97b5fc5598a 100644 --- a/pkgs/development/python-modules/scrapy/default.nix +++ b/pkgs/development/python-modules/scrapy/default.nix @@ -5,8 +5,8 @@ buildPythonPackage, cryptography, cssselect, - fetchPypi, - fetchpatch, + defusedxml, + fetchFromGitHub, glibcLocales, installShellFiles, itemadapter, @@ -28,32 +28,25 @@ 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="; }; - patches = [ - # https://github.com/scrapy/scrapy/pull/6316 - # fix test_get_func_args. remove on next update - (fetchpatch { - name = "test_get_func_args.patch"; - url = "https://github.com/scrapy/scrapy/commit/b1fe97dc6c8509d58b29c61cf7801eeee1b409a9.patch"; - hash = "sha256-POlmsuW4SD9baKwZieKfmlp2vtdlb7aKQ62VOmNXsr0="; - }) - ]; nativeBuildInputs = [ installShellFiles @@ -63,6 +56,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ cryptography cssselect + defusedxml itemadapter itemloaders lxml @@ -87,6 +81,7 @@ buildPythonPackage rec { pytestCheckHook sybil testfixtures + uvloop ]; LC_ALL = "en_US.UTF-8"; @@ -101,11 +96,6 @@ buildPythonPackage rec { 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" @@ -119,14 +109,6 @@ buildPythonPackage rec { "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" ]