From cede15570ada8cf83053ebe39d896c33d6365e5f Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Thu, 6 Jun 2024 00:13:44 +0200 Subject: [PATCH] python312Packages.cyclopts: init at 2.6.2 Module to create CLIs based on Python type hints https://github.com/BrianPugh/cyclopts --- .../python-modules/cyclopts/default.nix | 62 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 64 insertions(+) create mode 100644 pkgs/development/python-modules/cyclopts/default.nix diff --git a/pkgs/development/python-modules/cyclopts/default.nix b/pkgs/development/python-modules/cyclopts/default.nix new file mode 100644 index 000000000000..0e89c528057b --- /dev/null +++ b/pkgs/development/python-modules/cyclopts/default.nix @@ -0,0 +1,62 @@ +{ + lib, + attrs, + buildPythonPackage, + docstring-parser, + fetchFromGitHub, + importlib-metadata, + poetry-core, + poetry-dynamic-versioning, + pydantic, + pytest-mock, + pytestCheckHook, + pythonOlder, + rich, + rich-rst, + typing-extensions, +}: + +buildPythonPackage rec { + pname = "cyclopts"; + version = "2.6.2"; + pyproject = true; + + disabled = pythonOlder "3.8"; + + src = fetchFromGitHub { + owner = "BrianPugh"; + repo = "cyclopts"; + rev = "refs/tags/v${version}"; + hash = "sha256-GWUD9Qu2EKrT7nwlmSpJ31LWSvv6mASxsXGznumusdw="; + }; + + build-system = [ + poetry-core + poetry-dynamic-versioning + ]; + + dependencies = [ + attrs + docstring-parser + importlib-metadata + rich + rich-rst + typing-extensions + ]; + + nativeCheckInputs = [ + pydantic + pytest-mock + pytestCheckHook + ]; + + pythonImportsCheck = [ "cyclopts" ]; + + meta = with lib; { + description = "Module to create CLIs based on Python type hints"; + homepage = "https://github.com/BrianPugh/cyclopts"; + changelog = "https://github.com/BrianPugh/cyclopts/releases/tag/v${version}"; + license = licenses.asl20; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 061b75dfcffe..cbf82dbbccca 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2672,6 +2672,8 @@ self: super: with self; { cyclonedx-python-lib = callPackage ../development/python-modules/cyclonedx-python-lib { }; + cyclopts = callPackage ../development/python-modules/cyclopts { }; + cymem = callPackage ../development/python-modules/cymem { }; cypari2 = callPackage ../development/python-modules/cypari2 { };