depot/third_party/nixpkgs/pkgs/development/python-modules/pyquery/default.nix
Default email c7e6337bd0 Project import generated by Copybara.
GitOrigin-RevId: 08e4dc3a907a6dfec8bb3bbf1540d8abbffea22b
2023-04-29 12:46:19 -04:00

59 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, cssselect
, fetchPypi
, lxml
, pytestCheckHook
, pythonOlder
, requests
, webob
, webtest
}:
buildPythonPackage rec {
pname = "pyquery";
version = "2.0.0";
disabled = pythonOlder "3.7";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-lj6NTpAmL/bY3sBy6pcoXcN0ovacrXd29AgqvPah2K4=";
};
# https://github.com/gawel/pyquery/issues/248
postPatch = ''
substituteInPlace tests/test_pyquery.py \
--replace test_selector_html skip_test_selector_html
'';
propagatedBuildInputs = [
cssselect
lxml
];
pythonImportsCheck = [ "pyquery" ];
checkInputs = [
pytestCheckHook
requests
webob
(webtest.overridePythonAttrs (_: {
# circular dependency
doCheck = false;
}))
];
pytestFlagsArray = [
# requires network
"--deselect=tests/test_pyquery.py::TestWebScrappingEncoding::test_get"
];
meta = with lib; {
description = "A jquery-like library for Python";
homepage = "https://github.com/gawel/pyquery";
changelog = "https://github.com/gawel/pyquery/blob/${version}/CHANGES.rst";
license = licenses.bsd0;
};
}