Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / asn1crypto / default.nix
bloba10ad81c182337a00f383132875041a659486060
1 { lib
2 , buildPythonPackage
3 , python
4 , fetchFromGitHub
6 # build system
7 , setuptools
9 # tests
10 , pytestCheckHook
13 # Switch version based on python version, as the situation isn't easy:
14 #   https://github.com/wbond/asn1crypto/issues/269
15 #   https://github.com/MatthiasValvekens/certomancer/issues/12
16 let
17   provenance = if lib.versionOlder python.version "3.12" then rec {
18     version = "1.5.1";
19     rev = version;
20     hash = "sha256-M8vASxhaJPgkiTrAckxz7gk/QHkrFlNz7fFbnLEBT+M=";
21   } else {
22     version = "1.5.1-unstable-2023-11-03";
23     rev = "b763a757bb2bef2ab63620611ddd8006d5e9e4a2";
24     hash = "sha256-11WajEDtisiJsKQjZMSd5sDog3DuuBzf1PcgSY+uuXY=";
25   };
28 buildPythonPackage rec {
29   pname = "asn1crypto";
30   pyproject = true;
31   inherit (provenance) version;
33   # Pulling from Github to run tests
34   src = fetchFromGitHub {
35     owner = "wbond";
36     repo = "asn1crypto";
37     inherit (provenance) rev hash;
38   };
40   nativeBuildInputs = [
41     setuptools
42   ];
44   nativeCheckInputs = [
45     pytestCheckHook
46   ];
48   meta = {
49     description = "Fast ASN.1 parser and serializer with definitions for private keys, public keys, certificates, CRL, OCSP, CMS, PKCS#3, PKCS#7, PKCS#8, PKCS#12, PKCS#5, X.509 and TSP";
50     license = lib.licenses.mit;
51     homepage = "https://github.com/wbond/asn1crypto";
52     maintainers = with lib.maintainers; [ dotlambda ];
53   };