biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / pyquery / default.nix
blobe066b9258411ea31687f9c0a7bd7a7235b61545d
2   lib,
3   buildPythonPackage,
4   cssselect,
5   fetchPypi,
6   lxml,
7   pytestCheckHook,
8   pythonAtLeast,
9   pythonOlder,
10   requests,
11   webob,
12   webtest,
15 buildPythonPackage rec {
16   pname = "pyquery";
17   version = "2.0.0";
18   disabled = pythonOlder "3.7";
20   format = "setuptools";
22   src = fetchPypi {
23     inherit pname version;
24     hash = "sha256-lj6NTpAmL/bY3sBy6pcoXcN0ovacrXd29AgqvPah2K4=";
25   };
27   # https://github.com/gawel/pyquery/issues/248
28   postPatch = ''
29     substituteInPlace tests/test_pyquery.py \
30       --replace test_selector_html skip_test_selector_html
31   '';
33   propagatedBuildInputs = [
34     cssselect
35     lxml
36   ];
38   __darwinAllowLocalNetworking = true;
40   pythonImportsCheck = [ "pyquery" ];
42   checkInputs = [
43     pytestCheckHook
44     requests
45     webob
46     (webtest.overridePythonAttrs (_: {
47       # circular dependency
48       doCheck = false;
49     }))
50   ];
52   pytestFlagsArray = [
53     # requires network
54     "--deselect=tests/test_pyquery.py::TestWebScrappingEncoding::test_get"
55   ];
57   disabledTests = lib.optionals (pythonAtLeast "3.12") [
58     # https://github.com/gawel/pyquery/issues/249
59     "pyquery.pyquery.PyQuery.serialize_dict"
60   ];
62   meta = with lib; {
63     description = "Jquery-like library for Python";
64     homepage = "https://github.com/gawel/pyquery";
65     changelog = "https://github.com/gawel/pyquery/blob/${version}/CHANGES.rst";
66     license = licenses.bsd0;
67   };