1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 docutils,
6 fetchFromGitHub,
7 importlib-metadata,
8 mock,
9 pydantic,
10 pytest-mock,
11 pytestCheckHook,
12 pythonOlder,
13 setuptools,
14 setuptools-scm,
15 typing-extensions,
16}:
17
18buildPythonPackage rec {
19 pname = "rstcheck-core";
20 version = "1.2.1";
21 pyproject = true;
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchFromGitHub {
26 owner = "rstcheck";
27 repo = "rstcheck-core";
28 rev = "refs/tags/v${version}";
29 hash = "sha256-PiQMk0lIv24S6qXMYIQR+SkSji+WA30ivWs2uPQwf2A=";
30 };
31
32 build-system = [
33 setuptools
34 setuptools-scm
35 ];
36
37 env = {
38 NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-strict-prototypes";
39 };
40
41 dependencies =
42 [
43 docutils
44 pydantic
45 ]
46 ++ lib.optionals (pythonOlder "3.9") [
47 importlib-metadata
48 typing-extensions
49 ];
50
51 nativeCheckInputs = [
52 mock
53 pytest-mock
54 pytestCheckHook
55 ];
56
57 disabledTests = [
58 # https://github.com/rstcheck/rstcheck-core/issues/84
59 "test_check_yaml_returns_error_on_bad_code_block"
60 ];
61
62 pythonImportsCheck = [ "rstcheck_core" ];
63
64 meta = with lib; {
65 description = "Library for checking syntax of reStructuredText";
66 homepage = "https://github.com/rstcheck/rstcheck-core";
67 changelog = "https://github.com/rstcheck/rstcheck-core/blob/v${version}/CHANGELOG.md";
68 license = licenses.mit;
69 maintainers = with maintainers; [ fab ];
70 };
71}