1{ stdenv
2, lib
3, buildPythonPackage
4, docutils
5, fetchFromGitHub
6, importlib-metadata
7, mock
8, poetry-core
9, pydantic
10, pytest-mock
11, pytestCheckHook
12, pythonOlder
13, types-docutils
14, typing-extensions
15}:
16
17buildPythonPackage rec {
18 pname = "rstcheck-core";
19 version = "1.0.3";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "rstcheck";
26 repo = pname;
27 rev = "refs/tags/v${version}";
28 hash = "sha256-9U+GhkwBr+f3yEe7McOxqPRUuTp9vP+3WT5wZ92n32w=";
29 };
30
31 nativeBuildInputs = [
32 poetry-core
33 ];
34
35 propagatedBuildInputs = [
36 docutils
37 importlib-metadata
38 pydantic
39 types-docutils
40 typing-extensions
41 ];
42
43 nativeCheckInputs = [
44 mock
45 pytest-mock
46 pytestCheckHook
47 ];
48
49 disabledTests = lib.optionals stdenv.isDarwin [
50 # Disabled until https://github.com/rstcheck/rstcheck-core/issues/19 is resolved.
51 "test_error_without_config_file_macos"
52 "test_file_1_is_bad_without_config_macos"
53 ];
54
55 pythonImportsCheck = [
56 "rstcheck_core"
57 ];
58
59 meta = with lib; {
60 description = "Library for checking syntax of reStructuredText";
61 homepage = "https://github.com/rstcheck/rstcheck-core";
62 changelog = "https://github.com/rstcheck/rstcheck-core/blob/v${version}/CHANGELOG.md";
63 license = licenses.mit;
64 maintainers = with maintainers; [ fab ];
65 };
66}