1{
2 lib,
3 appdirs,
4 buildPythonPackage,
5 cryptography,
6 fetchFromGitHub,
7 flit-core,
8 id,
9 importlib-resources,
10 nix-update-script,
11 platformdirs,
12 pretend,
13 pyasn1,
14 pydantic,
15 pyjwt,
16 pyopenssl,
17 pytestCheckHook,
18 requests,
19 rfc3161-client,
20 rfc8785,
21 rich,
22 securesystemslib,
23 sigstore-models,
24 sigstore-protobuf-specs,
25 sigstore-rekor-types,
26 tuf,
27 writableTmpDirAsHomeHook,
28}:
29
30buildPythonPackage rec {
31 pname = "sigstore-python";
32 version = "4.0.0";
33 pyproject = true;
34
35 src = fetchFromGitHub {
36 owner = "sigstore";
37 repo = "sigstore-python";
38 tag = "v${version}";
39 hash = "sha256-KAHGg2o5t8qfbvLGTzaVoV7AcMkgi3rXxyOQgSASl7A=";
40 };
41
42 pythonRelaxDeps = [
43 "sigstore-rekor-types"
44 "rfc3161-client"
45 "cryptography"
46 ];
47
48 build-system = [ flit-core ];
49
50 dependencies = [
51 appdirs
52 cryptography
53 id
54 importlib-resources
55 pydantic
56 pyjwt
57 pyopenssl
58 pyasn1
59 rfc8785
60 rfc3161-client
61 platformdirs
62 requests
63 rich
64 securesystemslib
65 sigstore-models
66 sigstore-protobuf-specs
67 sigstore-rekor-types
68 tuf
69 ];
70
71 nativeCheckInputs = [
72 pretend
73 pytestCheckHook
74 writableTmpDirAsHomeHook
75 ];
76
77 pythonImportsCheck = [ "sigstore" ];
78
79 disabledTests = [
80 # Tests require network access
81 "test_fail_init_url"
82 "test_get_identity_token_bad_code"
83 "test_identity_proof_claim_lookup"
84 "test_init_url"
85 "test_production"
86 "test_sct_verify_keyring"
87 "test_sign_rekor_entry_consistent"
88 "test_verification_materials_retrieves_rekor_entry"
89 "test_verifier"
90 "test_fix_bundle_fixes_missing_checkpoint"
91 "test_trust_root_bundled_get"
92 "test_fix_bundle_upgrades_bundle"
93 "test_trust_root_tuf_caches_and_requests"
94 "test_regression_verify_legacy_bundle"
95 ];
96
97 passthru.updateScript = nix-update-script { };
98
99 meta = {
100 description = "Codesigning tool for Python packages";
101 homepage = "https://github.com/sigstore/sigstore-python";
102 changelog = "https://github.com/sigstore/sigstore-python/blob/${version}/CHANGELOG.md";
103 license = lib.licenses.asl20;
104 maintainers = with lib.maintainers; [ bot-wxt1221 ];
105 mainProgram = "sigstore";
106 };
107}