1{
2 lib,
3 buildPythonPackage,
4 ed25519,
5 freezegun,
6 fetchFromGitHub,
7 hatchling,
8 pytestCheckHook,
9 pythonOlder,
10 flit-core,
11 requests,
12 securesystemslib,
13}:
14
15buildPythonPackage rec {
16 pname = "tuf";
17 version = "6.0.0";
18 pyproject = true;
19
20 disabled = pythonOlder "3.8";
21
22 src = fetchFromGitHub {
23 owner = "theupdateframework";
24 repo = "python-tuf";
25 tag = "v${version}";
26 hash = "sha256-CPbZOpUYi7MWKLMj7kwTsmEkxLCf4wU7IOCcbzMkPlU=";
27 };
28
29 build-system = [
30 flit-core
31 hatchling
32 ];
33
34 dependencies =
35 [
36 requests
37 securesystemslib
38 ]
39 ++ securesystemslib.optional-dependencies.pynacl
40 ++ securesystemslib.optional-dependencies.crypto;
41
42 checkInputs = [
43 freezegun
44 ];
45
46 nativeCheckInputs = [
47 ed25519
48 pytestCheckHook
49 ];
50
51 pythonImportsCheck = [ "tuf" ];
52
53 preCheck = ''
54 cd tests
55 '';
56
57 meta = {
58 description = "Python reference implementation of The Update Framework (TUF)";
59 homepage = "https://github.com/theupdateframework/python-tuf";
60 changelog = "https://github.com/theupdateframework/python-tuf/blob/v${version}/docs/CHANGELOG.md";
61 license = with lib.licenses; [
62 asl20
63 mit
64 ];
65 maintainers = with lib.maintainers; [ fab ];
66 };
67}