biome: 1.9.2 -> 1.9.3 (#349335)
[NixPkgs.git] / pkgs / development / python-modules / pynitrokey / default.nix
blob5334ff2bbfdc8f267eeaab9e3bd486cef773e1ec
2   lib,
3   buildPythonPackage,
4   fetchPypi,
5   installShellFiles,
6   libnitrokey,
7   flit-core,
8   certifi,
9   cffi,
10   click,
11   cryptography,
12   ecdsa,
13   fido2,
14   intelhex,
15   nkdfu,
16   python-dateutil,
17   pyusb,
18   requests,
19   tqdm,
20   tlv8,
21   typing-extensions,
22   click-aliases,
23   semver,
24   nethsm,
25   importlib-metadata,
26   nitrokey,
27   pyscard,
28   asn1crypto,
31 let
32   pname = "pynitrokey";
33   version = "0.6.0";
34   mainProgram = "nitropy";
37 buildPythonPackage {
38   inherit pname version;
39   pyproject = true;
41   src = fetchPypi {
42     inherit pname version;
43     hash = "sha256-pY6ATORZDPGRnkN6dse1s/DzQRpplDbPAGUHU4E7U9M=";
44   };
46   nativeBuildInputs = [ installShellFiles ];
48   build-system = [ flit-core ];
50   dependencies = [
51     certifi
52     cffi
53     click
54     cryptography
55     ecdsa
56     fido2
57     intelhex
58     nkdfu
59     python-dateutil
60     pyusb
61     requests
62     tqdm
63     tlv8
64     typing-extensions
65     click-aliases
66     semver
67     nethsm
68     importlib-metadata
69     nitrokey
70     pyscard
71     asn1crypto
72   ];
74   pythonRelaxDeps = true;
76   # pythonRelaxDepsHook runs in postBuild so cannot be used
77   pypaBuildFlags = [ "--skip-dependency-check" ];
79   # libnitrokey is not propagated to users of the pynitrokey Python package.
80   # It is only usable from the wrapped bin/nitropy
81   makeWrapperArgs = [ "--set LIBNK_PATH ${lib.makeLibraryPath [ libnitrokey ]}" ];
83   # no tests
84   doCheck = false;
86   pythonImportsCheck = [ "pynitrokey" ];
88   postInstall = ''
89     installShellCompletion --cmd ${mainProgram} \
90       --bash <(_NITROPY_COMPLETE=bash_source $out/bin/${mainProgram}) \
91       --zsh <(_NITROPY_COMPLETE=zsh_source $out/bin/${mainProgram}) \
92       --fish <(_NITROPY_COMPLETE=fish_source $out/bin/${mainProgram})
93   '';
95   meta = with lib; {
96     description = "Python client for Nitrokey devices";
97     homepage = "https://github.com/Nitrokey/pynitrokey";
98     changelog = "https://github.com/Nitrokey/pynitrokey/releases/tag/v${version}";
99     license = with licenses; [
100       asl20
101       mit
102     ];
103     maintainers = with maintainers; [
104       frogamic
105       raitobezarius
106     ];
107     inherit mainProgram;
108   };