mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 23:03:40 +01:00
755b915a15
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \ | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
68 lines
1.4 KiB
Nix
68 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
buildPythonPackage,
|
|
cssselect,
|
|
fetchPypi,
|
|
lxml,
|
|
pytestCheckHook,
|
|
pythonAtLeast,
|
|
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
|
|
];
|
|
|
|
__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;
|
|
};
|
|
}
|