nixpkgs/pkgs/development/python-modules/cyclopts/default.nix

87 lines
1.6 KiB
Nix

{
lib,
attrs,
buildPythonPackage,
docstring-parser,
fetchFromGitHub,
hatch-vcs,
hatchling,
markdown,
mkdocs,
pydantic,
pymdown-extensions,
pytest-mock,
pytestCheckHook,
pyyaml,
rich-rst,
rich,
sphinx,
syrupy,
trio,
}:
buildPythonPackage (finalAttrs: {
pname = "cyclopts";
version = "4.5.4";
pyproject = true;
src = fetchFromGitHub {
owner = "BrianPugh";
repo = "cyclopts";
tag = "v${finalAttrs.version}";
hash = "sha256-hAh45bw28NNQFl8GiL8UA+1IryxQBPdlGnBKXZih6+g=";
};
build-system = [
hatchling
hatch-vcs
];
dependencies = [
attrs
docstring-parser
rich
rich-rst
];
optional-dependencies = {
trio = [ trio ];
yaml = [ pyyaml ];
docs = [ sphinx ];
mkdocs = [
mkdocs
markdown
pymdown-extensions
];
};
nativeCheckInputs = [
pydantic
pytest-mock
pytestCheckHook
syrupy
]
++ lib.flatten (builtins.attrValues finalAttrs.passthru.optional-dependencies);
pythonImportsCheck = [ "cyclopts" ];
disabledTests = [
# Test requires bash
"test_positional_not_treated_as_command"
# Building docs
"build_succeeds"
];
disabledTestPaths = [
# Tests requires sphinx
"tests/test_sphinx_ext.py"
];
meta = {
description = "Module to create CLIs based on Python type hints";
homepage = "https://github.com/BrianPugh/cyclopts";
changelog = "https://github.com/BrianPugh/cyclopts/releases/tag/${finalAttrs.src.tag}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ fab ];
};
})