2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, docutils
|
|
|
|
, fetchFromGitHub
|
2022-07-14 12:49:19 +00:00
|
|
|
, importlib-metadata
|
2022-06-16 17:23:12 +00:00
|
|
|
, poetry-core
|
2022-07-14 12:49:19 +00:00
|
|
|
, pydantic
|
2022-06-16 17:23:12 +00:00
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2022-07-14 12:49:19 +00:00
|
|
|
, rstcheck-core
|
|
|
|
, typer
|
2022-06-16 17:23:12 +00:00
|
|
|
, types-docutils
|
|
|
|
, typing-extensions
|
|
|
|
}:
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "rstcheck";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "6.1.1";
|
2022-06-16 17:23:12 +00:00
|
|
|
format = "pyproject";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-07-14 12:49:19 +00:00
|
|
|
owner = "rstcheck";
|
2021-09-18 10:52:07 +00:00
|
|
|
repo = pname;
|
2022-12-17 10:02:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-6TpDzk0GjIn9AnWadwHoYRc3SNi9nBAM7GyKm338wH8=";
|
2021-09-18 10:52:07 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
docutils
|
2022-07-14 12:49:19 +00:00
|
|
|
rstcheck-core
|
2022-06-16 17:23:12 +00:00
|
|
|
types-docutils
|
|
|
|
typing-extensions
|
2022-07-14 12:49:19 +00:00
|
|
|
pydantic
|
|
|
|
typer
|
|
|
|
] ++ lib.optionals (pythonOlder "3.8") [
|
|
|
|
typing-extensions
|
|
|
|
importlib-metadata
|
2022-09-30 11:47:45 +00:00
|
|
|
] ++ typer.optional-dependencies.all;
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"rstcheck"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# The tests need to find and call the rstcheck executable
|
|
|
|
export PATH="$PATH:$out/bin";
|
|
|
|
'';
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Checks syntax of reStructuredText and code blocks nested within it";
|
|
|
|
homepage = "https://github.com/myint/rstcheck";
|
2022-12-17 10:02:37 +00:00
|
|
|
changelog = "https://github.com/rstcheck/rstcheck/blob/v${version}/CHANGELOG.md";
|
2021-09-18 10:52:07 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ staccato ];
|
|
|
|
};
|
|
|
|
}
|