1{ lib
2, buildPythonPackage
3, cssselect
4, fetchPypi
5, lxml
6, pytestCheckHook
7, pythonOlder
8, requests
9, webob
10, webtest
11}:
12
13buildPythonPackage rec {
14 pname = "pyquery";
15 version = "2.0.0";
16 disabled = pythonOlder "3.7";
17
18 format = "setuptools";
19
20 src = fetchPypi {
21 inherit pname version;
22 hash = "sha256-lj6NTpAmL/bY3sBy6pcoXcN0ovacrXd29AgqvPah2K4=";
23 };
24
25 # https://github.com/gawel/pyquery/issues/248
26 postPatch = ''
27 substituteInPlace tests/test_pyquery.py \
28 --replace test_selector_html skip_test_selector_html
29 '';
30
31 propagatedBuildInputs = [
32 cssselect
33 lxml
34 ];
35
36 pythonImportsCheck = [ "pyquery" ];
37
38 checkInputs = [
39 pytestCheckHook
40 requests
41 webob
42 (webtest.overridePythonAttrs (_: {
43 # circular dependency
44 doCheck = false;
45 }))
46 ];
47
48 pytestFlagsArray = [
49 # requires network
50 "--deselect=tests/test_pyquery.py::TestWebScrappingEncoding::test_get"
51 ];
52
53 meta = with lib; {
54 description = "A jquery-like library for Python";
55 homepage = "https://github.com/gawel/pyquery";
56 changelog = "https://github.com/gawel/pyquery/blob/${version}/CHANGES.rst";
57 license = licenses.bsd0;
58 };
59}