2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
boto3,
|
|
|
|
buildPythonPackage,
|
|
|
|
cryptography,
|
|
|
|
docutils,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pyyaml,
|
|
|
|
setuptools,
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "credstash";
|
2020-06-15 15:56:04 +00:00
|
|
|
version = "1.17.1";
|
2024-04-21 15:54:59 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fugue";
|
|
|
|
repo = "credstash";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-a6OzffGt5piHgi0AWEXJED0R/+8RETh/9hYJi/lUVu0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
patches = [
|
2024-04-21 15:54:59 +00:00
|
|
|
# setup_requires -> tests_requires for pytest
|
2020-09-25 04:45:31 +00:00
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/fugue/credstash/commit/9c02ee43ed6e37596cafbca2fe80c532ec19d2d8.patch";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-dlybrpfLK+PqwWWhH9iXgXHYysZGmcZAFGWNOwsG0xA=";
|
2020-09-25 04:45:31 +00:00
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
# The install phase puts an executable and a copy of the library it imports in
|
|
|
|
# bin/credstash and bin/credstash.py, despite the fact that the library is also
|
|
|
|
# installed to lib/python<version>/site-packages/credstash.py.
|
|
|
|
# If we apply wrapPythonPrograms to bin/credstash.py then the executable will try
|
|
|
|
# to import the credstash module from the resulting shell script. Removing this
|
|
|
|
# file ensures that Python imports the module from site-packages library.
|
|
|
|
postInstall = "rm $out/bin/credstash.py";
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
|
|
|
boto3
|
|
|
|
cryptography
|
|
|
|
docutils
|
|
|
|
pyyaml
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeBuildInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Tests require a region
|
|
|
|
"integration_tests/test_credstash_lib.py"
|
|
|
|
"tests/key_service_test.py"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A utility for managing secrets in the cloud using AWS KMS and DynamoDB";
|
|
|
|
homepage = "https://github.com/LuminalOSS/credstash";
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://github.com/fugue/credstash/releases/tag/v${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.asl20;
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
|
|
|
mainProgram = "credstash";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|