about summary refs log tree commit diff
path: root/pkgs/development
diff options
context:
space:
mode:
authorFabian Affolter <fabian@affolter-engineering.ch>2024-04-10 23:49:29 +0200
committerGitHub <noreply@github.com>2024-04-10 23:49:29 +0200
commitc15b7df7f7a1e70d7663f93fa2121450058bf037 (patch)
tree411257077fa3b66ce70c8cd7f7a41b0de708389a /pkgs/development
parenta8eaee11a972189aabd763a337e27925d2778e3d (diff)
parent52f123b158a0f4c5d25123f366b1e8a3c606f4f4 (diff)
Merge pull request #303059 from fabaff/credstash-refactor
python312Packages.credstash: refactor 
Diffstat (limited to 'pkgs/development')
-rw-r--r--pkgs/development/python-modules/credstash/default.nix51
1 files changed, 40 insertions, 11 deletions
diff --git a/pkgs/development/python-modules/credstash/default.nix b/pkgs/development/python-modules/credstash/default.nix
index 8ed90b65f7a28..dd950001c3d0d 100644
--- a/pkgs/development/python-modules/credstash/default.nix
+++ b/pkgs/development/python-modules/credstash/default.nix
@@ -1,19 +1,36 @@
-{ lib, buildPythonPackage, fetchPypi, cryptography, boto3, pyyaml, docutils, pytest, fetchpatch }:
+{
+  lib,
+  boto3,
+  buildPythonPackage,
+  cryptography,
+  docutils,
+  fetchFromGitHub,
+  fetchpatch,
+  pytestCheckHook,
+  pythonOlder,
+  pyyaml,
+  setuptools,
+}:
 
 buildPythonPackage rec {
   pname = "credstash";
   version = "1.17.1";
-  format = "setuptools";
+  pyproject = true;
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "6c04e8734ef556ab459018da142dd0b244093ef176b3be5583e582e9a797a120";
+  disabled = pythonOlder "3.7";
+
+  src = fetchFromGitHub {
+    owner = "fugue";
+    repo = "credstash";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-a6OzffGt5piHgi0AWEXJED0R/+8RETh/9hYJi/lUVu0=";
   };
 
   patches = [
+    # setup_requires -> tests_requires for pytest
     (fetchpatch {
       url = "https://github.com/fugue/credstash/commit/9c02ee43ed6e37596cafbca2fe80c532ec19d2d8.patch";
-      sha256 = "dlybrpfLK+PqwWWhH9iXgXHYysZGmcZAFGWNOwsG0xA=";
+      hash = "sha256-dlybrpfLK+PqwWWhH9iXgXHYysZGmcZAFGWNOwsG0xA=";
     })
   ];
   # The install phase puts an executable and a copy of the library it imports in
@@ -24,17 +41,29 @@ buildPythonPackage rec {
   # file ensures that Python imports the module from site-packages library.
   postInstall = "rm $out/bin/credstash.py";
 
-  nativeBuildInputs = [ pytest ];
+  build-system = [ setuptools ];
+
+  dependencies = [
+    boto3
+    cryptography
+    docutils
+    pyyaml
+  ];
 
-  propagatedBuildInputs = [ cryptography boto3 pyyaml docutils ];
+  nativeBuildInputs = [ pytestCheckHook ];
 
-  # No tests in archive
-  doCheck = false;
+  disabledTestPaths = [
+    # Tests require a region
+    "integration_tests/test_credstash_lib.py"
+    "tests/key_service_test.py"
+  ];
 
   meta = with lib; {
     description = "A utility for managing secrets in the cloud using AWS KMS and DynamoDB";
-    mainProgram = "credstash";
     homepage = "https://github.com/LuminalOSS/credstash";
+    changelog = "https://github.com/fugue/credstash/releases/tag/v${version}";
     license = licenses.asl20;
+    maintainers = with maintainers; [ ];
+    mainProgram = "credstash";
   };
 }