summary refs log tree commit diff
path: root/pkgs/development/python-modules/xpath-expressions/default.nix
blob: eebd30364e475c777b79783f695db72bf98eba81 (plain) (blame)
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
{ lib
, buildPythonPackage
, fetchFromGitHub
, lxml
, poetry-core
, pythonOlder
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "xpath-expressions";
  version = "1.1.0";
  disabled = pythonOlder "3.5";
  format = "pyproject";

  src = fetchFromGitHub {
    owner = "orf";
    repo = pname;
    rev = "v${version}";
    sha256 = "0l289iw2zmzxyfi3g2z7b917vmsaz47h5jp871zvykpmpigc632h";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  nativeCheckInputs = [
    lxml
    pytestCheckHook
  ];

  postPatch = ''
    # Was fixed upstream but not released
    substituteInPlace pyproject.toml \
      --replace "poetry.masonry.api" "poetry.core.masonry.api"
  '';

  pythonImportsCheck = [ "xpath" ];

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