Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib
2, buildPythonPackage
3, fetchPypi
4, pytestCheckHook
5, sphinx
6}:
7
8buildPythonPackage rec {
9 pname = "sphinx-argparse";
10 version = "0.3.2";
11
12 src = fetchPypi {
13 inherit pname version;
14 sha256 = "sha256-5UrWyPiVrGu50N2foH5H4TeipCrhinFFFSYuhrTMS6s=";
15 };
16
17 postPatch = ''
18 # Fix tests for python-3.10 and add 3.10 to CI matrix
19 # Should be fixed in versions > 0.3.1
20 # https://github.com/ashb/sphinx-argparse/pull/3
21 substituteInPlace sphinxarg/parser.py \
22 --replace "if action_group.title == 'optional arguments':" "if action_group.title == 'optional arguments' or action_group.title == 'options':"
23 '';
24
25 propagatedBuildInputs = [
26 sphinx
27 ];
28
29 checkInputs = [
30 pytestCheckHook
31 ];
32
33 pythonImportsCheck = [ "sphinxarg" ];
34
35 meta = {
36 description = "A sphinx extension that automatically documents argparse commands and options";
37 homepage = "https://github.com/ashb/sphinx-argparse";
38 license = lib.licenses.mit;
39 maintainers = with lib.maintainers; [ clacke ];
40 };
41}