about summary refs log tree commit diff
path: root/pkgs/development/python-modules/rstcheck-core/default.nix
blob: b296f5dc168d6bf456f7571b32ed819688d17b09 (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ lib
, buildPythonPackage
, docutils
, fetchFromGitHub
, importlib-metadata
, mock
, poetry-core
, pydantic
, pytest-mock
, pytestCheckHook
, pythonOlder
, types-docutils
, typing-extensions
}:

buildPythonPackage rec {
  pname = "rstcheck-core";
  version = "1.0.2";
  format = "pyproject";

  disabled = pythonOlder "3.7";

  src = fetchFromGitHub {
    owner = "rstcheck";
    repo = pname;
    rev = "v${version}";
    hash = "sha256-XNr+prK9VDP66ZaFvh3Qrx+eJs6mnVO8lvoMC/qrCLs=";
  };

  nativeBuildInputs = [
    poetry-core
  ];

  propagatedBuildInputs = [
    docutils
    importlib-metadata
    pydantic
    types-docutils
    typing-extensions
  ];

  checkInputs = [
    mock
    pytest-mock
    pytestCheckHook
  ];

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace 'types-docutils = ">=0.18, <0.19"' 'types-docutils = ">=0.18"' \
      --replace 'docutils = ">=0.7, <0.19"' 'docutils = ">=0.7"'
  '';

  pythonImportsCheck = [
    "rstcheck_core"
  ];

  meta = with lib; {
    description = "Library for checking syntax of reStructuredText";
    homepage = "https://github.com/rstcheck/rstcheck-core";
    license = licenses.mit;
    maintainers = with maintainers; [ fab ];
  };
}