1{ lib
2, buildPythonPackage
3, cssselect
4, fetchPypi
5, jmespath
6, lxml
7, packaging
8, psutil
9, pytestCheckHook
10, pythonOlder
11, w3lib
12}:
13
14buildPythonPackage rec {
15 pname = "parsel";
16 version = "1.8.1";
17 format = "setuptools";
18
19 disabled = pythonOlder "3.7";
20
21 src = fetchPypi {
22 inherit pname version;
23 hash = "sha256-r/KOaMmz8akB2ypOPxWNhICjhyTXMo7nUcGk4cGAHjk=";
24 };
25
26 postPatch = ''
27 substituteInPlace setup.py \
28 --replace '"pytest-runner",' ""
29 '';
30
31 propagatedBuildInputs = [
32 cssselect
33 jmespath
34 lxml
35 packaging
36 w3lib
37 ];
38
39 nativeCheckInputs = [
40 psutil
41 pytestCheckHook
42 ];
43
44 pythonImportsCheck = [
45 "parsel"
46 ];
47
48 meta = with lib; {
49 description = "Python library to extract data from HTML and XML using XPath and CSS selectors";
50 homepage = "https://github.com/scrapy/parsel";
51 license = licenses.bsd3;
52 maintainers = with maintainers; [ fab ];
53 };
54}