1{ lib
2, buildPythonPackage
3, cssselect
4, fetchPypi
5, functools32
6, isPy27
7, lxml
8, pytestCheckHook
9, six
10, w3lib
11}:
12
13buildPythonPackage rec {
14 pname = "parsel";
15 version = "1.6.0";
16
17 src = fetchPypi {
18 inherit pname version;
19 sha256 = "0yawf9r3r863lwxj0n89i7h3n8xjbsl5b7n6xg76r68scl5yzvvh";
20 };
21
22 propagatedBuildInputs = [
23 cssselect
24 lxml
25 six
26 w3lib
27 ] ++ lib.optionals isPy27 [
28 functools32
29 ];
30
31 checkInputs = [
32 pytestCheckHook
33 ];
34
35 postPatch = ''
36 substituteInPlace setup.py \
37 --replace "'pytest-runner'," ""
38 '';
39
40 disabledTests = [
41 # Test are out-dated and are failing (AssertionError: Lists differ: ...)
42 # https://github.com/scrapy/parsel/pull/174
43 "test_differences_parsing_xml_vs_html"
44 "test_nested_selectors"
45 "test_re"
46 "test_replacement_null_char_from_body"
47 "test_select_on_text_nodes"
48 "test_selector_get_alias"
49 "test_selector_getall_alias"
50 "test_selector_over_text"
51 "test_selectorlist_get_alias"
52 "test_selectorlist_getall_alias"
53 "test_slicing"
54 "test_text_pseudo_element"
55 ];
56
57 pythonImportsCheck = [ "parsel" ];
58
59 meta = with lib; {
60 homepage = "https://github.com/scrapy/parsel";
61 description = "Python library to extract data from HTML and XML using XPath and CSS selectors";
62 license = licenses.bsd3;
63 maintainers = with maintainers; [ fab ];
64 };
65}