nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 setuptools,
6 setuptools-scm,
7 pytestCheckHook,
8 rstcheck-core,
9 sphinx,
10 typer,
11}:
12
13buildPythonPackage rec {
14 pname = "rstcheck";
15 version = "6.2.5";
16 pyproject = true;
17
18 src = fetchFromGitHub {
19 owner = "rstcheck";
20 repo = "rstcheck";
21 tag = "v${version}";
22 hash = "sha256-ajevEHCsPvr5e4K8I5AfxFZ+Vo1quaGUKFIEB9Wlobc=";
23 };
24
25 build-system = [
26 setuptools
27 setuptools-scm
28 ];
29
30 dependencies = [
31 rstcheck-core
32 typer
33 ];
34
35 optional-dependencies = {
36 sphinx = [ sphinx ];
37 };
38
39 nativeCheckInputs = [ pytestCheckHook ];
40
41 pythonImportsCheck = [ "rstcheck" ];
42
43 preCheck = ''
44 # The tests need to find and call the rstcheck executable
45 export PATH="$PATH:$out/bin";
46 '';
47
48 meta = {
49 description = "Checks syntax of reStructuredText and code blocks nested within it";
50 homepage = "https://github.com/myint/rstcheck";
51 changelog = "https://github.com/rstcheck/rstcheck/blob/v${version}/CHANGELOG.md";
52 license = lib.licenses.mit;
53 maintainers = with lib.maintainers; [ staccato ];
54 mainProgram = "rstcheck";
55 };
56}