nixpkgs/pkgs/development/python-modules/sphinx-argparse/default.nix
adisbladis 02dab4ab5c python3.pkgs.*: Explicitly pass buildPythonPackage format parameter
Long term we should move everything over to `pyproject = true`, but in
the mean time we can work towards deprecating the implicit `format` paremeter.

cc https://github.com/NixOS/nixpkgs/issues/253154
cc @mweinelt @figsoda
2023-12-07 17:46:49 +01:00

44 lines
1.1 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
, pytestCheckHook
, sphinx
}:
buildPythonPackage rec {
pname = "sphinx-argparse";
version = "0.4.0";
format = "setuptools";
src = fetchPypi {
pname = "sphinx_argparse";
inherit version;
hash = "sha256-4PNBhOtW8S+s53T7yHuICr25AXoJmNHsVZsmfpaX5Ek=";
};
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':"
'';
propagatedBuildInputs = [
sphinx
];
nativeCheckInputs = [
pytestCheckHook
];
pythonImportsCheck = [ "sphinxarg" ];
meta = {
description = "A sphinx extension that automatically documents argparse commands and options";
homepage = "https://github.com/ashb/sphinx-argparse";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ clacke ];
};
}