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";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.3.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "82151cbd43ccec94a1530155f4ad34f251aaca6a0ffd5516d7fadf952d32dc1e";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|