2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
pytestCheckHook,
|
|
|
|
sphinx,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sphinx-argparse";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.4.0";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2023-01-20 10:41:00 +00:00
|
|
|
pname = "sphinx_argparse";
|
|
|
|
inherit version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-4PNBhOtW8S+s53T7yHuICr25AXoJmNHsVZsmfpaX5Ek=";
|
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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ sphinx ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2022-08-21 13:32:41 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "sphinxarg" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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 ];
|
|
|
|
};
|
|
|
|
}
|