python310Packages.typer: add optional-dependencies

This commit is contained in:
Fabian Affolter 2022-09-25 16:45:57 +02:00
parent 5f379c4b68
commit 4bb26cf7a1

View file

@ -1,6 +1,7 @@
{ lib { lib
, stdenv , stdenv
, buildPythonPackage , buildPythonPackage
, colorama
, fetchpatch , fetchpatch
, fetchPypi , fetchPypi
, flit-core , flit-core
@ -23,7 +24,7 @@ buildPythonPackage rec {
src = fetchPypi { src = fetchPypi {
inherit pname version; inherit pname version;
sha256 = "sha256-LVcgpeY/c+rzHtqhX2q4fzXwaQ+MojMBfX0j10OpHXM="; hash = "sha256-LVcgpeY/c+rzHtqhX2q4fzXwaQ+MojMBfX0j10OpHXM=";
}; };
nativeBuildInputs = [ nativeBuildInputs = [
@ -34,14 +35,20 @@ buildPythonPackage rec {
click click
]; ];
checkInputs = [ passthru.optional-dependencies = {
pytestCheckHook all = [
pytest-xdist colorama
pytest-sugar
shellingham shellingham
rich rich
coverage # execs coverage in tests
]; ];
};
checkInputs = [
coverage # execs coverage in tests
pytest-sugar
pytest-xdist
pytestCheckHook
] ++ passthru.optional-dependencies.all;
preCheck = '' preCheck = ''
export HOME=$(mktemp -d); export HOME=$(mktemp -d);
@ -54,10 +61,12 @@ buildPythonPackage rec {
"test_install_completion" "test_install_completion"
]; ];
pythonImportsCheck = [ "typer" ]; pythonImportsCheck = [
"typer"
];
meta = with lib; { meta = with lib; {
description = "Python library for building CLI applications"; description = "Library for building CLI applications";
homepage = "https://typer.tiangolo.com/"; homepage = "https://typer.tiangolo.com/";
license = licenses.mit; license = licenses.mit;
maintainers = with maintainers; [ winpat ]; maintainers = with maintainers; [ winpat ];