summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/xpath-expressions/default.nix
blob: e60370884ac964c905e650723bc11b8dc1f08f3e (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  lxml,
  poetry-core,
  pytestCheckHook,
}:

buildPythonPackage rec {
  pname = "xpath-expressions";
  version = "1.1.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "orf";
    repo = "xpath-expressions";
    rev = "v${version}";
    hash = "sha256-UAzDXrz1Tr9/OOjKAg/5Std9Qlrnizei8/3XL3hMSFA=";
  };

  patches = [
    # https://github.com/orf/xpath-expressions/pull/4
    (fetchpatch {
      name = "replace-poetry-with-poetry-core.patch";
      url = "https://github.com/orf/xpath-expressions/commit/3c5900fd6b2d08dd9468707f35ab42072cf75bd3.patch";
      hash = "sha256-IeV6ncJyt/w2s5TPpbM5a3pljNT6Bp5PIiqgTg2iTRA=";
    })
  ];

  nativeBuildInputs = [ poetry-core ];

  nativeCheckInputs = [
    lxml
    pytestCheckHook
  ];

  pythonImportsCheck = [ "xpath" ];

  meta = {
    description = "Python module to handle XPath expressions";
    homepage = "https://github.com/orf/xpath-expressions";
    license = with lib.licenses; [ mit ];
    maintainers = with lib.maintainers; [ fab ];
  };
}