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