summaryrefslogtreecommitdiffstats
path: root/pkgs/development/python-modules/tuf/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/tuf/default.nix')
-rw-r--r--pkgs/development/python-modules/tuf/default.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/tuf/default.nix b/pkgs/development/python-modules/tuf/default.nix
new file mode 100644
index 000000000000..b6965a7f42e2
--- /dev/null
+++ b/pkgs/development/python-modules/tuf/default.nix
@@ -0,0 +1,61 @@
+{ lib
+, buildPythonPackage
+, ed25519
+, fetchFromGitHub
+, hatchling
+, pytestCheckHook
+, pythonOlder
+, requests
+, securesystemslib
+}:
+
+buildPythonPackage rec {
+ pname = "tuf";
+ version = "3.1.0";
+ pyproject = true;
+
+ disabled = pythonOlder "3.8";
+
+ src = fetchFromGitHub {
+ owner = "theupdateframework";
+ repo = "python-tuf";
+ rev = "refs/tags/v${version}";
+ hash = "sha256-IGF/8RdX7Oxl6gdqPGN1w/6q4zaei+MnYXBZepB4KUA=";
+ };
+
+ postPatch = ''
+ substituteInPlace pyproject.toml \
+ --replace "hatchling==" "hatchling>="
+ '';
+
+ nativeBuildInputs = [
+ hatchling
+ ];
+
+ propagatedBuildInputs = [
+ requests
+ securesystemslib
+ ] ++ securesystemslib.optional-dependencies.pynacl
+ ++ securesystemslib.optional-dependencies.crypto;
+
+ nativeCheckInputs = [
+ ed25519
+ pytestCheckHook
+ ];
+
+ pythonImportsCheck = [
+ "tuf"
+ ];
+
+ preCheck = ''
+ cd tests
+ '';
+
+ meta = with lib; {
+ description = "Python reference implementation of The Update Framework (TUF)";
+ homepage = "https://github.com/theupdateframework/python-tuf";
+ changelog = "https://github.com/theupdateframework/python-tuf/blob/v${version}/docs/CHANGELOG.md";
+ license = with licenses; [ asl20 mit ];
+ maintainers = with maintainers; [ fab ];
+ };
+}