2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2022-08-21 13:32:41 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, sphinx
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sphinx-argparse";
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "0.3.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-5UrWyPiVrGu50N2foH5H4TeipCrhinFFFSYuhrTMS6s=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Fix tests for python-3.10 and add 3.10 to CI matrix
|
|
|
|
# Should be fixed in versions > 0.3.1
|
|
|
|
# https://github.com/ashb/sphinx-argparse/pull/3
|
|
|
|
substituteInPlace sphinxarg/parser.py \
|
|
|
|
--replace "if action_group.title == 'optional arguments':" "if action_group.title == 'optional arguments' or action_group.title == 'options':"
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
sphinx
|
|
|
|
];
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "sphinxarg" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
|
|
|
description = "A sphinx extension that automatically documents argparse commands and options";
|
2022-08-21 13:32:41 +00:00
|
|
|
homepage = "https://github.com/ashb/sphinx-argparse";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ clacke ];
|
|
|
|
};
|
|
|
|
}
|