diff --git a/pkgs/development/python-modules/localstack/default.nix b/pkgs/development/python-modules/localstack/default.nix new file mode 100644 index 000000000000..e72f12ef3bb2 --- /dev/null +++ b/pkgs/development/python-modules/localstack/default.nix @@ -0,0 +1,69 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, apispec +, boto3 +, cachetools +, click +, localstack-client +, localstack-ext +, plux +, psutil +, python-dotenv +, pyyaml +, requests +, rich +, semver +, tailer +}: + +buildPythonPackage rec { + pname = "localstack"; + version = "1.0.4"; + + src = fetchFromGitHub { + owner = "localstack"; + repo = "localstack"; + rev = "v${version}"; + sha256 = "sha256-JDF3wM5AVhfkAFlxmy1f3aMxs4J5LWd0JOY8MzRAzT4="; + }; + + postPatch = '' + substituteInPlace setup.cfg \ + --replace "requests>=2.20.0,<2.26" "requests~=2.20" \ + --replace "cachetools~=5.0.0" "cachetools~=5.0" + ''; + + propagatedBuildInputs = [ + apispec + boto3 + cachetools + click + localstack-client + localstack-ext + plux + psutil + python-dotenv + pyyaml + requests + rich + semver + tailer + ]; + + pythonImportsCheck = [ "localstack" ]; + + # Test suite requires boto, which has been removed from nixpkgs + # Just do minimal test, buildPythonPackage maps checkPhase + # to installCheckPhase, so we can test that entrypoint point works. + checkPhase = '' + $out/bin/localstack --version + ''; + + meta = with lib; { + description = "A fully functional local Cloud stack"; + homepage = "https://github.com/localstack/localstack"; + license = licenses.asl20; + maintainers = with maintainers; [ jonringer ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 57899333238b..8ee970f061f0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8677,6 +8677,8 @@ with pkgs; lmp = callPackage ../tools/security/lmp { }; + localstack = with python3Packages; toPythonApplication localstack; + localtime = callPackage ../tools/system/localtime { }; log4j-detect = callPackage ../tools/security/log4j-detect { }; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index a38aeaaad288..5e3c71d062e3 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5333,6 +5333,8 @@ in { localimport = callPackage ../development/python-modules/localimport { }; + localstack = callPackage ../development/python-modules/localstack { }; + localstack-client = callPackage ../development/python-modules/localstack-client { }; localstack-ext = callPackage ../development/python-modules/localstack-ext { };