diff --git a/pkgs/development/python-modules/click-aliases/0001-Fix-quotes-in-test.patch b/pkgs/development/python-modules/click-aliases/0001-Fix-quotes-in-test.patch new file mode 100644 index 000000000000..13cc6a68e8d3 --- /dev/null +++ b/pkgs/development/python-modules/click-aliases/0001-Fix-quotes-in-test.patch @@ -0,0 +1,39 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Nicolas Benes +Date: Mon, 12 Jun 2023 11:29:32 +0200 +Subject: [PATCH] Fix quotes in test + + +diff --git a/tests/test_basic.py b/tests/test_basic.py +index 077e6c0..90bbdc3 100644 +--- a/tests/test_basic.py ++++ b/tests/test_basic.py +@@ -43,8 +43,8 @@ def test_foobar(runner): + + TEST_INVALID = """Usage: cli [OPTIONS] COMMAND [ARGS]... + {} +-Error: No such command "bar". +-""".format('Try "cli --help" for help.\n' if _click7 else '') ++Error: No such command 'bar'. ++""".format("Try 'cli --help' for help.\n" if _click7 else '') + + + def test_invalid(runner): +diff --git a/tests/test_foobar.py b/tests/test_foobar.py +index fd6c4e6..ab0ad5d 100644 +--- a/tests/test_foobar.py ++++ b/tests/test_foobar.py +@@ -44,8 +44,8 @@ def test_foobar(runner): + + TEST_INVALID = """Usage: cli [OPTIONS] COMMAND [ARGS]... + {} +-Error: No such command "baz". +-""".format('Try "cli --help" for help.\n' if _click7 else '') ++Error: No such command 'baz'. ++""".format("Try 'cli --help' for help.\n" if _click7 else '') + + + def test_invalid(runner): +-- +2.40.1 + diff --git a/pkgs/development/python-modules/click-aliases/default.nix b/pkgs/development/python-modules/click-aliases/default.nix new file mode 100644 index 000000000000..677cb1309fd7 --- /dev/null +++ b/pkgs/development/python-modules/click-aliases/default.nix @@ -0,0 +1,39 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, click +, pytestCheckHook +}: + +buildPythonPackage rec { + pname = "click-aliases"; + version = "1.0.1"; + + src = fetchFromGitHub { + owner = "click-contrib"; + repo = "click-aliases"; + rev = "v${version}"; + hash = "sha256-vzWlCb4m9TdRaVz4DrlRRZ60+9gj60NoiALgvaIG0gA="; + }; + + patches = [ + ./0001-Fix-quotes-in-test.patch + ]; + + propagatedBuildInputs = [ + click + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + pythonImportsCheck = [ "click_aliases" ]; + + meta = with lib; { + homepage = "https://github.com/click-contrib/click-aliases"; + description = "Enable aliases for click"; + license = licenses.mit; + maintainers = with maintainers; [ panicgh ]; + }; +} diff --git a/pkgs/tools/security/pynitrokey/default.nix b/pkgs/tools/security/pynitrokey/default.nix index 04b4b8e7b85f..ccf30f000ed5 100644 --- a/pkgs/tools/security/pynitrokey/default.nix +++ b/pkgs/tools/security/pynitrokey/default.nix @@ -1,21 +1,28 @@ -{ lib, python3Packages, fetchPypi, nrfutil, libnitrokey }: +{ lib +, python3Packages +, fetchPypi +, nrfutil +, libnitrokey +, nix-update-script +}: with python3Packages; buildPythonApplication rec { pname = "pynitrokey"; - version = "0.4.37"; + version = "0.4.38"; format = "flit"; src = fetchPypi { inherit pname version; - hash = "sha256-KoZym1b+E0P3kRt0PTm9wCX4nO31isDIwEq38xMgDDU="; + hash = "sha256-8TMDbkRyTkzULrBeO0SL/WXB240LD/iZLigE/zPum2A="; }; propagatedBuildInputs = [ certifi cffi click + click-aliases cryptography ecdsa frozendict @@ -26,6 +33,7 @@ buildPythonApplication rec { python-dateutil pyusb requests + semver spsdk tqdm urllib3 @@ -45,7 +53,7 @@ buildPythonApplication rec { "typing_extensions" ]; - # libnitrokey is not propagated to users of pynitrokey + # libnitrokey is not propagated to users of the pynitrokey Python package. # It is only usable from the wrapped bin/nitropy makeWrapperArgs = [ "--set LIBNK_PATH ${lib.makeLibraryPath [ libnitrokey ]}" @@ -56,6 +64,8 @@ buildPythonApplication rec { pythonImportsCheck = [ "pynitrokey" ]; + passthru.updateScript = nix-update-script { }; + meta = with lib; { description = "Python client for Nitrokey devices"; homepage = "https://github.com/Nitrokey/pynitrokey"; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index fd5c9b3b1f00..6d2a3ac3c806 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -1879,6 +1879,8 @@ self: super: with self; { clickclick = callPackage ../development/python-modules/clickclick { }; + click-aliases = callPackage ../development/python-modules/click-aliases { }; + click-command-tree = callPackage ../development/python-modules/click-command-tree { }; click-completion = callPackage ../development/python-modules/click-completion { };