1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, fetchpatch
5, lxml
6, poetry-core
7, pythonOlder
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "xpath-expressions";
13 version = "1.1.0";
14 format = "pyproject";
15 disabled = pythonOlder "3.5";
16
17 src = fetchFromGitHub {
18 owner = "orf";
19 repo = pname;
20 rev = "v${version}";
21 hash = "sha256-UAzDXrz1Tr9/OOjKAg/5Std9Qlrnizei8/3XL3hMSFA=";
22 };
23
24 patches = [
25 # https://github.com/orf/xpath-expressions/pull/4
26 (fetchpatch {
27 name = "replace-poetry-with-poetry-core.patch";
28 url = "https://github.com/orf/xpath-expressions/commit/3c5900fd6b2d08dd9468707f35ab42072cf75bd3.patch";
29 hash = "sha256-IeV6ncJyt/w2s5TPpbM5a3pljNT6Bp5PIiqgTg2iTRA=";
30 })
31 ];
32
33 nativeBuildInputs = [
34 poetry-core
35 ];
36
37 nativeCheckInputs = [
38 lxml
39 pytestCheckHook
40 ];
41
42 pythonImportsCheck = [ "xpath" ];
43
44 meta = with lib; {
45 description = "Python module to handle XPath expressions";
46 homepage = "https://github.com/orf/xpath-expressions";
47 license = with licenses; [ mit ];
48 maintainers = with maintainers; [ fab ];
49 };
50}