Unverified Commit a3d04db0 authored by Vinny Meller's avatar Vinny Meller
Browse files

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
parent f2c6e54b
Loading
Loading
Loading
Loading
+11 −29
Original line number Diff line number Diff line
@@ -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"
    ]